示例#1
0
文件: Db.php 项目: emhoracek/Omeka
 /**
  * Load and initialize the database.
  *
  * @return Omeka_Db
  */
 public function init()
 {
     $db = $this->getDb();
     $helper = Omeka_Test_Helper_Db::factory($this);
     if (self::$dropTables) {
         $helper->dropTables();
         self::$dropTables = false;
     }
     if (self::$runInstaller) {
         if (!self::$dropTables) {
             $helper->truncateTables();
         }
         $helper->install();
         self::$runInstaller = false;
     }
     $db->beginTransaction();
     return $db;
 }