Example #1
0
 /**
  * __construct
  *
  * @param Phigrate_Adapter_Base $adapter       Adapter RDBMS
  * @param string|array          $tasksDir      The path of directory of tasks
  * @param string                $migrationsDir The path of directory of migrations.
  *
  * @return Phigrate_Task_Manager
  */
 public function __construct(Phigrate_Adapter_Base $adapter, $tasksDir = null, $migrationsDir = null)
 {
     $this->_logger = $adapter->getLogger();
     $this->setAdapter($adapter);
     if (isset($migrationsDir)) {
         $this->setDirectoryOfMigrations($migrationsDir);
     }
     if (isset($tasksDir)) {
         $this->setDirectoryOfTasks($tasksDir, true);
     }
 }
Example #2
0
 /**
  * Returns an array of strings which represent version numbers
  * that we *have* migrated
  *
  * @return array
  */
 public function getExecutedMigrations()
 {
     $query_sql = sprintf('SELECT version FROM %s', $this->_adapter->identifier(PHIGRATE_TS_SCHEMA_TBL_NAME));
     $versions = $this->_adapter->selectAll($query_sql);
     $executed = array();
     foreach ($versions as $v) {
         $executed[] = (string) $v['version'];
     }
     sort($executed);
     return $executed;
 }
Example #3
0
 /**
  * sql type 
  * 
  * @return string
  */
 private function _sqlType()
 {
     return $this->_adapter->typeToSql($this->type, $this->_options);
 }
Example #4
0
 /**
  * drop view
  *
  * @param string $viewName The view name
  *
  * @return boolean
  */
 public function dropView($viewName)
 {
     return $this->_adapter->dropView($viewName);
 }