@@ -93,7 +93,7 @@ |
||
| 93 | 93 | * @access public |
| 94 | 94 | * @param string $tableName The name of the table |
| 95 | 95 | * @return bool True if the table has been dropped, otherwise false |
| 96 | - */ |
|
| 96 | + */ |
|
| 97 | 97 | public function dropTable($tableName) |
| 98 | 98 | { |
| 99 | 99 | $sql = trim(sprintf('DROP TABLE %s', $tableName)); |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function lastInsertedId() |
| 123 | 123 | { |
| 124 | - // Postgres does not set pdo->lastInsertedId |
|
| 125 | - // use sequence |
|
| 126 | - try { |
|
| 124 | + // Postgres does not set pdo->lastInsertedId |
|
| 125 | + // use sequence |
|
| 126 | + try { |
|
| 127 | 127 | $rq = $this->pdo->prepare('SELECT LASTVAL()'); |
| 128 | 128 | $rq->execute(); |
| 129 | 129 | return $rq->fetchColumn(); |
@@ -168,11 +168,11 @@ discard block |
||
| 168 | 168 | public function addForeignKey($fkName, $srcTable, $srcColumn, $refTable, $refColumn) |
| 169 | 169 | { |
| 170 | 170 | $sql = sprintf('ALTER TABLE %s ADD CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s(%s)', |
| 171 | - $this->escape($srcTable), |
|
| 172 | - $fkName, |
|
| 173 | - $this->escape($srcColumn), |
|
| 174 | - $this->escape($refTable), |
|
| 175 | - $this->escape($refColumn) |
|
| 171 | + $this->escape($srcTable), |
|
| 172 | + $fkName, |
|
| 173 | + $this->escape($srcColumn), |
|
| 174 | + $this->escape($refTable), |
|
| 175 | + $this->escape($refColumn) |
|
| 176 | 176 | ); |
| 177 | 177 | return $this->prepareAndExecuteSql($sql); |
| 178 | 178 | } |
@@ -189,9 +189,9 @@ discard block |
||
| 189 | 189 | public function dropForeignKey($fkName, $tableName, $ifExists = false) |
| 190 | 190 | { |
| 191 | 191 | $sql = sprintf('ALTER TABLE %s DROP CONSTRAINT %s %s', |
| 192 | - $this->escape($tableName), |
|
| 193 | - $ifExists ? 'IF EXISTS' : '', |
|
| 194 | - $fkName |
|
| 192 | + $this->escape($tableName), |
|
| 193 | + $ifExists ? 'IF EXISTS' : '', |
|
| 194 | + $fkName |
|
| 195 | 195 | ); |
| 196 | 196 | return $this->prepareAndExecuteSql($sql); |
| 197 | 197 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | abstract class DatabaseDriver |
| 34 | 34 | { |
| 35 | - /** |
|
| 35 | + /** |
|
| 36 | 36 | * PDO connection |
| 37 | 37 | * |
| 38 | 38 | * @access protected |
@@ -73,9 +73,9 @@ discard block |
||
| 73 | 73 | * @var string |
| 74 | 74 | */ |
| 75 | 75 | public function sqlCreateTableOptions() |
| 76 | - { |
|
| 76 | + { |
|
| 77 | 77 | return ''; |
| 78 | - } |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * Gets/returns the default ouput format |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function escape($str) |
| 135 | 135 | { |
| 136 | - $list = explode('.', $str); |
|
| 137 | - return implode('.', $this->escapeList($list)); |
|
| 136 | + $list = explode('.', $str); |
|
| 137 | + return implode('.', $this->escapeList($list)); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | public function addForeignKey($fkName, $srcTable, $srcColumn, $refTable, $refColumn) |
| 148 | 148 | { |
| 149 | 149 | $sql = sprintf('ALTER TABLE %s ADD CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s(%s)', |
| 150 | - $this->escape($srcTable), |
|
| 151 | - $fkName, |
|
| 152 | - $this->escape($srcColumn), |
|
| 153 | - $this->escape($refTable), |
|
| 154 | - $this->escape($refColumn) |
|
| 150 | + $this->escape($srcTable), |
|
| 151 | + $fkName, |
|
| 152 | + $this->escape($srcColumn), |
|
| 153 | + $this->escape($refTable), |
|
| 154 | + $this->escape($refColumn) |
|
| 155 | 155 | ); |
| 156 | 156 | return $this->prepareAndExecuteSql($sql); |
| 157 | 157 | } |
@@ -168,8 +168,8 @@ discard block |
||
| 168 | 168 | public function dropForeignKey($fkName, $tableName) |
| 169 | 169 | { |
| 170 | 170 | $sql = sprintf('ALTER TABLE %s DROP FOREIGN KEY %s', |
| 171 | - $this->escape($tableName), |
|
| 172 | - $fkName |
|
| 171 | + $this->escape($tableName), |
|
| 172 | + $fkName |
|
| 173 | 173 | ); |
| 174 | 174 | return $this->prepareAndExecuteSql($sql); |
| 175 | 175 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | "'" . $userPassword ."'" |
| 224 | 224 | )); |
| 225 | 225 | return $this->prepareAndExecuteSql($sql); |
| 226 | - } |
|
| 226 | + } |
|
| 227 | 227 | |
| 228 | 228 | /** |
| 229 | 229 | * Drop a user |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | * |
| 254 | 254 | * @return bool True if the user has been granted, otherwise false. |
| 255 | 255 | */ |
| 256 | - public function grantUser($databaseName, $userName) |
|
| 256 | + public function grantUser($databaseName, $userName) |
|
| 257 | 257 | { |
| 258 | 258 | $sql = trim(sprintf('GRANT ALL ON %s.* TO %s@%s; FLUSH PRIVILEGES;', |
| 259 | 259 | $this->escape($databaseName), |