/**
  * 全てのテーブルを削除する
  *
  * @return void
  * @access public 
  */
 public function deleteAllTables()
 {
     $dbConfig = $this->_readDbSetting();
     if (!$dbConfig) {
         $dbConfig = getDbConfig();
     }
     $this->BcManager->deleteAllTables($dbConfig);
 }
 /**
  * reset 
  */
 protected function _reset()
 {
     $dbConfig = getDbConfig();
     return $this->BcManager->reset($dbConfig);
 }
Exemple #3
0
/**
 * baserCMSのインストールが完了しているかチェックする
 * @return	boolean
 */
function isInstalled()
{
    if (getDbConfig() && file_exists(APP . 'Config' . DS . 'install.php')) {
        return true;
    }
    return false;
}
 /**
  * DBセッティングが存在するかチェックする
  */
 public function testGetDbConfig()
 {
     $dbconfigPath = APP . 'Config' . DS . 'database.php';
     // app/Config/database.phpが存在しない場合
     if (rename($dbconfigPath, $dbconfigPath . '_copy')) {
         $result = getDbConfig();
         $this->assertFalse($result, 'app/Config/database.php が存在していない場合にtrueが返ってきます');
     } else {
         $this->markTestIncomplete('app/Config/database.php のファイル名変更に失敗したのでテストをスキップしました。');
     }
     // app/Config/database.phpが存在する場合
     if (rename($dbconfigPath . '_copy', $dbconfigPath)) {
         $result = getDbConfig();
         $this->assertContains('utf8', $result, 'app/Config/database.php が存在している場合にデータベースの情報が返ってきません');
         $result = getDbConfig('hoge');
         $this->assertFalse($result, '存在しないデータベースの設定名を入力した場合にfalseが返ってきます');
     } else {
         $this->markTestIncomplete('app/Config/database.php のファイル名変更に失敗したのでテストをスキップしました。');
     }
 }
 /**
  * 全てのテーブルを削除する
  *
  * @return void
  * @access public 
  */
 function deleteAllTables()
 {
     $baserConfig = $this->_readDbSettingFromSession();
     if (!$baserConfig) {
         $baserConfig = getDbConfig('baser');
         $pluginConfig = getDbConfig('plugin');
     } else {
         $pluginConfig = $baserConfig;
         $pluginConfig['prefix'] .= Configure::read('Baser.pluginDbPrefix');
     }
     if ($baserConfig) {
         $this->BaserManager->deleteTables('baser', $baserConfig);
     }
     if ($pluginConfig) {
         $this->BaserManager->deleteTables('plugin', $pluginConfig);
     }
 }
Exemple #6
0
 array_shift($params);
 $options = getOptions($params);
 if (($site = array_shift($params)) === null) {
     $site = 'default';
 }
 if (($tplsite = array_shift($params)) === null) {
     $tplsite = 'default';
 }
 spl_autoload_register('setupAutoload');
 require 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
 $aimeos = new \Aimeos\Bootstrap(isset($options['extdir']) ? (array) $options['extdir'] : array());
 $taskPaths = $aimeos->getSetupPaths($tplsite);
 setIncludePaths($taskPaths);
 $conf = getConfig($aimeos->getConfigPaths(), $options);
 $conf->set('setup/site', $site);
 $dbconfig = getDbConfig($conf);
 $ctx = getContext($conf);
 $dbm = $ctx->getDatabaseManager();
 $manager = new \Aimeos\MW\Setup\Manager\Multiple($dbm, $dbconfig, $taskPaths, $ctx);
 $action = isset($options['action']) ? $options['action'] : 'migrate';
 $task = isset($options['task']) ? $options['task'] : null;
 switch ($action) {
     case 'clean':
         $manager->clean($task);
         break;
     case 'migrate':
         $manager->migrate($task);
         break;
     case 'rollback':
         $manager->rollback($task);
         break;