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


PHP Propel::disableInstancePooling方法代码示例

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


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

示例1: setUp

 protected function setUp()
 {
     parent::setUp();
     BookstoreDataPopulator::populate($this->con);
     Propel::disableInstancePooling();
     $this->books = PropelQuery::from('Book')->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)->find();
 }
开发者ID:halfer,项目名称:Meshing,代码行数:7,代码来源:PropelOnDemandCollectionTest.php

示例2: setUp

    protected function setUp()
    {
        if (!class_exists('DBStudent')) {
            $schema = <<<XML
<database name="class_prefixed_db">
    <table name="student">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="name" type="VARCHAR" required="true" />
    </table>

    <table name="classmate">
        <behavior name="equal_nest">
            <parameter name="parent_table" value="student" />
        </behavior>
    </table>
</database>
XML;
            $builder = $this->getBuilder($schema);
            $config = $builder->getConfig();
            $config->setBuildProperty('classPrefix', 'DB');
            $builder->setConfig($config);
            $builder->build();
        }
        Propel::disableInstancePooling();
        DBStudentQuery::create()->deleteAll();
    }
开发者ID:VanTanev,项目名称:EqualNestBehavior,代码行数:26,代码来源:EqualNestBehaviorWithClassPrefixTest.php

示例3: testFormatALotOfResults

 public function testFormatALotOfResults()
 {
     $nbBooks = 50;
     $con = Propel::getConnection(BookPeer::DATABASE_NAME);
     Propel::disableInstancePooling();
     $book = new Book();
     for ($i = 0; $i < $nbBooks; $i++) {
         $book->clear();
         $book->setTitle('BookTest' . $i);
         $book->save($con);
     }
     $stmt = $con->query('SELECT * FROM book');
     $formatter = new PropelOnDemandFormatter();
     $formatter->init(new ModelCriteria('bookstore', 'Book'));
     $books = $formatter->format($stmt);
     $this->assertTrue($books instanceof PropelOnDemandCollection, 'PropelOnDemandFormatter::format() returns a PropelOnDemandCollection');
     $this->assertEquals($nbBooks, count($books), 'PropelOnDemandFormatter::format() returns a collection that counts as many rows as the results in the query');
     $i = 0;
     foreach ($books as $book) {
         $this->assertTrue($book instanceof Book, 'PropelOnDemandFormatter::format() returns a collection of Model objects');
         $this->assertEquals('BookTest' . $i, $book->getTitle(), 'PropelOnDemandFormatter::format() returns the model objects matching the query');
         $i++;
     }
     Propel::enableInstancePooling();
 }
开发者ID:kcornejo,项目名称:estadistica,代码行数:25,代码来源:PropelOnDemandFormatterTest.php

示例4: setUp

 public function setUp()
 {
     parent::setUp();
     if (!interface_exists('Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\ParamConverterInterface')) {
         $this->markTestSkipped('SensioFrameworkExtraBundle is not available.');
     }
     \Propel::disableInstancePooling();
 }
开发者ID:ChazalFlorian,项目名称:enjoyPangolin,代码行数:8,代码来源:PropelParamConverterTest.php

示例5: __construct

 public function __construct()
 {
     $this->wwwPath = Curry_Core::$config->curry->wwwPath;
     Propel::disableInstancePooling();
     Propel::setLogger(null);
     if ($this->debug) {
         $this->con = Propel::getConnection(PagePeer::DATABASE_NAME);
         $this->con->useDebug(true);
     }
     $this->setupLogger();
 }
开发者ID:josedsilva,项目名称:curry-backend-cleanup-file-system,代码行数:11,代码来源:CleanupFileSystem.php

示例6: __construct

 public function __construct($label = false)
 {
     // Different package name to test 2
     parent::__construct('test_version', $label);
     // Clear out old table map, create us a new one
     $this->resetDatabaseMap(BaseTestVersionTestOrganiserPeer::DATABASE_NAME, array('TestVersionTestOrganiserTableMap', 'TestVersionTestEventTableMap', 'TestVersionKnownNodeTableMap'));
     $this->node = $this->createKnownNode(new TestVersionKnownNode(), $this->conNode);
     // I've witnessed incorrect caching on 27 Nov 2011, might be due to my messing about
     // with Propel internals too much. Disabling pooling for tests :-0
     Propel::disableInstancePooling();
 }
开发者ID:halfer,项目名称:Meshing,代码行数:11,代码来源:4_version_test.php

示例7: 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

示例8: 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

示例9: 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

