本文整理汇总了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');
}
示例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());
}
}
示例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');
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
示例8: dropDB
public function dropDB()
{
Doctrine::dropDatabases(self::DB_NAME);
}