[MediaWiki-commits] [Gerrit] Get rid of ApiWikibase!!!! - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Get rid of ApiWikibase .. Get rid of ApiWikibase It is gone! Bug: T71001 Change-Id: I25ba7eae310deb6223ae91aa30d310158fb55457 --- M repo/includes/api/ApiHelperFactory.php D repo/includes/api/ApiWikibase.php M repo/includes/api/EditEntity.php M repo/includes/api/LinkTitles.php M repo/includes/api/ModifyClaim.php M repo/includes/api/ModifyEntity.php M repo/includes/api/ModifyTerm.php M repo/includes/api/ResultBuilder.php M repo/includes/api/SetAliases.php 9 files changed, 177 insertions(+), 190 deletions(-) Approvals: Jeroen De Dauw: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/includes/api/ApiHelperFactory.php b/repo/includes/api/ApiHelperFactory.php index 275e3c2..18a6b8e 100644 --- a/repo/includes/api/ApiHelperFactory.php +++ b/repo/includes/api/ApiHelperFactory.php @@ -21,9 +21,6 @@ * @note: This is a high level factory which should not be injected or passed around. * It should only be used when bootstrapping from a static context. * - * @todo: Factor functionality out of ApiWikibase into separate helper classes, and - * make them available via ApiHelperFactory. - * * @license GPL 2+ * @author Daniel Kinzler */ diff --git a/repo/includes/api/ApiWikibase.php b/repo/includes/api/ApiWikibase.php deleted file mode 100644 index 3080364..000 --- a/repo/includes/api/ApiWikibase.php +++ /dev/null @@ -1,161 +0,0 @@ - - * @author Tobias Gritschacher < tobias.gritschac...@wikimedia.de > - * @author Adam Shorland - * @author Daniel Kinzler - */ -abstract class ApiWikibase extends ApiBase { - - /** -* @var ResultBuilder -*/ - private $resultBuilder; - - /** -* @var EntityIdParser -*/ - private $idParser; - - /** -* @var EntityRevisionLookup -*/ - private $entityRevisionLookup; - - /** -* @var EntitySaveHelper -*/ - private $entitySaveHelper; - - /** -* @var EntityLoadHelper -*/ - private $entityLoadHelper; - - /** -* @param ApiMain $mainModule -* @param string $moduleName -* @param string $modulePrefix -* -* @see ApiBase::__construct -*/ - public function __construct( ApiMain $mainModule, $moduleName, $modulePrefix = '' ) { - parent::__construct( $mainModule, $moduleName, $modulePrefix ); - - $wikibaseRepo = WikibaseRepo::getDefaultInstance(); - - $this->idParser = $wikibaseRepo->getEntityIdParser(); - - // NOTE: use uncached lookup for write mode! - $uncached = $this->isWriteMode() ? 'uncached' : ''; - $this->entityRevisionLookup = $wikibaseRepo->getEntityRevisionLookup( $uncached ); - - $apiHelperFactory = $wikibaseRepo->getApiHelperFactory( $this->getContext() ); - $this->resultBuilder = $apiHelperFactory->getResultBuilder( $this ); - $this->entitySaveHelper = $apiHelperFactory->getEntitySaveHelper( $this ); - $this->entityLoadHelper = $apiHelperFactory->getEntityLoadHelper( $this ); - } - - /** -* @return EntityRevisionLookup -*/ - protected function getEntityRevisionLookup() { - return $this->entityRevisionLookup; - } - - /** -* @return EntityIdParser -*/ - protected function getIdParser() { - return $this->idParser; - } - - /** -* @return ResultBuilder -*/ - protected function getResultBuilder() { - return $this->resultBuilder; - } - - /** -* @see ApiBase::needsToken() -* -* @return string|false -*/ - public function needsToken() { - return $this->isWriteMode() ? 'csrf' : false; - } - - /** -* Returns the permissions that are required to perform the operation specified by -* the parameters. -* -* Per default, this will include the 'read' permission if $this->isReadMode() returns true, -* and the 'edit' permission if $this->isWriteMode() returns true, -* -* @param EntityDocument $entity The entity to check permissions for -* -* @return string[] A list of permissions -*/ - protected function getRequiredPermissions( EntityDocument $entity ) { - $permissions = array(); - - if ( $this->isReadMode() ) { - $permissions[] = 'read'; - } - - if ( $this->isWriteMode() ) { - $permissions[] = 'edit'; - } - - return $permissions; - } - - /** -* @see EntitySaveHelper::loadEntityRevision -*/ - protected function loadEntityRevi
[MediaWiki-commits] [Gerrit] Get rid of ApiWikibase!!!! - change (mediawiki...Wikibase)
Addshore has uploaded a new change for review. https://gerrit.wikimedia.org/r/222928 Change subject: Get rid of ApiWikibase .. Get rid of ApiWikibase It is gone! Bug: T71001 Change-Id: I25ba7eae310deb6223ae91aa30d310158fb55457 --- M repo/includes/api/ApiHelperFactory.php D repo/includes/api/ApiWikibase.php M repo/includes/api/EditEntity.php M repo/includes/api/LinkTitles.php M repo/includes/api/ModifyClaim.php M repo/includes/api/ModifyEntity.php M repo/includes/api/ModifyTerm.php M repo/includes/api/ResultBuilder.php M repo/includes/api/SetAliases.php 9 files changed, 177 insertions(+), 190 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/28/222928/5 diff --git a/repo/includes/api/ApiHelperFactory.php b/repo/includes/api/ApiHelperFactory.php index 275e3c2..18a6b8e 100644 --- a/repo/includes/api/ApiHelperFactory.php +++ b/repo/includes/api/ApiHelperFactory.php @@ -21,9 +21,6 @@ * @note: This is a high level factory which should not be injected or passed around. * It should only be used when bootstrapping from a static context. * - * @todo: Factor functionality out of ApiWikibase into separate helper classes, and - * make them available via ApiHelperFactory. - * * @license GPL 2+ * @author Daniel Kinzler */ diff --git a/repo/includes/api/ApiWikibase.php b/repo/includes/api/ApiWikibase.php deleted file mode 100644 index 3080364..000 --- a/repo/includes/api/ApiWikibase.php +++ /dev/null @@ -1,161 +0,0 @@ - - * @author Tobias Gritschacher < tobias.gritschac...@wikimedia.de > - * @author Adam Shorland - * @author Daniel Kinzler - */ -abstract class ApiWikibase extends ApiBase { - - /** -* @var ResultBuilder -*/ - private $resultBuilder; - - /** -* @var EntityIdParser -*/ - private $idParser; - - /** -* @var EntityRevisionLookup -*/ - private $entityRevisionLookup; - - /** -* @var EntitySaveHelper -*/ - private $entitySaveHelper; - - /** -* @var EntityLoadHelper -*/ - private $entityLoadHelper; - - /** -* @param ApiMain $mainModule -* @param string $moduleName -* @param string $modulePrefix -* -* @see ApiBase::__construct -*/ - public function __construct( ApiMain $mainModule, $moduleName, $modulePrefix = '' ) { - parent::__construct( $mainModule, $moduleName, $modulePrefix ); - - $wikibaseRepo = WikibaseRepo::getDefaultInstance(); - - $this->idParser = $wikibaseRepo->getEntityIdParser(); - - // NOTE: use uncached lookup for write mode! - $uncached = $this->isWriteMode() ? 'uncached' : ''; - $this->entityRevisionLookup = $wikibaseRepo->getEntityRevisionLookup( $uncached ); - - $apiHelperFactory = $wikibaseRepo->getApiHelperFactory( $this->getContext() ); - $this->resultBuilder = $apiHelperFactory->getResultBuilder( $this ); - $this->entitySaveHelper = $apiHelperFactory->getEntitySaveHelper( $this ); - $this->entityLoadHelper = $apiHelperFactory->getEntityLoadHelper( $this ); - } - - /** -* @return EntityRevisionLookup -*/ - protected function getEntityRevisionLookup() { - return $this->entityRevisionLookup; - } - - /** -* @return EntityIdParser -*/ - protected function getIdParser() { - return $this->idParser; - } - - /** -* @return ResultBuilder -*/ - protected function getResultBuilder() { - return $this->resultBuilder; - } - - /** -* @see ApiBase::needsToken() -* -* @return string|false -*/ - public function needsToken() { - return $this->isWriteMode() ? 'csrf' : false; - } - - /** -* Returns the permissions that are required to perform the operation specified by -* the parameters. -* -* Per default, this will include the 'read' permission if $this->isReadMode() returns true, -* and the 'edit' permission if $this->isWriteMode() returns true, -* -* @param EntityDocument $entity The entity to check permissions for -* -* @return string[] A list of permissions -*/ - protected function getRequiredPermissions( EntityDocument $entity ) { - $permissions = array(); - - if ( $this->isReadMode() ) { - $permissions[] = 'read'; - } - - if ( $this->isWriteMode() ) { - $permissions[] = 'edit'; - } - - return $permissions; - } - - /** -* @see EntitySaveHelper::loadEntityRevision -