X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2Ffile%2FFile.php;h=ee7ee6f90dcd5cf10549395165452bd2cb0be015;hb=21ebef5db3b7b39e91e4ef6400a3bf1f96eed5c1;hp=55c50538dd0c08f0fbcf44278a37c8104680424b;hpb=d1401ab5f1a189c4895468344a5febda70bc47ee;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 55c50538dd..ee7ee6f90d 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -45,8 +45,16 @@ use MediaWiki\MediaWikiServices; * * RepoGroup::singleton()->getLocalRepo()->newFile( $title ); * - * The convenience functions wfLocalFile() and wfFindFile() should be sufficient - * in most cases. + * Consider the services container below; + * + * $services = MediaWikiServices::getInstance(); + * + * The convenience services $services->getRepoGroup()->getLocalRepo()->newFile() + * and $services->getRepoGroup()->findFile() should be sufficient in most cases. + * + * @TODO: DI - Instead of using MediaWikiServices::getInstance(), a service should + * ideally accept a RepoGroup in its constructor and then, use $this->repoGroup->findFile() + * and $this->repoGroup->getLocalRepo()->newFile(). * * @ingroup FileAbstraction */ @@ -1953,8 +1961,7 @@ abstract class File implements IDBAccessObject { * @param array $versions Set of record ids of deleted items to restore, * or empty to restore all revisions. * @param bool $unsuppress Remove restrictions on content upon restoration? - * @return int|bool The number of file revisions restored if successful, - * or false on failure + * @return Status * STUB * Overridden by LocalFile */