Aude has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/93737


Change subject: Add convenience maintenance script wrapper
......................................................................

Add convenience maintenance script wrapper

Useful for scripts or extensions installed in non-standard locations.

Example usage:

php maintenance/runScript.php
extensions/Wikibase/lib/maintenance/dispatchChanges.php

Change-Id: I6ffc72f41f3f96dd535a427d90c7166372459bd2
---
A maintenance/runScript.php
1 file changed, 38 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/37/93737/1

diff --git a/maintenance/runScript.php b/maintenance/runScript.php
new file mode 100644
index 0000000..e25a9d8
--- /dev/null
+++ b/maintenance/runScript.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Convenience maintenance script wrapper, useful for scripts
+ * or extensions located outside of standard locations.
+ *
+ * To use, give the maintenance script as a relative path to
+ * MediaWiki base install path.
+ *
+ * Example usage:
+ *  php maintenance/runScript.php 
extensions/Wikibase/lib/maintenance/dispatchChanges.php
+ *
+ * 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
+ *
+ * @author Katie Filbert < [email protected] >
+ * @file
+ * @ingroup Maintenance
+ */
+if ( ! getenv( 'MW_INSTALL_PATH' ) ) {
+       require_once __DIR__ . '/Maintenance.php';
+
+       $script = $argv[1];
+       array_shift( $argv );
+
+       require_once __DIR__ . "/../$script";
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ffc72f41f3f96dd535a427d90c7166372459bd2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aude <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to