本文整理汇总了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();
}
示例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();
}
示例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();
}
示例4: setUp
public function setUp()
{
parent::setUp();
if (!interface_exists('Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\ParamConverterInterface')) {
$this->markTestSkipped('SensioFrameworkExtraBundle is not available.');
}
\Propel::disableInstancePooling();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
}
}
示例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();
}
示例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));
}
示例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();
}
}