Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/78354
Change subject: Update header code to newer standards ...................................................................... Update header code to newer standards Change-Id: I5f5af314d2a361eb79a52c7201134d865f81a519 --- M maintenance/checkLocalNames.php M maintenance/createLocalAccount.php M maintenance/migrateAccount.php M maintenance/migratePass1.php M maintenance/sendConfirmAndMigrateEmail.php 5 files changed, 13 insertions(+), 32 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth refs/changes/54/78354/1 diff --git a/maintenance/checkLocalNames.php b/maintenance/checkLocalNames.php index 30b2ac6..ab1e6bc 100644 --- a/maintenance/checkLocalNames.php +++ b/maintenance/checkLocalNames.php @@ -1,13 +1,7 @@ <?php -if ( PHP_SAPI != 'cli' ) { - print "This script must be run from a shell"; - die(); -} - -if ( getenv( 'MW_INSTALL_PATH' ) ) { - $IP = getenv( 'MW_INSTALL_PATH' ); -} else { +$IP = getenv( 'MW_INSTALL_PATH' ); +if ( $IP === false ) { $IP = __DIR__ . '/../../..'; } require_once( "$IP/maintenance/Maintenance.php" ); @@ -142,4 +136,4 @@ } $maintClass = "CheckLocalNames"; -require_once( RUN_MAINTENANCE_IF_MAIN ); \ No newline at end of file +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/createLocalAccount.php b/maintenance/createLocalAccount.php index 661ab88..a78cb4f 100644 --- a/maintenance/createLocalAccount.php +++ b/maintenance/createLocalAccount.php @@ -2,7 +2,7 @@ $IP = getenv( 'MW_INSTALL_PATH' ); if ( $IP === false ) { - $IP = dirname( __FILE__ ) . '/../../..'; + $IP = __DIR__ . '/../../..'; } require_once( "$IP/maintenance/Maintenance.php" ); diff --git a/maintenance/migrateAccount.php b/maintenance/migrateAccount.php index ec64311..e2bb1d8 100644 --- a/maintenance/migrateAccount.php +++ b/maintenance/migrateAccount.php @@ -1,13 +1,7 @@ <?php -if ( PHP_SAPI != 'cli' ) { - print "This script must be run from a shell"; - die(); -} - -if ( getenv( 'MW_INSTALL_PATH' ) ) { - $IP = getenv( 'MW_INSTALL_PATH' ); -} else { +$IP = getenv( 'MW_INSTALL_PATH' ); +if ( $IP === false ) { $IP = __DIR__ . '/../../..'; } require_once( "$IP/maintenance/Maintenance.php" ); @@ -208,4 +202,4 @@ } $maintClass = "MigrateAccount"; -require_once( RUN_MAINTENANCE_IF_MAIN ); \ No newline at end of file +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/migratePass1.php b/maintenance/migratePass1.php index 079e1e3..ed8fd4e 100644 --- a/maintenance/migratePass1.php +++ b/maintenance/migratePass1.php @@ -4,9 +4,8 @@ // * go through all usernames in 'globalnames' and for those // that can be automatically migrated, go ahead and do it. -if ( getenv( 'MW_INSTALL_PATH' ) ) { - $IP = getenv( 'MW_INSTALL_PATH' ); -} else { +$IP = getenv( 'MW_INSTALL_PATH' ); +if ( $IP === false ) { $IP = __DIR__ . '/../../..'; } require_once( "$IP/maintenance/Maintenance.php" ); @@ -59,4 +58,4 @@ } $maintClass = "MigratePass1"; -require_once( RUN_MAINTENANCE_IF_MAIN ); \ No newline at end of file +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/sendConfirmAndMigrateEmail.php b/maintenance/sendConfirmAndMigrateEmail.php index 093fe88..6e672cd 100644 --- a/maintenance/sendConfirmAndMigrateEmail.php +++ b/maintenance/sendConfirmAndMigrateEmail.php @@ -1,13 +1,7 @@ <?php -if ( PHP_SAPI != 'cli' ) { - print "This script must be run from a shell"; - die(); -} - -if ( getenv( 'MW_INSTALL_PATH' ) ) { - $IP = getenv( 'MW_INSTALL_PATH' ); -} else { +$IP = getenv( 'MW_INSTALL_PATH' ); +if ( $IP === false ) { $IP = __DIR__ . '/../../..'; } require_once( "$IP/maintenance/Maintenance.php" ); @@ -129,4 +123,4 @@ } $maintClass = "SendConfirmAndMigrateEmail"; -require_once( RUN_MAINTENANCE_IF_MAIN ); \ No newline at end of file +require_once( RUN_MAINTENANCE_IF_MAIN ); -- To view, visit https://gerrit.wikimedia.org/r/78354 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5f5af314d2a361eb79a52c7201134d865f81a519 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralAuth Gerrit-Branch: master Gerrit-Owner: Reedy <re...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits