当前位置: 首页>>代码示例>>PHP>>正文


PHP Propel::setConfiguration方法代码示例

本文整理汇总了PHP中Propel::setConfiguration方法的典型用法代码示例。如果您正苦于以下问题:PHP Propel::setConfiguration方法的具体用法?PHP Propel::setConfiguration怎么用?PHP Propel::setConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Propel的用法示例。


在下文中一共展示了Propel::setConfiguration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initialize

 /**
  * @see sfPluginConfiguration
  */
 public function initialize()
 {
     sfConfig::set('sf_orm', 'propel');
     if (!sfConfig::get('sf_admin_module_web_dir')) {
         sfConfig::set('sf_admin_module_web_dir', '/sfPropelPlugin');
     }
     sfToolkit::addIncludePath(array(sfConfig::get('sf_root_dir'), sfConfig::get('sf_propel_runtime_path', realpath(dirname(__FILE__) . '/../lib/vendor'))));
     require_once 'propel/Propel.php';
     if (!Propel::isInit()) {
         if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) {
             Propel::setLogger(new sfPropelLogger($this->dispatcher));
         }
         $propelConfiguration = new PropelConfiguration();
         Propel::setConfiguration($propelConfiguration);
         $this->dispatcher->notify(new sfEvent($propelConfiguration, 'propel.configure'));
         Propel::initialize();
     }
     $this->dispatcher->connect('user.change_culture', array('sfPropel', 'listenToChangeCultureEvent'));
     if (sfConfig::get('sf_web_debug')) {
         $this->dispatcher->connect('debug.web.load_panels', array('sfWebDebugPanelPropel', 'listenToAddPanelEvent'));
     }
     if (sfConfig::get('sf_test')) {
         $this->dispatcher->connect('context.load_factories', array($this, 'clearAllInstancePools'));
     }
 }
开发者ID:xfifix,项目名称:symfony-1.4,代码行数:28,代码来源:sfPropelPluginConfiguration.class.php

