本文整理匯總了PHP中Symfony\Component\Config\Loader\LoaderInterface::import方法的典型用法代碼示例。如果您正苦於以下問題:PHP LoaderInterface::import方法的具體用法?PHP LoaderInterface::import怎麽用?PHP LoaderInterface::import使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\Config\Loader\LoaderInterface
的用法示例。
在下文中一共展示了LoaderInterface::import方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: registerContainerConfiguration
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__ . '/config/config.php');
if ($this->getEnvironment() !== 'behat' && file_exists(ResourceContext::getConfigurationFile())) {
$loader->import(ResourceContext::getConfigurationFile());
}
}
示例2: registerContainerConfiguration
/**
* {@inheritdoc}
*/
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->import($this->getRootDir() . '/config/parameters.php');
$loader->load(function ($container) {
$container->loadFromExtension('framework', array('test' => null, 'secret' => 'secret', 'router' => array('resource' => '%kernel.root_dir%/config/routing.yml')));
$container->loadFromExtension('doctrine', array('dbal' => array('driver' => 'pdo_mysql', 'dbname' => 'symfony_project', 'user' => '%database.user%', 'password' => '%database.password%', 'server_version' => '5.6'), 'orm' => array('auto_mapping' => false, 'mappings' => array('Lakion\\ApiTestCase' => array('dir' => '%kernel.root_dir%/config/doctrine', 'prefix' => 'Lakion\\ApiTestCase\\Test\\Entity', 'alias' => 'ApiTestCase', 'is_bundle' => false, 'type' => 'yml')))));
$container->setDefinition('app.service', new Definition('Lakion\\ApiTestCase\\Test\\Service\\DummyService'));
});
}
示例3: registerContainerConfiguration
/**
* Loading the config for the current evironment
* and importing platform-specific parameters depending of computer's name
*
* With this system you can store/commit/track (or not with .gitignore) every change in
* every config on every computer. Reduce the rate of "But it works on my computer !"
*
* I prefer this system than one from Incenteev but you can mix both
*
* @param \Symfony\Component\Config\Loader\LoaderInterface $loader
*/
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->rootDir . '/config/config_' . $this->getEnvironment() . '.yml');
$loader->import($this->rootDir . Script::getPlatformSubdir() . Script::getPlatformName() . '.yml');
}
示例4: registerContainerConfiguration
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->import(CMF_TEST_CONFIG_DIR . '/default.php');
$loader->import(CMF_TEST_CONFIG_DIR . '/phpcr_odm.php');
$loader->load(__DIR__ . '/config/config.yml');
}