Configuration PHP Class Code Examples

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

Example #1
Show file File: manager.php Project: 453111208/bbc
0
 public function __construct(Configuration $config = null)
 {
     if (!$config) {
         $config = new Configuration();
     }
     $this->configuration = $config;
 }
Example #2
Show file File: UpdateCommandTest.php Project: boskee/SpBowerBundle
0
 public function testUpdate()
 {
     $configuration = new Configuration('/foo');
     $configuration->setAssetDirectory('/test');
     $configuration->setJsonFile('foo.json');
     $barConfig = new Configuration('/bar');
     $bundles = array('DemoBundle' => $configuration, 'AcmeBundle' => $barConfig);
     $this->bower->expects($this->at(0))->method('update')->with($this->equalTo($configuration));
     $this->bower->expects($this->at(1))->method('update')->with($this->equalTo($barConfig));
     $this->bm->expects($this->once())->method('getBundles')->will($this->returnValue($bundles));
     $this->command->run(new ArrayInput(array()), new NullOutput());
 }
Example #3
Show file File: FormBuilder.php Project: graurus/testgit_t37
0
 /**
  * @param Configuration $configuration
  * @return FormBuilder
  */
 public static function create(Configuration $configuration)
 {
     /** @var FormBuilder $formBuilder */
     $formBuilder = \TYPO3\CMS\Form\Utility\FormUtility::getObjectManager()->get(FormBuilder::class);
     $formBuilder->setConfiguration($configuration);
     return $formBuilder;
 }
Example #4
Show file File: Connection.php Project: kalaspuffar/php-orm-benchmark
0
 /**
  * Initializes a new instance of the Connection class.
  *
  * @param array                              $params       The connection parameters.
  * @param \Doctrine\DBAL\Driver              $driver       The driver to use.
  * @param \Doctrine\DBAL\Configuration|null  $config       The configuration, optional.
  * @param \Doctrine\Common\EventManager|null $eventManager The event manager, optional.
  *
  * @throws \Doctrine\DBAL\DBALException
  */
 public function __construct(array $params, Driver $driver, Configuration $config = null, EventManager $eventManager = null)
 {
     $this->_driver = $driver;
     $this->_params = $params;
     if (isset($params['pdo'])) {
         $this->_conn = $params['pdo'];
         $this->_isConnected = true;
     }
     // Create default config and event manager if none given
     if (!$config) {
         $config = new Configuration();
     }
     if (!$eventManager) {
         $eventManager = new EventManager();
     }
     $this->_config = $config;
     $this->_eventManager = $eventManager;
     $this->_expr = new Query\Expression\ExpressionBuilder($this);
     if (!isset($params['platform'])) {
         $this->_platform = $driver->getDatabasePlatform();
     } else {
         if ($params['platform'] instanceof Platforms\AbstractPlatform) {
             $this->_platform = $params['platform'];
         } else {
             throw DBALException::invalidPlatformSpecified();
         }
     }
     $this->_platform->setEventManager($eventManager);
     $this->_transactionIsolationLevel = $this->_platform->getDefaultTransactionIsolationLevel();
 }
Example #5
Show file File: appDevDebugProjectContainer.php Project: gambaj/ContactSymfony
0
 /**
  * Gets the 'doctrine.orm.default_entity_manager' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \Doctrine\ORM\EntityManager A Doctrine\ORM\EntityManager instance.
  */
 protected function getDoctrine_Orm_DefaultEntityManagerService()
 {
     $a = $this->get('annotation_reader');
     $b = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($a, array(0 => $this->targetDirs[3] . '\\src\\ContactBundle\\Entity', 1 => $this->targetDirs[3] . '\\src\\AuthentificationBundle\\Entity'));
     $c = new \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain();
     $c->addDriver($b, 'ContactBundle\\Entity');
     $c->addDriver($b, 'AuthentificationBundle\\Entity');
     $d = new \Doctrine\ORM\Configuration();
     $d->setEntityNamespaces(array('ContactBundle' => 'ContactBundle\\Entity', 'AuthentificationBundle' => 'AuthentificationBundle\\Entity'));
     $d->setMetadataCacheImpl($this->get('doctrine_cache.providers.doctrine.orm.default_metadata_cache'));
     $d->setQueryCacheImpl($this->get('doctrine_cache.providers.doctrine.orm.default_query_cache'));
     $d->setResultCacheImpl($this->get('doctrine_cache.providers.doctrine.orm.default_result_cache'));
     $d->setMetadataDriverImpl($c);
     $d->setProxyDir(__DIR__ . '/doctrine/orm/Proxies');
     $d->setProxyNamespace('Proxies');
     $d->setAutoGenerateProxyClasses(true);
     $d->setClassMetadataFactoryName('Doctrine\\ORM\\Mapping\\ClassMetadataFactory');
     $d->setDefaultRepositoryClassName('Doctrine\\ORM\\EntityRepository');
     $d->setNamingStrategy(new \Doctrine\ORM\Mapping\UnderscoreNamingStrategy());
     $d->setQuoteStrategy(new \Doctrine\ORM\Mapping\DefaultQuoteStrategy());
     $d->setEntityListenerResolver($this->get('doctrine.orm.default_entity_listener_resolver'));
     $this->services['doctrine.orm.default_entity_manager'] = $instance = \Doctrine\ORM\EntityManager::create($this->get('doctrine.dbal.default_connection'), $d);
     $this->get('doctrine.orm.default_manager_configurator')->configure($instance);
     return $instance;
 }
Example #6
Show file File: Bootstrap.php Project: AgniCMS/agni-framework
0
 /**
  * setup configuration for Doctrine Dbal.
  * 
  * @param array $db_config array config for override the default configuration.
  */
 public function setupConfigurationDbal(array $db_config = [])
 {
     $dbal_config = new Configuration();
     if (empty($db_config)) {
         //setup connection configuration.
         $config = new SystemConfig();
         $config->load('db');
         $db_params = $config->get('ALL', 'db');
         unset($config, $db_params['table_prefix']);
     } else {
         $db_params = $db_config;
         unset($db_params['table_prefix']);
     }
     $dbal_config->setSQLLogger(new \System\Libraries\Db\Logger());
     try {
         $this->Conn = DriverManager::getConnection($db_params, $dbal_config);
         $this->Conn->connect();
     } catch (\Doctrine\DBAL\DBALException $e) {
         http_response_code(500);
         echo $e->getMessage();
         exit;
     }
     $this->Conn->setFetchMode(\PDO::FETCH_OBJ);
     unset($dbal_config, $db_params);
 }
Example #7
Show file File: ConfigurationTest.php Project: laubosslink/lab
0
 /**
  * @dataProvider getDebugModes
  */
 public function testConfigTree($options, $results)
 {
     $processor = new Processor();
     $configuration = new Configuration(array());
     $config = $processor->processConfiguration($configuration, array($options));
     $this->assertEquals($results, $config);
 }
Example #8
Show file File: LuneticsLocaleExtension.php Project: Sententiaregum/LocaleBundle
0
 /**
  * {@inheritDoc}
  */
 public function load(array $configs, ContainerBuilder $container)
 {
     $configuration = new Configuration();
     $config = $this->processConfiguration($configuration, $configs);
     $this->bindParameters($container, $this->getAlias(), $config);
     // Fallback for missing intl extension
     $intlExtensionInstalled = extension_loaded('intl');
     $container->setParameter('lunetics_locale.intl_extension_installed', $intlExtensionInstalled);
     $iso3166 = array();
     $iso639one = array();
     $iso639two = array();
     $localeScript = array();
     if (!$intlExtensionInstalled) {
         $yamlParser = new YamlParser();
         $file = new FileLocator(__DIR__ . '/../Resources/config');
         $iso3166 = $yamlParser->parse(file_get_contents($file->locate('iso3166-1-alpha-2.yml')));
         $iso639one = $yamlParser->parse(file_get_contents($file->locate('iso639-1.yml')));
         $iso639two = $yamlParser->parse(file_get_contents($file->locate('iso639-2.yml')));
         $localeScript = $yamlParser->parse(file_get_contents($file->locate('locale_script.yml')));
     }
     $container->setParameter('lunetics_locale.intl_extension_fallback.iso3166', $iso3166);
     $mergedValues = array_merge($iso639one, $iso639two);
     $container->setParameter('lunetics_locale.intl_extension_fallback.iso639', $mergedValues);
     $container->setParameter('lunetics_locale.intl_extension_fallback.script', $localeScript);
     $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $loader->load('validator.xml');
     $loader->load('guessers.xml');
     $loader->load('services.xml');
     $loader->load('switcher.xml');
     $loader->load('form.xml');
     if (!$config['strict_match']) {
         $container->removeDefinition('lunetics_locale.best_locale_matcher');
     }
 }