示例10: postUp

 public function postUp($manager)
 {
     // add the post-migration code here
     require_once $_SERVER['PWD'] . '/base/lib/inc.php';
     $oConnection = Propel::getConnection(DocumentPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
     Propel::disableInstancePooling();
     $stmt = DocumentPeer::doSelectStmt(DocumentQuery::create()->clearSelectColumns()->addSelectColumn('documents.id')->addSelectColumn('documents.hash'));
     foreach ($stmt->fetchAll(PDO::FETCH_NUM) as $row) {
         $iId = $row[0];
         $sHash = $row[1];
         $oConnection->exec('INSERT IGNORE INTO `document_data` (`hash`, `data`, `created_at`, `updated_at`, `created_by`, `updated_by`) VALUES ("' . $sHash . '", (SELECT `data` FROM `documents` WHERE `id` = ' . $iId . '), (SELECT `created_at` FROM `documents` WHERE `id` = ' . $iId . '), (SELECT `updated_at` FROM `documents` WHERE `id` = ' . $iId . '), (SELECT `created_by` FROM `documents` WHERE `id` = ' . $iId . '), (SELECT `updated_by` FROM `documents` WHERE `id` = ' . $iId . '))');
     }
     $stmt->closeCursor();
 }
开发者ID:rapila,项目名称:cms-base,代码行数:14,代码来源:PropelMigration_1400855437.php

示例11: testInstancePoolingReenabled

 public function testInstancePoolingReenabled()
 {
     Propel::enableInstancePooling();
     $books = PropelQuery::from('Book')->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)->find($this->con);
     foreach ($books as $book) {
     }
     $this->assertTrue(Propel::isInstancePoolingEnabled());
     Propel::disableInstancePooling();
     $books = PropelQuery::from('Book')->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)->find($this->con);
     foreach ($books as $book) {
     }
     $this->assertFalse(Propel::isInstancePoolingEnabled());
     Propel::enableInstancePooling();
 }
开发者ID:ketheriel,项目名称:ETVA,代码行数:14,代码来源:PropelOnDemandIteratorTest.php

示例12: __construct

 /**
  * Constructor.
  */
 public function __construct()
 {
     parent::__construct();
     // Override and increase max execution time if set
     $timeLimit = ini_get('max_execution_time');
     if ($timeLimit && $timeLimit < 250) {
         @set_time_limit(250);
     }
     Propel::disableInstancePooling();
     Propel::setLogger(null);
     // make sure all classes are included
     foreach (Curry_Propel::getModels() as $classes) {
         foreach ($classes as $clazz) {
             class_exists($clazz . 'Peer', true);
         }
     }
 }
开发者ID:varvanin,项目名称:currycms,代码行数:20,代码来源:Database.php

示例13: 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

示例14: testAdd

    /**
    * Test that PropelCollection->add() prevents duplicates of objects strictly identical
    *
    */
   public function testAdd()
    {
        Propel::disableInstancePooling();
        $eleve1 = EleveQuery::create()->findOneByLogin('Florence Michu');
        $eleve1->setNom('test_different');
        $eleve_col = new PropelCollection();
        $eleve_col->add($eleve1);
        $eleve1idem = EleveQuery::create()->findOneByLogin('Florence Michu');
        $this->assertFalse($eleve_col->contains($eleve1idem));
        $eleve_col->add($eleve1idem);
        $this->assertEquals(2, count($eleve_col));
        Propel::enableInstancePooling();


        $eleve1 = EleveQuery::create()->findOneByLogin('Florence Michu');
        $eleve_col = new PropelCollection();
        $eleve_col->add($eleve1);
        $eleve_col->add($eleve1);
        $this->assertEquals(1, count($eleve_col));
    }
开发者ID:rhertzog,项目名称:lcs,代码行数:24,代码来源:PropelCollectionTest.php

示例15: initialize

 /**
  * Configures a Propel datasource.
  *
  * @param array  $parameters The datasource parameters
  * @param string $name       The datasource name
  */
 public function initialize($parameters = null, $name = 'propel')
 {
     parent::initialize($parameters);
     if (!$this->hasParameter('datasource') && $this->hasParameter('name')) {
         $this->setParameter('datasource', $this->getParameter('name'));
     } elseif (!$this->hasParameter('datasource') && !empty($name)) {
         $this->setParameter('datasource', $name);
     }
     $this->addConfig();
     // mark the first connection as the default
     if (!Propel::getConfiguration(PropelConfiguration::TYPE_OBJECT)->getParameter('datasources.default')) {
         $this->setDefaultConfig();
     }
     // for BC
     if ($this->getParameter('pooling', false)) {
         Propel::enableInstancePooling();
     } else {
         Propel::disableInstancePooling();
     }
 }
开发者ID:cuongnv540,项目名称:jobeet,代码行数:26,代码来源:sfPropelDatabase.class.php


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