jenkins-bot has submitted this change and it was merged.

Change subject: Remove unused SearchEntityArtefacts
......................................................................


Remove unused SearchEntityArtefacts

Change-Id: I2fc2f4de5e9adb2422e19f1bfed3195f225135af
---
D repo/maintenance/searchEntityArtefacts.php
1 file changed, 0 insertions(+), 115 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/maintenance/searchEntityArtefacts.php 
b/repo/maintenance/searchEntityArtefacts.php
deleted file mode 100644
index 096f25c..0000000
--- a/repo/maintenance/searchEntityArtefacts.php
+++ /dev/null
@@ -1,115 +0,0 @@
-<?php
-
-namespace Wikibase;
-use Maintenance;
-use Wikibase\Repo\WikibaseRepo;
-
-/**
- * Script that queries the database for entity artifacts
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Maintenance
- *
- * @licence GNU GPL v2+
- * @author Jens Ohlig <jens.oh...@wikimedia.de>
- */
-$basePath = getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' 
) : __DIR__ . '/../../../..';
-require_once $basePath . '/maintenance/Maintenance.php';
-
-/**
- * Query the database for entity artifacts
- *
- * @ingroup Maintenance
- */
-class SearchEntityArtefacts extends Maintenance {
-       public function __construct() {
-               parent::__construct();
-               $this->mDescription = "";
-       }
-
-       public function execute() {
-               if ( !defined( 'WB_VERSION' ) ) {
-                       $this->output( "You need to have Wikibase enabled in 
order to use this maintenance script!\n\n" );
-                       exit;
-               }
-
-               $force = $this->getOption( 'force', false );
-               $pidfile = Utils::makePidFilename( 'WBsearchEntityArtefacts', 
wfWikiID() );
-
-               if ( !Utils::getPidLock( $pidfile, $force ) ) {
-                       $this->output( date( 'H:i:s' ) . " already running, 
exiting\n" );
-                       exit( 5 );
-               }
-
-               $this->searchArtefacts();
-
-               $this->output( date( 'H:i:s' ) . " done, exiting\n" );
-               unlink( $pidfile ); // delete lockfile on normal exit
-       }
-
-       public function searchArtefacts() {
-               $dbw = wfGetDB( DB_MASTER );
-               $begin = 0;
-               $entityContentFactory = 
WikibaseRepo::getDefaultInstance()->getEntityContentFactory();
-               $pageArray = array();
-               do {
-                       $pages = $dbw->select(
-                               array( 'page' ),
-                               array( 'page_title' ),
-                               array( 'page_namespace' => 
NamespaceUtils::getEntityNamespaces() ),
-                               __METHOD__,
-                               array( 'LIMIT' => 1000, 'OFFSET' => $begin )
-                       );
-
-                       foreach ( $pages as $pageRow ) {
-                               $id = EntityId::newFromPrefixedId( 
$pageRow->page_title );
-
-                               if ( $id !== null ) {
-                                       $entityContent = 
$entityContentFactory->getFromId( $id, \Revision::RAW );
-                                       $pageArray[] = $entityContent;
-                               }
-                       }
-                       $begin += 1000;
-               } while ( $pages->numRows() === 1000 );
-               $rows = $dbw->select(
-                       array( 'wb_entity_per_page' ),
-                       array(
-                               'entity_id' => 'epp_entity_id',
-                               'entity_type' => 'epp_entity_type',
-                       ),
-                       array(),
-                       __METHOD__,
-                       array(),
-                       array()
-               );
-
-               $entities = array();
-               foreach ( $rows as $row ) {
-                       $entities[] = new EntityId( $row->entity_type, 
(int)$row->entity_id );
-               }
-               foreach ( $entities as $entity ) {
-                       $content = $entityContentFactory->getFromId( $entity, 
\Revision::RAW );
-                       if ( !in_array( $content, $pageArray ) ) {
-                               print_r( $content );
-                       }
-               }
-       }
-}
-
-$maintClass = 'Wikibase\SearchEntityArtefacts';
-require_once( RUN_MAINTENANCE_IF_MAIN );

-- 
To view, visit https://gerrit.wikimedia.org/r/94907
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2fc2f4de5e9adb2422e19f1bfed3195f225135af
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com>
Gerrit-Reviewer: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: Daniel Kinzler <daniel.kinz...@wikimedia.de>
Gerrit-Reviewer: Jens Ohlig <jens.oh...@wikimedia.de>
Gerrit-Reviewer: Jeroen De Dauw <jeroended...@gmail.com>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to