Merge "Update weblinks in comments from HTTP to HTTPS"
[lhc/web/wiklou.git] / includes / libs / rdbms / database / DatabaseSqlite.php
index 90b861d..7317d54 100644 (file)
@@ -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 = [];