当前位置: 首页>>代码示例>>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;未经允许,请勿转载。