本文整理汇总了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');
}