本文整理汇总了PHP中CM_Util::getResourceFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP CM_Util::getResourceFiles方法的具体用法?PHP CM_Util::getResourceFiles怎么用?PHP CM_Util::getResourceFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CM_Util
的用法示例。
在下文中一共展示了CM_Util::getResourceFiles方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetResourceFiles
public function testGetResourceFiles()
{
$files = CM_Util::getResourceFiles('config/default.php');
if (!count($files)) {
$this->markTestSkipped('There are no files to test this functionality');
}
foreach ($files as $file) {
$this->assertInstanceOf('CM_File', $file);
$this->assertSame('default.php', $file->getFileName());
}
}
示例2: load
public function load(CM_OutputStream_Interface $output)
{
$mysqlDbClient = $this->getServiceManager()->getDatabases()->getMaster();
$databaseName = $mysqlDbClient->getDatabaseName();
$mysqlClient = $mysqlDbClient->getClientWithoutDatabase();
$mysqlClient->createStatement('CREATE DATABASE ' . $mysqlClient->quoteIdentifier($databaseName))->execute();
foreach (CM_Util::getResourceFiles('db/structure.sql') as $dump) {
CM_Db_Db::runDump($databaseName, $dump);
}
$this->_setInitialVersion();
}
示例3: load
public function load(CM_OutputStream_Interface $output)
{
/** @var CM_Model_Language $language */
foreach (new CM_Paging_Language_All() as $language) {
$path = 'translations/' . $language->getAbbreviation() . '.php';
foreach (CM_Util::getResourceFiles($path) as $translationsFile) {
$translationsSetter = (require $translationsFile->getPath());
if (!$translationsSetter instanceof Closure) {
throw new CM_Exception_Invalid('Invalid translation file. `' . $translationsFile->getPath() . '` must return callable');
}
$translationsSetter($language);
}
}
$this->_setLoaded(true);
}
示例4: extend
/**
* @param string $configBasename
* @throws CM_Exception_Invalid
*/
public function extend($configBasename)
{
foreach (CM_Util::getResourceFiles('config/' . $configBasename) as $configFile) {
$this->extendWithFile($configFile);
}
}