X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrush%2Fdrush%2Flib%2FDrush%2FSql%2FSqlsqlsrv.php;fp=vendor%2Fdrush%2Fdrush%2Flib%2FDrush%2FSql%2FSqlsqlsrv.php;h=0000000000000000000000000000000000000000;hp=04ca1c335c2cec341b0214850f24ddfa516308d0;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/drush/drush/lib/Drush/Sql/Sqlsqlsrv.php b/vendor/drush/drush/lib/Drush/Sql/Sqlsqlsrv.php deleted file mode 100644 index 04ca1c335..000000000 --- a/vendor/drush/drush/lib/Drush/Sql/Sqlsqlsrv.php +++ /dev/null @@ -1,65 +0,0 @@ -db_spec['database']) ? 'master' : $this->db_spec['database']; - // Host and port are optional but have defaults. - $host = empty($this->db_spec['host']) ? '.\SQLEXPRESS' : $this->db_spec['host']; - if ($this->db_spec['username'] == '') { - return ' -S ' . $host . ' -d ' . $database; - } - else { - return ' -S ' . $host . ' -d ' . $database . ' -U ' . $this->db_spec['username'] . ' -P ' . $this->db_spec['password']; - } - } - - public function db_exists() { - // TODO: untested, but the gist is here. - $database = $this->db_spec['database']; - // Get a new class instance that has no 'database'. - $db_spec_no_db = $this->db_spec; - unset($db_spec_no_db['database']); - $sql_no_db = drush_sql_get_class($db_spec_no_db); - $query = "if db_id('$database') IS NOT NULL print 1"; - drush_shell_exec($sql_no_db->connect() . ' -Q %s', $query); - $output = drush_shell_exec_output(); - return $output[0] == 1; - } - - public function listTables() { - $return = $this->query('SELECT TABLE_NAME FROM information_schema.tables'); - $tables = drush_shell_exec_output(); - if (!empty($tables)) { - // Shift off the header of the column of data returned. - array_shift($tables); - return $tables; - } - } - - // @todo $file is no longer provided. We are supposed to return bash that can be piped to gzip. - // Probably sqlsrv needs to override dump() entirely. - public function dumpCmd($table_selection) { - if (!$file) { - $file = $this->db_spec['database'] . '_' . date('Ymd_His') . '.bak'; - } - $exec = "sqlcmd -U \"" . $this->db_spec['username'] . "\" -P \"" . $this->db_spec['password'] . "\" -S \"" . $this->db_spec['host'] . "\" -Q \"BACKUP DATABASE [" . $this->db_spec['database'] . "] TO DISK='" . $file . "'\""; - if ($option = drush_get_option('extra', $this->query_extra)) { - $exec .= " $option"; - } - return array($exec, $file); - } - - -}