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


PHP RedBeanDatabase::close方法代码示例

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


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

示例1: tearDown

 public function tearDown()
 {
     RedBeanDatabase::close();
     RedBeanDatabase::setup(Yii::app()->db->connectionString, Yii::app()->db->username, Yii::app()->db->password, true);
     if (is_file($this->databaseBackupTestFile)) {
         unlink($this->databaseBackupTestFile);
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:8,代码来源:DatabaseCompatibilityUtilTest.php

示例2: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     if (RedBeanDatabase::isFrozen()) {
         TestDatabaseUtil::deleteRowsFromAllTablesExceptLog();
     } else {
         TestDatabaseUtil::deleteAllTablesExceptLog();
     }
     RedBeanModel::forgetAll();
     RedBeanDatabase::close();
     assert('!RedBeanDatabase::isSetup()');
     // Not Coding Standard
     GeneralCache::forgetAll();
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:13,代码来源:BaseTest.php

示例3: closeDatabaseConnection

 protected static function closeDatabaseConnection()
 {
     if (RedBeanDatabase::isSetup()) {
         RedBeanDatabase::close();
         assert('!RedBeanDatabase::isSetup()');
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:7,代码来源:TestSuite.php

示例4: handleEndRequest

 public function handleEndRequest($event)
 {
     RedBeanDatabase::close();
     exit;
 }
开发者ID:KulturedKitsch,项目名称:kulturedkitsch.info,代码行数:5,代码来源:EndRequestBehavior.php

示例5: testRun

 public function testRun()
 {
     chdir(COMMON_ROOT . DIRECTORY_SEPARATOR . 'protected' . DIRECTORY_SEPARATOR . 'commands');
     $command = "php zurmocTest.php install {$this->temporaryDatabaseHostname} {$this->temporaryDatabaseName} ";
     $command .= "{$this->temporaryDatabaseUsername} {$this->temporaryDatabasePassword} {$this->temporaryDatabasePort} ";
     $command .= "{$this->superUserPassword} 'http://sampleHost' 'app/index.php' demodata 1";
     if (!IS_WINNT) {
         $command .= ' 2>&1';
     }
     exec($command, $output);
     $instanceRoot = INSTANCE_ROOT;
     $perInstanceConfigFile = "{$instanceRoot}/protected/config/perInstanceTest.php";
     $debugConfigFile = "{$instanceRoot}/protected/config/debugTest.php";
     $perInstanceConfiguration = file_get_contents($perInstanceConfigFile);
     $debugConfiguration = file_get_contents($debugConfigFile);
     //Check if config files is updated.
     $this->assertRegExp('/\\$connectionString = \'mysql:host=' . $this->temporaryDatabaseHostname . ';port=' . $this->temporaryDatabasePort . ';dbname=' . $this->temporaryDatabaseName . '\';/', $perInstanceConfiguration);
     $this->assertRegExp('/\\$username         = \'' . $this->temporaryDatabaseUsername . '\';/', $perInstanceConfiguration);
     $this->assertRegExp('/\\$password         = \'' . $this->temporaryDatabasePassword . '\';/', $perInstanceConfiguration);
     RedBeanDatabase::close();
     RedBeanDatabase::setup(Yii::app()->tempDb->connectionString, Yii::app()->tempDb->username, Yii::app()->tempDb->password, true);
     $count = R::getRow('select count(*) count from _user');
     $this->assertEquals(9, $count['count']);
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:24,代码来源:InstallCommandTest.php

示例6: reconnectToDatabase

 protected static function reconnectToDatabase()
 {
     RedBeanDatabase::close();
     RedBeanDatabase::setup(Yii::app()->db->connectionString, Yii::app()->db->username, Yii::app()->db->password);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:5,代码来源:ImapBaseJob.php

示例7: close

 /**
  * Closes the database.
  */
 public static function close()
 {
     RedBeanDatabase::close();
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:7,代码来源:InstallUtil.php

示例8: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     if (static::$activateDefaultLanguages) {
         Yii::app()->languageHelper->deactivateLanguagesForTesting();
     }
     TestDatabaseUtil::deleteRowsFromAllTablesExceptLog();
     PermissionsCache::forgetAll();
     AllPermissionsOptimizationCache::forgetAll();
     RedBeanModel::forgetAll();
     RedBeanDatabase::close();
     assert('!RedBeanDatabase::isSetup()');
     // Not Coding Standard
     GeneralCache::forgetAll();
     BeanModelCache::forgetAll();
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:15,代码来源:BaseTest.php

示例9: tearDown

 public function tearDown()
 {
     RedBeanDatabase::close();
     RedBeanDatabase::setup(Yii::app()->db->connectionString, Yii::app()->db->username, Yii::app()->db->password, true);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:5,代码来源:InstallUtilTest.php

示例10: testAllActions

 public function testAllActions()
 {
     //Ensure that installed = false
     Yii::app()->setApplicationInstalled(false);
     //Check index action.
     $this->runControllerWithNoExceptionsAndGetContent('install/default');
     $this->runControllerWithNoExceptionsAndGetContent('install/default/index');
     //Check welcome action.
     $this->runControllerWithNoExceptionsAndGetContent('install/default/welcome');
     //Check checkSystem action.
     if (isset($_SERVER['SERVER_SOFTWARE'])) {
         $serverSoftware = $_SERVER['SERVER_SOFTWARE'];
     }
     $_SERVER['SERVER_SOFTWARE'] = 'Apache';
     $this->runControllerWithNoExceptionsAndGetContent('install/default/checkSystem');
     //Check settings action.
     $this->runControllerWithNoExceptionsAndGetContent('install/default/settings');
     //Check validateSettings action.
     //First validation will fail, and there should be at least validation errors.
     $this->setPostArray(array('ajax' => 'install-form', 'InstallSettingsForm' => array('databaseHostname' => '', 'databaseAdminUsername' => '', 'databaseAdminPassword' => '', 'databaseName' => '', 'databaseUsername' => '', 'databasePassword' => '', 'databasePort' => '', 'superUserPassword' => '', 'memcacheHostname' => '', 'memcachePortNumber' => '', 'memcacheAvailable' => '', 'databaseType' => 'mysql', 'removeExistingData' => '', 'installDemoData' => '')));
     $content = $this->runControllerWithExitExceptionAndGetContent('install/default/settings');
     $errors = CJSON::decode($content);
     $this->assertGreaterThanOrEqual(5, count($errors));
     $postData = array('ajax' => 'install-form', 'InstallSettingsForm' => array('databaseHostname' => $this->databaseHostname, 'databaseAdminUsername' => '', 'databaseAdminPassword' => '', 'databaseName' => $this->databaseName, 'databaseUsername' => $this->databaseUsername, 'databasePassword' => $this->databasePassword, 'databasePort' => $this->databasePort, 'superUserPassword' => $this->superUserPassword, 'databaseType' => 'mysql', 'removeExistingData' => '1', 'installDemoData' => ''));
     if (MEMCACHE_ON) {
         $memcacheSettings = array('memcacheHostname' => 'localhost', 'memcachePortNumber' => '11211', 'memcacheAvailable' => '1');
     } else {
         $memcacheSettings = array('memcacheHostname' => '', 'memcachePortNumber' => '', 'memcacheAvailable' => '0');
     }
     $postData['InstallSettingsForm'] = array_merge($postData['InstallSettingsForm'], $memcacheSettings);
     $this->setPostArray($postData);
     $content = $this->runControllerWithExitExceptionAndGetContent('install/default/settings');
     $errors = CJSON::decode($content);
     $this->assertEquals(1, count($errors));
     $postData['InstallSettingsForm']['hostInfo'] = 'http://www.example.com';
     $this->setPostArray($postData);
     $content = $this->runControllerWithExitExceptionAndGetContent('install/default/settings');
     $errors = CJSON::decode($content);
     $this->assertEquals(0, count($errors));
     //Run installation.
     $this->setPostArray(array('InstallSettingsForm' => array('databaseHostname' => $this->databaseHostname, 'databaseAdminUsername' => '', 'databaseAdminPassword' => '', 'databaseName' => $this->databaseName, 'databaseUsername' => $this->databaseUsername, 'databasePassword' => $this->databasePassword, 'databasePort' => $this->databasePort, 'superUserPassword' => $this->superUserPassword, 'memcacheHostname' => 'localhost', 'memcachePortNumber' => '11211', 'memcacheAvailable' => '1', 'databaseType' => 'mysql', 'removeExistingData' => '1', 'installDemoData' => '', 'hostInfo' => 'http://www.example.com')));
     //Close db connection(new will be created during installation process).
     RedBeanDatabase::close();
     $this->runControllerWithExitExceptionAndGetContent('install/default/settings');
     $industryFieldData = CustomFieldData::getByName('Industries');
     $this->assertGreaterThan('0', count(unserialize($industryFieldData->serializedData)));
     //Check installDemoData action.
     RedBeanDatabase::close();
     DemoDataUtil::unsetLoadedModules();
     $this->runControllerWithNoExceptionsAndGetContent('install/default/installDemoData');
     $this->assertGreaterThan('0', Account::getAll());
     $this->assertGreaterThan('0', Contact::getAll());
     //Restore $_SERVER['SERVER_SOFTWARE']
     if (isset($serverSoftware)) {
         $_SERVER['SERVER_SOFTWARE'] = $serverSoftware;
     } else {
         unset($_SERVER['SERVER_SOFTWARE']);
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:59,代码来源:InstallWalkthroughTest.php


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