LoaderInterface PHP Class Code Examples

This page contains top rated real world PHP examples of class LoaderInterface extracted from open source projects. You can rate examples to help us improve the quality of examples

Example #1
Show file File: XmlBuilder.php Project: oliver-graetz/xmlbuilder
0
 /**
  * setLoader
  *
  * @param LoaderInterface $loader
  * @access public
  * @return void
  */
 public function setLoader(LoaderInterface $loader = null)
 {
     if (is_null($loader)) {
         $loader = new XmlLoader();
     }
     $this->loader = $loader;
 }
Example #2
Show file File: AppKernel.php Project: bendavies/ApiTestCase
0
 /**
  * {@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'));
     });
 }
Example #3
Show file File: AppKernel.php Project: alexisfroger/pim-community-dev
0
 /**
  * {@inheritdoc}
  */
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
     if (is_file($file = __DIR__ . '/config/config_' . $this->getEnvironment() . '_local.yml')) {
         $loader->load($file);
     }
     if (isset($this->bundleMap['DoctrineMongoDBBundle'])) {
         $loader->load(__DIR__ . '/config/config_mongodb.yml');
     }
 }
Example #4
Show file File: AppKernel.php Project: fulcrum3d/PartKeepr
0
 /**
  * Loads the configuration for an environment. Also loads a custom configuration for non-text environments from
  * app/config_config_custom.yml if it exists.
  */
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
     if ($this->getEnvironment() !== "test") {
         $customConfig = __DIR__ . '/config/config_custom.yml';
         if (file_exists($customConfig)) {
             $loader->load($customConfig);
         }
     }
 }
Example #5
Show file File: Translator.php Project: Maksold/platform
0
 /**
  * {@inheritdoc}
  */
 public function addLoader($format, LoaderInterface $loader)
 {
     if (null !== $this->resourceCache) {
         // wrap a resource loader by a caching loader to prevent loading of the same resource several times
         // it strongly decreases a translation catalogue loading time
         // for example a time of translation cache warming up is decreased in about 4 times
         $loader = new CachingTranslationLoader($loader, $this->resourceCache);
     }
     parent::addLoader($format, $loader);
 }
Example #6
Show file File: AppKernel.php Project: dddinphp/last-wishes-gamify
0
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load($this->getRootDir() . '/config/config.yml');
     if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
         $loader->load(function ($container) {
             $container->loadFromExtension('web_profiler', ['toolbar' => true, 'intercept_redirects' => false]);
             $container->loadFromExtension('monolog', ['handlers' => ['main' => ['type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug', 'channels' => ['!event']], 'console' => ['type' => 'console', 'channels' => ['!event', '!doctrine']], 'firephp' => ['type' => 'firephp', 'level' => 'info'], 'chromephp' => ['type' => 'chromephp']]]);
         });
     }
 }
Example #7
Show file File: AppKernel.php Project: bwgraves/forkcms
0
 /**
  * @param LoaderInterface $loader
  */
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $fs = new Filesystem();
     if ($fs->exists(__DIR__ . '/config/parameters.yml')) {
         $loader->load(__DIR__ . '/config/config.yml');
     }
     if ($fs->exists(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml')) {
         $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
     }
 }
Example #8
Show file File: ConfigPassKernel.php Project: lucaferri/EasyAdminBundle
0
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     parent::registerContainerConfiguration($loader);
     $backendConfig = $this->backendConfig;
     // needed for PHP 5.3
     $loader->load(function (ContainerBuilder $container) use($backendConfig) {
         $container->loadFromExtension('easy_admin', $backendConfig);
     });
 }
Example #9
Show file File: AppKernel.php Project: Reflex14/symfony-test
0
 /**
  * {@inheritdoc}
  */
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
     // This small hack allows to register custom
     // configuration files for executing tests.
     if (function_exists('registerContainerConfiguration')) {
         registerContainerConfiguration($loader);
     }
 }
Example #10
Show file File: AppKernel.php Project: slavomirkuzma/symfony-app3
0
 /**
  *
  * @param LoaderInterface $loader            
  */
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $environment = $this->getEnvironment();
     $config = __DIR__ . sprintf('/config/%s/config.xml', $environment);
     if (!file_exists($config)) {
         $config = __DIR__ . sprintf('/config/config.xml');
     }
     $loader->load($config);
 }
Example #11
Show file File: AppKernel.php Project: ollietb/sulu
0
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     parent::registerContainerConfiguration($loader);
     if (class_exists('Sulu\\Bundle\\SearchBundle\\SuluSearchBundle')) {
         $loader->load(__DIR__ . '/config/search.yml');
     }
 }
