/** * __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); } }
/** * 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; }
/** * sql type * * @return string */ private function _sqlType() { return $this->_adapter->typeToSql($this->type, $this->_options); }
/** * drop view * * @param string $viewName The view name * * @return boolean */ public function dropView($viewName) { return $this->_adapter->dropView($viewName); }