示例2: tearDown

 protected function tearDown()
 {
     if ($this->oldPropelConfiguration) {
         Propel::setConfiguration($this->oldPropelConfiguration);
         Propel::initialize();
     }
     parent::tearDown();
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:8,代码来源:PlatformDatabaseBuildTimeBase.php

示例3: setUp

 protected function setUp()
 {
     parent::setUp();
     $xmlDom = new DOMDocument();
     $xmlDom->load(dirname(__FILE__) . '/../../../../fixtures/reverse/mysql/runtime-conf.xml');
     $xml = simplexml_load_string($xmlDom->saveXML());
     $phpconf = OpenedPropelConvertConfTask::simpleXmlToArray($xml);
     Propel::setConfiguration($phpconf);
     Propel::initialize();
 }
开发者ID:ketheriel,项目名称:ETVA,代码行数:10,代码来源:MysqlSchemaParserTest.php

示例4: initialize

 function initialize()
 {
     set_include_path(realpath(dirname(__FILE__) . '/build/classes') . PATH_SEPARATOR . get_include_path());
     require_once "vendor/autoload.php";
     $conf = (include realpath(dirname(__FILE__) . '/build/conf/bookstore-conf.php'));
     $conf['log'] = null;
     Propel::setConfiguration($conf);
     Propel::initialize();
     Propel::disableInstancePooling();
     $this->con = Propel::getConnection('bookstore');
     $this->initTables();
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:12,代码来源:Propel17TestSuite.php

示例5: initialize

 function initialize()
 {
     $loader = (require_once __DIR__ . '/../propel_16/vendor/autoload.php');
     set_include_path(__DIR__ . '/build/classes');
     $conf = (include realpath(dirname(__FILE__) . '/build/conf/bookstore-conf.php'));
     $conf['log'] = null;
     Propel::setConfiguration($conf);
     Propel::initialize();
     Propel::disableInstancePooling();
     $this->con = Propel::getConnection('bookstore');
     $this->con->setAttribute(PropelPDO::PROPEL_ATTR_CACHE_PREPARES, true);
     $this->initTables();
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:13,代码来源:Propel16WithCacheTestSuite.php

示例6: setUp

 protected function setUp()
 {
     $this->markTestSkipped('PGSQL unit test');
     parent::setUp();
     $xmlDom = new DOMDocument();
     $xmlDom->load(dirname(__FILE__) . '/../../../../fixtures/reverse/pgsql/runtime-conf.xml');
     $xml = simplexml_load_string($xmlDom->saveXML());
     $phpconf = TestablePropelConvertConfTask::simpleXmlToArray($xml);
     Propel::setConfiguration($phpconf);
     Propel::initialize();
     $this->con = Propel::getConnection('reverse-bookstore');
     $this->con->beginTransaction();
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:13,代码来源:PgsqlSchemaParserTest.php

示例7: initialize

 function initialize()
 {
     set_include_path(realpath(dirname(__FILE__) . '/build/classes') . PATH_SEPARATOR . realpath(dirname(__FILE__) . '/../propel_17/vendor/propel/runtime/lib') . PATH_SEPARATOR . get_include_path());
     require_once 'Propel.php';
     $conf = (include realpath(dirname(__FILE__) . '/build/conf/bookstore-conf.php'));
     $conf['log'] = null;
     Propel::setConfiguration($conf);
     Propel::initialize();
     Propel::disableInstancePooling();
     $this->con = Propel::getConnection('bookstore');
     $this->con->setAttribute(PropelPDO::PROPEL_ATTR_CACHE_PREPARES, true);
     $this->initTables();
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:13,代码来源:Propel17WithCacheTestSuite.php

示例8: initialize

 public static function initialize()
 {
     $dbConfigs = array();
     $pluginInstances = KalturaPluginManager::getPluginInstances('IKalturaDatabaseConfig');
     foreach ($pluginInstances as $pluginInstance) {
         $dbConfigs[] = $pluginInstance->getDatabaseConfig();
     }
     foreach ($dbConfigs as $dbConfig) {
         self::addExtraConfiguration($dbConfig);
     }
     Propel::setConfiguration(self::$config);
     Propel::setLogger(KalturaLog::getInstance());
     Propel::initialize();
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:14,代码来源:DbManager.php

示例9: boot

 /**
  * {@inheritdoc}
  */
 public function boot()
 {
     require_once $this->container->getParameter('propel.path') . '/runtime/lib/Propel.php';
     if (0 === strncasecmp(PHP_SAPI, 'cli', 3)) {
         set_include_path($this->container->getParameter('propel.phing_path') . '/classes' . PATH_SEPARATOR . get_include_path());
     }
     if (!\Propel::isInit()) {
         \Propel::setConfiguration($this->container->get('propel.configuration'));
         if ($this->container->getParameter('propel.logging')) {
             $this->container->get('propel.configuration')->setParameter('debugpdo.logging.details', array('time' => array('enabled' => true), 'mem' => array('enabled' => true)));
             \Propel::setLogger($this->container->get('propel.logger'));
         }
         \Propel::initialize();
     }
 }
开发者ID:haasalex,项目名称:PropelBundle,代码行数:18,代码来源:PropelBundle.php

示例10: initialize

 public static function initialize()
 {
     $dbConfigs = self::getExtraDatabaseConfigs();
     foreach ($dbConfigs as $dbConfig) {
         self::addExtraConfiguration($dbConfig);
     }
     Propel::setConfiguration(self::$config);
     Propel::setLogger(KalturaLog::getInstance());
     try {
         Propel::initialize();
     } catch (PropelException $pex) {
         KalturaLog::alert($pex->getMessage());
         throw new PropelException("Database error");
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:15,代码来源:DbManager.php

示例11: instanciate

 /**
  * @static
  * @param string $connectionName
  * @return PropelPDO
  */
 public static function instanciate($connectionName)
 {
     $propelConfiguration = Propel::getConfiguration();
     if (isset($propelConfiguration['datasources'][$connectionName]['connection'])) {
         $parameters = $propelConfiguration['datasources'][$connectionName]['connection'];
     } else {
         if (isset($propelConfiguration['datasources'][Propel::getDefaultDB()])) {
             $propelConfiguration['datasources'][$connectionName] = $propelConfiguration['datasources'][Propel::getDefaultDB()];
             Propel::setConfiguration(new PropelConfiguration($propelConfiguration));
             $parameters = $propelConfiguration['datasources'][$connectionName]['connection'];
         } else {
             throw new Exception(sprintf("Unable to find connection parameters for connection '%s'", $connectionName));
         }
     }
     return Propel::initConnection($parameters, $connectionName);
 }
开发者ID:ratibus,项目名称:Crew,代码行数:21,代码来源:PropelPDOFactory.class.php

示例12: execute

 /**
  * @see Command
  *
  * @throws \InvalidArgumentException When the target directory does not exist
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->writeSection($output, '[Propel] You are running the command: propel:database:create');
     list($name, $config) = $this->getConnection($input, $output);
     $dbName = $this->parseDbName($config['connection']['dsn']);
     $query = 'CREATE DATABASE ' . $dbName . ';';
     try {
         \Propel::setConfiguration($this->getTemporaryConfiguration($name, $config));
         $connection = \Propel::getConnection($name);
         $statement = $connection->prepare($query);
         $statement->execute();
         $output->writeln(sprintf('<info>Database <comment>%s</comment> has been created.</info>', $dbName));
     } catch (\Exception $e) {
         $this->writeSection($output, array('[Propel] Exception catched', '', $e->getMessage()), 'fg=white;bg=red');
     }
 }
开发者ID:hhamon,项目名称:PropelBundle,代码行数:21,代码来源:DatabaseCreateCommand.php

示例13: boot

 /**
  * {@inheritdoc}
  */
 public function boot()
 {
     require_once $this->container->getParameter('propel.path') . '/runtime/lib/Propel.php';
     if (0 === strncasecmp(PHP_SAPI, 'cli', 3)) {
         set_include_path($this->container->getParameter('kernel.root_dir') . '/..' . PATH_SEPARATOR . $this->container->getParameter('propel.phing_path') . PATH_SEPARATOR . $this->container->getParameter('propel.phing_path') . '/classes' . PATH_SEPARATOR . get_include_path());
     }
     if (!\Propel::isInit()) {
         \Propel::setConfiguration($this->container->get('propel.configuration'));
         if ($this->container->getParameter('propel.logging')) {
             $config = $this->container->get('propel.configuration');
             $config->setParameter('debugpdo.logging.methods', array('PropelPDO::exec', 'PropelPDO::query', 'PropelPDO::prepare', 'DebugPDOStatement::execute'), false);
             $config->setParameter('debugpdo.logging.details', array('time' => array('enabled' => true), 'mem' => array('enabled' => true), 'connection' => array('enabled' => true)));
             \Propel::setLogger($this->container->get('propel.logger'));
         }
         \Propel::initialize();
     }
 }
开发者ID:ChazalFlorian,项目名称:enjoyPangolin,代码行数:20,代码来源:PropelBundle.php

示例14: initialize

 function initialize()
 {
     set_include_path(realpath(dirname(__FILE__) . '/build/classes') . PATH_SEPARATOR . get_include_path());
     if (file_exists("propel_16/vendor/autoload.php")) {
         require_once "propel_16/vendor/autoload.php";
     } else {
         require_once "../propel_16/vendor/autoload.php";
     }
     $conf = (include realpath(dirname(__FILE__) . '/build/conf/bookstore-conf.php'));
     $conf['log'] = null;
     Propel::setConfiguration($conf);
     Propel::initialize();
     Propel::disableInstancePooling();
     $this->con = Propel::getConnection('bookstore');
     $this->con->setAttribute(PropelPDO::PROPEL_ATTR_CACHE_PREPARES, true);
     $this->initTables();
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:17,代码来源:Propel16WithCacheTestSuite.php

示例15: boot

 /**
  * {@inheritdoc}
  */
 public function boot()
 {
     trigger_error("The PropelBundle uses a new branching model, you should switch to the 1.1 branch (1.1.x versions). For more information, please read: https://github.com/propelorm/PropelBundle/wiki", E_USER_DEPRECATED);
     require_once $this->container->getParameter('propel.path') . '/runtime/lib/Propel.php';
     if (0 === strncasecmp(PHP_SAPI, 'cli', 3)) {
         set_include_path($this->container->getParameter('kernel.root_dir') . '/..' . PATH_SEPARATOR . $this->container->getParameter('propel.phing_path') . PATH_SEPARATOR . $this->container->getParameter('propel.phing_path') . '/classes' . PATH_SEPARATOR . get_include_path());
     }
     if (!\Propel::isInit()) {
         \Propel::setConfiguration($this->container->get('propel.configuration'));
         if ($this->container->getParameter('propel.logging')) {
             $config = $this->container->get('propel.configuration');
             $config->setParameter('debugpdo.logging.methods', array('PropelPDO::exec', 'PropelPDO::query', 'PropelPDO::prepare', 'DebugPDOStatement::execute'), false);
             $config->setParameter('debugpdo.logging.details', array('time' => array('enabled' => true), 'mem' => array('enabled' => true), 'connection' => array('enabled' => true)));
             \Propel::setLogger($this->container->get('propel.logger'));
         }
         \Propel::initialize();
     }
 }
开发者ID:angelk,项目名称:PropelBundle,代码行数:21,代码来源:PropelBundle.php


注:本文中的Propel::setConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。