Example #12
Show file File: AppKernel.php Project: xiaoguizhidao/EasyAdminBundle
0
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
     if ($this->isSymfony3()) {
         $loader->load(function (ContainerBuilder $container) {
             $container->loadFromExtension('framework', array('assets' => null));
         });
     }
 }
Example #13
Show file File: AppKernel.php Project: jaume-prat-tvg/symfony-minimal-distribution
0
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load(__DIR__ . '/config/config.yml');
     if (in_array($this->getEnvironment(), array('dev', 'test'))) {
         $loader->load(function ($container) {
             $container->loadFromExtension('web_profiler', array('toolbar' => true));
         });
     }
 }
Example #14
Show file File: AppKernel.php Project: djmarland/tube
0
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $suffix = '';
     $env = $this->getEnvironment();
     if (in_array($env, ['dev', 'test'])) {
         $suffix = '_' . $env;
     }
     $loader->load($this->getRootDir() . '/config/' . static::CONFIG_FILE . $suffix . '.yml');
 }
Example #15
Show file File: AbstractKernel.php Project: OldTimeSake/sulu-standard
0
 /**
  * {@inheritdoc}
  */
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load(__DIR__ . '/config/' . $this->getContext() . '/config_' . $this->getEnvironment() . '.yml');
     $userConfig = __DIR__ . '/config/config.local.yml';
     if (file_exists($userConfig)) {
         $loader->load($userConfig);
     }
 }
Example #16
Show file File: AppKernel.php Project: coyl/git-automation
0
 protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader)
 {
     $parser = new \Symfony\Component\Yaml\Parser();
     $parametersFile = file_get_contents($this->getRootDir() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'parameters.yml');
     $parameters = $parser->parse($parametersFile);
     $c->loadFromExtension('framework', ['secret' => 'none']);
     $c->addDefinitions(['git_automation.jira_api' => $this->createJiraApiService($parameters['parameters'])]);
 }
Example #17
Show file File: FixturesExecutor.php Project: luchaninov/AliceBundle
0
 /**
  * {@inheritdoc}
  */
 public function execute(ObjectManager $manager, LoaderInterface $loader, array $fixturesFiles, $append, $loggerCallable, $truncate = false)
 {
     // Get executor
     $executor = $this->getExecutor($manager, $loader, $truncate);
     $executor->setLogger($loggerCallable);
     // Purge database and load fixtures
     $executor->execute($fixturesFiles, $append);
 }
Example #18
Show file File: MicroKernelTrait.php Project: Ener-Getick/symfony
0
 /**
  * {@inheritdoc}
  */
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load(function (ContainerBuilder $container) use($loader) {
         $container->loadFromExtension('framework', array('router' => array('resource' => 'kernel:loadRoutes', 'type' => 'service')));
         $this->configureContainer($container, $loader);
         $container->addObjectResource($this);
     });
 }
Example #19
Show file File: AppKernel.php Project: akamalov/slackmessenger
0
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
     $envParameters = $this->getEnvParameters();
     $loader->load(function ($container) use($envParameters) {
         $container->getParameterBag()->add($envParameters);
     });
 }
Example #20
Show file File: RestRouteProcessor.php Project: anhpha/reports
0
 /**
  * Import & return routes collection from a resource.
  *
  * @param LoaderInterface $loader      The Loader
  * @param mixed           $resource    A Resource
  * @param array           $parents     Array of parent resources names
  * @param string          $routePrefix Current routes prefix
  * @param string          $namePrefix  Routes names prefix
  * @param string          $type        The resource type
  * @param string          $currentDir  Current directory of the loader
  *
  * @return RouteCollection A RouteCollection instance
  */
 public function importResource(LoaderInterface $loader, $resource, array $parents = array(), $routePrefix = null, $namePrefix = null, $type = null, $currentDir = null)
 {
     $loader = $loader->resolve($resource, $type);
     if ($loader instanceof FileLoader && null !== $currentDir) {
         $resource = $loader->getLocator()->locate($resource, $currentDir);
     } elseif ($loader instanceof RestRouteLoader) {
         $loader->getControllerReader()->getActionReader()->setParents($parents);
         $loader->getControllerReader()->getActionReader()->setRoutePrefix($routePrefix);
         $loader->getControllerReader()->getActionReader()->setNamePrefix($namePrefix);
     }
     return $loader->load($resource, $type);
 }
Frequently Used Methods