X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Ffilerepo%2FLocalRepo.php;h=549be40807cbc14bcf96afc447a6c79bc5a35129;hb=99f4278a873c6c320d0d6875b37dbd27980dc1d2;hp=be11b23353258c0f09611ccb2c3ab1972069d24d;hpb=fac1ec45f1201c913f4dc1dc7a2a31d21f77993c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php index be11b23353..549be40807 100644 --- a/includes/filerepo/LocalRepo.php +++ b/includes/filerepo/LocalRepo.php @@ -47,7 +47,7 @@ class LocalRepo extends FileRepo { } elseif ( isset( $row->oi_name ) ) { return call_user_func( $this->oldFileFromRowFactory, $row, $this ); } else { - throw new MWException( __METHOD__.': invalid row' ); + throw new MWException( __METHOD__ . ': invalid row' ); } } @@ -176,7 +176,7 @@ class LocalRepo extends FileRepo { } // else $cachedValue is false or null: cache miss $id = $this->getArticleID( $title ); - if( !$id ) { + if ( !$id ) { $wgMemc->set( $memcKey, " ", $expiry ); return false; } @@ -188,7 +188,7 @@ class LocalRepo extends FileRepo { __METHOD__ ); - if( $row && $row->rd_namespace == NS_FILE ) { + if ( $row && $row->rd_namespace == NS_FILE ) { $targetTitle = Title::makeTitle( $row->rd_namespace, $row->rd_title ); $wgMemc->set( $memcKey, $targetTitle->getDBkey(), $expiry ); return $targetTitle; @@ -206,7 +206,7 @@ class LocalRepo extends FileRepo { * @return bool|int|mixed */ protected function getArticleID( $title ) { - if( !$title instanceof Title ) { + if ( !$title instanceof Title ) { return 0; } $dbr = $this->getSlaveDB(); @@ -258,7 +258,7 @@ class LocalRepo extends FileRepo { * @return array An Array of arrays or iterators of file objects and the hash as key */ function findBySha1s( array $hashes ) { - if( !count( $hashes ) ) { + if ( !count( $hashes ) ) { return array(); //empty parameter } @@ -281,17 +281,17 @@ class LocalRepo extends FileRepo { return $result; } - /** - * Return an array of files where the name starts with $prefix. - * - * @param string $prefix The prefix to search for - * @param int $limit The maximum amount of files to return - * @return array - */ + /** + * Return an array of files where the name starts with $prefix. + * + * @param string $prefix The prefix to search for + * @param int $limit The maximum amount of files to return + * @return array + */ public function findFilesByPrefix( $prefix, $limit ) { $selectOptions = array( 'ORDER BY' => 'img_name', 'LIMIT' => intval( $limit ) ); - // Query database + // Query database $dbr = $this->getSlaveDB(); $res = $dbr->select( 'image', @@ -306,7 +306,7 @@ class LocalRepo extends FileRepo { foreach ( $res as $row ) { $files[] = $this->newFileFromRow( $row ); } - return $files; + return $files; } /**