Merge "resourceloader: Make various CSSMin performance optimizations and cleanups"
[lhc/web/wiklou.git] / includes / filerepo / LocalRepo.php
index 1bf5346..03a9d44 100644 (file)
@@ -22,6 +22,7 @@
  * @ingroup FileRepo
  */
 
+use MediaWiki\MediaWikiServices;
 use Wikimedia\Rdbms\ResultWrapper;
 use Wikimedia\Rdbms\Database;
 use Wikimedia\Rdbms\IDatabase;
@@ -91,7 +92,7 @@ class LocalRepo extends FileRepo {
         * interleave database locks with file operations, which is potentially a
         * remote operation.
         *
-        * @param array $storageKeys
+        * @param string[] $storageKeys
         *
         * @return Status
         */
@@ -200,7 +201,7 @@ class LocalRepo extends FileRepo {
                }
 
                $method = __METHOD__;
-               $redirDbKey = ObjectCache::getMainWANInstance()->getWithSetCallback(
+               $redirDbKey = MediaWikiServices::getInstance()->getMainWANObjectCache()->getWithSetCallback(
                        $memcKey,
                        $expiry,
                        function ( $oldValue, &$ttl, array &$setOpts ) use ( $method, $title ) {
@@ -371,7 +372,7 @@ class LocalRepo extends FileRepo {
         * SHA-1 content hash.
         *
         * @param string $hash A sha1 hash to look for
-        * @return File[]
+        * @return LocalFile[]
         */
        function findBySha1( $hash ) {
                $dbr = $this->getReplicaDB();
@@ -400,8 +401,8 @@ class LocalRepo extends FileRepo {
         *
         * Overrides generic implementation in FileRepo for performance reason
         *
-        * @param array $hashes An array of hashes
-        * @return array An Array of arrays or iterators of file objects and the hash as key
+        * @param string[] $hashes An array of hashes
+        * @return array[] An Array of arrays or iterators of file objects and the hash as key
         */
        function findBySha1s( array $hashes ) {
                if ( !count( $hashes ) ) {
@@ -434,7 +435,7 @@ class LocalRepo extends FileRepo {
         *
         * @param string $prefix The prefix to search for
         * @param int $limit The maximum amount of files to return
-        * @return array
+        * @return LocalFile[]
         */
        public function findFilesByPrefix( $prefix, $limit ) {
                $selectOptions = [ 'ORDER BY' => 'img_name', 'LIMIT' => intval( $limit ) ];
@@ -520,7 +521,7 @@ class LocalRepo extends FileRepo {
                if ( $key ) {
                        $this->getMasterDB()->onTransactionPreCommitOrIdle(
                                function () use ( $key ) {
-                                       ObjectCache::getMainWANInstance()->delete( $key );
+                                       MediaWikiServices::getInstance()->getMainWANObjectCache()->delete( $key );
                                },
                                __METHOD__
                        );