當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Doctrine::dropDatabases方法代碼示例

本文整理匯總了PHP中Doctrine::dropDatabases方法的典型用法代碼示例。如果您正苦於以下問題:PHP Doctrine::dropDatabases方法的具體用法?PHP Doctrine::dropDatabases怎麽用?PHP Doctrine::dropDatabases使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine的用法示例。


在下文中一共展示了Doctrine::dropDatabases方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 protected function execute($arguments = array(), $options = array())
 {
     $doctrineManager = Doctrine_Manager::getInstance();
     $databaseManager = new sfDatabaseManager($this->configuration);
     $conn = $doctrineManager->openConnection($databaseManager->getDatabase('main')->getParameter('dsn'), 'main');
     Doctrine::dropDatabases('main');
 }
開發者ID:silky,項目名稱:littlesis,代碼行數:7,代碼來源:DropMainDbTask.class.php

示例2: tearDown

 public function tearDown()
 {
     try {
         Doctrine::dropDatabases();
         Util_Log::get()->UnitTests()->debug('Executed TearDown');
     } catch (Exception $e) {
         Util_Log::get()->UnitTests()->err($e->getMessage());
     }
 }
開發者ID:rdohms,項目名稱:ugDirectory,代碼行數:9,代碼來源:AllTests.php

示例3: doctrineAction

 public function doctrineAction()
 {
     $options = array('phpDocPackage' => 'Kromatick', 'phpDocSubpackage' => 'Intermodels', 'phpDocName' => 'Neozeratul', 'phpDocEmail' => 'neozeratul@gmail.com');
     Doctrine::dropDatabases();
     Doctrine::createDatabases();
     Doctrine::generateModelsFromYaml(APPLICATION_PATH . "/data/schema/schema.yml", APPLICATION_PATH . "/models", $options);
     Doctrine::createTablesFromModels();
     //Doctrine::loadData($yamlPath, $append):
     echo Doctrine::generateSqlFromModels();
     $this->render('index');
 }
開發者ID:Neozeratul,項目名稱:Intermodels,代碼行數:11,代碼來源:IndexController.php

示例4: setUp

 public function setUp()
 {
     $manager = Doctrine_Manager::getInstance();
     foreach ($manager as $conn) {
         $modelsPath = APPLICATION_PATH . '/models';
         $fixturesPath = APPLICATION_PATH . '/../doctrine/data/fixtures';
         $name = array($conn->getName());
         Doctrine::dropDatabases($name);
         Doctrine::createDatabases($name);
         Doctrine::createTablesFromModels($modelsPath);
         Doctrine::loadData($fixturesPath, true);
     }
 }
開發者ID:rockett,項目名稱:parables-demo,代碼行數:13,代碼來源:WorklogTest.php

示例5: execute

 public function execute()
 {
     $answer = $this->ask('Are you sure you wish to drop your databases? (y/n)');
     if ($answer != 'y') {
         $this->notify('Successfully cancelled');
         return;
     }
     $results = Doctrine::dropDatabases();
     foreach ($results as $dbName => $bool) {
         $msg = $bool ? 'Successfully dropped database named: "' . $dbName . '"' : 'Could not drop database named: "' . $dbName . '"';
         $this->notify($msg);
     }
 }
開發者ID:kirvin,項目名稱:the-nerdery,代碼行數:13,代碼來源:DropDb.php

示例6: execute

 public function execute()
 {
     if (!$this->getArgument('force')) {
         $answer = $this->ask('Are you sure you wish to drop your databases? (y/n)');
         if ($answer != 'y') {
             $this->notify('Successfully cancelled');
             return;
         }
     }
     $results = Doctrine::dropDatabases();
     foreach ($results as $name => $result) {
         $msg = $result instanceof Exception ? 'Could not drop database for connection: "' . $name . '." Failed with exception: ' . $result->getMessage() : $result;
         $this->notify($msg);
     }
 }
開發者ID:stelaireri,項目名稱:Hive,代碼行數:15,代碼來源:DropDb.php

示例7: define

<?php

define("CLASSPATH", realpath(dirname(__FILE__) . "/../.."));
define("DOCTRINE_FOLDER", CLASSPATH . "/3rdParty/Doctrine-1.1.0/lib");
define("MODELS_FOLDER", CLASSPATH . "/models/data_objects");
define("YML_FOLDER", CLASSPATH . "/models/yml");
require_once DOCTRINE_FOLDER . '/Doctrine.php';
require_once CLASSPATH . '/config/db.conf.php';
spl_autoload_register(array('Doctrine', 'autoload'));
$manager = Doctrine_Manager::getInstance();
$conn = Doctrine_Manager::connection("{$db_conn_type}://{$db_user}:{$db_pass}@{$db_host}/{$db_name}", 'doctrine');
$manager->setAttribute(Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE);
$conn->setAttribute(Doctrine::ATTR_USE_NATIVE_ENUM, true);
Doctrine::dropDatabases();
Doctrine::createDatabases();
Doctrine::generateModelsFromYaml(YML_FOLDER . '/db.yml', MODELS_FOLDER);
Doctrine::createTablesFromModels(MODELS_FOLDER);
開發者ID:p1r0,項目名稱:MuffinPHP,代碼行數:17,代碼來源:generateModels.php

示例8: dropDB

 public function dropDB()
 {
     Doctrine::dropDatabases(self::DB_NAME);
 }
開發者ID:philippjenni,項目名稱:icinga-web,代碼行數:4,代碼來源:doctrineTask.php


注:本文中的Doctrine::dropDatabases方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。