Example #9
Show file File: appDevDebugProjectContainer.php Project: asa93/Batch
0
 /**
  * Gets the 'doctrine.orm.default_entity_manager' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \Doctrine\ORM\EntityManager A Doctrine\ORM\EntityManager instance.
  */
 protected function getDoctrine_Orm_DefaultEntityManagerService()
 {
     $a = $this->get('annotation_reader');
     $b = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($a, array(0 => $this->targetDirs[3] . '\\src\\BDE\\ShowcaseBundle\\Entity', 1 => $this->targetDirs[3] . '\\src\\Train\\CoreBundle\\Entity', 2 => $this->targetDirs[3] . '\\src\\Train\\UserBundle\\Entity'));
     $c = new \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain();
     $c->addDriver($b, 'BDE\\ShowcaseBundle\\Entity');
     $c->addDriver($b, 'Train\\CoreBundle\\Entity');
     $c->addDriver($b, 'Train\\UserBundle\\Entity');
     $d = new \Doctrine\ORM\Configuration();
     $d->setEntityNamespaces(array('BDEShowcaseBundle' => 'BDE\\ShowcaseBundle\\Entity', 'TrainCoreBundle' => 'Train\\CoreBundle\\Entity', 'TrainUserBundle' => 'Train\\UserBundle\\Entity'));
     $d->setMetadataCacheImpl($this->get('doctrine_cache.providers.doctrine.orm.default_metadata_cache'));
     $d->setQueryCacheImpl($this->get('doctrine_cache.providers.doctrine.orm.default_query_cache'));
     $d->setResultCacheImpl($this->get('doctrine_cache.providers.doctrine.orm.default_result_cache'));
     $d->setMetadataDriverImpl($c);
     $d->setProxyDir(__DIR__ . '/doctrine/orm/Proxies');
     $d->setProxyNamespace('Proxies');
     $d->setAutoGenerateProxyClasses(true);
     $d->setClassMetadataFactoryName('Doctrine\\ORM\\Mapping\\ClassMetadataFactory');
     $d->setDefaultRepositoryClassName('Doctrine\\ORM\\EntityRepository');
     $d->setNamingStrategy(new \Doctrine\ORM\Mapping\DefaultNamingStrategy());
     $d->setQuoteStrategy(new \Doctrine\ORM\Mapping\DefaultQuoteStrategy());
     $d->setEntityListenerResolver($this->get('doctrine.orm.default_entity_listener_resolver'));
     $this->services['doctrine.orm.default_entity_manager'] = $instance = \Doctrine\ORM\EntityManager::create($this->get('doctrine.dbal.default_connection'), $d);
     $this->get('doctrine.orm.default_manager_configurator')->configure($instance);
     return $instance;
 }
Example #10
Show file File: UtilisateursExtension.php Project: bamper/ecommerce
0
 /**
  * {@inheritdoc}
  */
 public function load(array $configs, ContainerBuilder $container)
 {
     $configuration = new Configuration();
     $config = $this->processConfiguration($configuration, $configs);
     $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $loader->load('services.yml');
 }
Frequently Used Methods