X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Fdatabase%2FDatabaseSqlite.php;fp=includes%2Flibs%2Frdbms%2Fdatabase%2FDatabaseSqlite.php;h=7317d54070144e836f9978cc668339fa78ffa880;hb=69ae945e8d39972a07bea89ddb64bc0189b43ac2;hp=90b861db10e2b478eb15be00fa521c2696a37fd6;hpb=202f695f671bb1b6c25ebec219da348e9935692e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/database/DatabaseSqlite.php b/includes/libs/rdbms/database/DatabaseSqlite.php index 90b861db10..7317d54070 100644 --- a/includes/libs/rdbms/database/DatabaseSqlite.php +++ b/includes/libs/rdbms/database/DatabaseSqlite.php @@ -31,20 +31,17 @@ class DatabaseSqlite extends Database { /** @var string Directory */ protected $dbDir; - /** @var string File name for SQLite database file */ protected $dbPath; - /** @var string Transaction mode */ protected $trxMode; /** @var int The number of rows affected as an integer */ protected $mAffectedRows; - /** @var resource */ protected $mLastResult; - /** @var PDO */ + /** @var $mConn PDO */ protected $mConn; /** @var FSLockManager (hopefully on the same server as the DB) */ @@ -145,7 +142,7 @@ class DatabaseSqlite extends Database { * @param string $dbName * * @throws DBConnectionError - * @return PDO + * @return bool */ function open( $server, $user, $pass, $dbName ) { $this->close(); @@ -156,7 +153,7 @@ class DatabaseSqlite extends Database { } $this->openFile( $fileName ); - return $this->mConn; + return (bool)$this->mConn; } /** @@ -199,6 +196,10 @@ class DatabaseSqlite extends Database { return false; } + public function selectDB( $db ) { + return false; // doesn't make sense + } + /** * @return string SQLite DB file path * @since 1.25 @@ -494,15 +495,12 @@ class DatabaseSqlite extends Database { * @param string $table * @param string $index * @param string $fname - * @return array + * @return array|false */ function indexInfo( $table, $index, $fname = __METHOD__ ) { $sql = 'PRAGMA index_info(' . $this->addQuotes( $this->indexName( $index ) ) . ')'; $res = $this->query( $sql, $fname ); - if ( !$res ) { - return null; - } - if ( $res->numRows() == 0 ) { + if ( !$res || $res->numRows() == 0 ) { return false; } $info = [];