|
@@ -63,9 +63,12 @@ class Pdo extends Base
|
|
|
}
|
|
|
public function create($config)
|
|
|
{
|
|
|
- $sql = Sql::create($config);
|
|
|
- $this->exe($sql);
|
|
|
- return $sql;
|
|
|
+ $this->exe(Sql::create($config));
|
|
|
+ }
|
|
|
+ public function alter($config)
|
|
|
+ {
|
|
|
+ $data = $this->exe(Sql::desc($config['name']), array(), 'fetchAll');
|
|
|
+ $this->exe(Sql::alter($config['name'], $config['struct'], $data));
|
|
|
}
|
|
|
public function getIndex($version, $index)
|
|
|
{
|
|
@@ -126,7 +129,7 @@ class Pdo extends Base
|
|
|
}
|
|
|
if ($method) {
|
|
|
$data = $handle->$method();
|
|
|
- $this->log($sql, $value, $data);
|
|
|
+
|
|
|
return $data;
|
|
|
} else {
|
|
|
return $handle;
|
|
@@ -146,7 +149,7 @@ class Pdo extends Base
|
|
|
$this->config['port'] = $temp[1];
|
|
|
}
|
|
|
|
|
|
- $this->config['shell'] = 'mysql -u' . $this->config['username'] . ' -p' . $this->config['password'] . ' ' . $this->config['database'] . ' -h' . $this->config['host'] . ' -P' . $this->config['port'] . ' -e ';
|
|
|
+ $this->config['shell'] = 'mysql -u' . $this->config['user'] . ' -p' . $this->config['pwd'] . ' ' . $this->config['name'] . ' -h' . $this->config['host'] . ' -P' . $this->config['port'] . ' -e ';
|
|
|
}
|
|
|
|
|
|
if ($state == true) {
|