本文整理汇总了PHP中sfProjectConfiguration::getPluginConfiguration方法的典型用法代码示例。如果您正苦于以下问题:PHP sfProjectConfiguration::getPluginConfiguration方法的具体用法?PHP sfProjectConfiguration::getPluginConfiguration怎么用?PHP sfProjectConfiguration::getPluginConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfProjectConfiguration
的用法示例。
在下文中一共展示了sfProjectConfiguration::getPluginConfiguration方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFixtureDir
/** Returns the path to the fixture directory for this test case.
*
* @param bool $production Whether to load production fixtures.
* @param string $plugin Which plugin to load fixtures for.
*
* @return string
*/
public function getFixtureDir($production = false, $plugin = null)
{
if ($plugin) {
$config = $this->_configuration->getPluginConfiguration($plugin);
return sprintf('%s/%s/fixtures/', $config->getRootDir(), $production ? 'data' : 'test');
} else {
return sprintf('%s/fixtures/', sfConfig::get($production ? 'sf_data_dir' : 'sf_test_dir'));
}
}
示例2: initializeAutoload
/**
* Initializes autoloaders.
*
* @param sfProjectConfiguration $configuration The current project or application configuration
* @param boolean $reload If true, all autoloaders will be reloaded
*/
protected function initializeAutoload(sfProjectConfiguration $configuration, $reload = false)
{
// sfAutoload
if ($reload) {
$this->logSection('autoload', 'Resetting application autoloaders');
$finder = sfFinder::type('file')->name('*autoload.yml.php');
$this->getFilesystem()->remove($finder->in(sfConfig::get('sf_cache_dir')));
sfAutoload::getInstance()->reloadClasses(true);
}
// sfSimpleAutoload
if (!$configuration instanceof sfApplicationConfiguration) {
// plugins
if ($reload) {
foreach ($configuration->getPlugins() as $name) {
$configuration->getPluginConfiguration($name)->initializeAutoload();
}
}
// project
$autoload = sfSimpleAutoload::getInstance(sfConfig::get('sf_cache_dir') . '/project_autoload.cache');
$autoload->loadConfiguration(sfFinder::type('file')->name('autoload.yml')->in(array(sfConfig::get('sf_symfony_lib_dir') . '/config/config', sfConfig::get('sf_config_dir'))));
$autoload->register();
if ($reload) {
$this->logSection('autoload', 'Resetting CLI autoloader');
$autoload->reload();
}
}
}
示例3: __construct
/**
* Constructor.
*
* @see sfTask
*/
public function __construct(sfProjectConfiguration $configuration, sfFormatter $formatter)
{
parent::__construct($configuration->getEventDispatcher(), $formatter);
$this->configuration = $configuration;
$this->pluginConfiguration = $configuration->getPluginConfiguration('sfTaskExtraPlugin');
}