From 21751b9ba763ec004f6d6d11ded70f6cf26ae979 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 9 May 2013 18:58:21 +0200 Subject: [PATCH] echo is not a function Removed parenthesis after echo Change-Id: Ia533aedf63b11d15dcc6a5cf75a56134a4b11d86 --- api.php | 4 +-- includes/Exception.php | 2 +- includes/PHPVersionError.php | 2 +- includes/api/ApiFormatBase.php | 6 ++-- includes/templates/NoLocalSettings.php | 4 +-- maintenance/doMaintenance.php | 2 +- maintenance/dumpBackup.php | 2 +- maintenance/importImages.php | 44 ++++++++++++------------ maintenance/importTextFile.php | 20 +++++------ maintenance/language/rebuildLanguage.php | 4 +-- maintenance/purgeOldText.inc | 18 +++++----- tests/RunSeleniumTests.php | 10 +++--- tests/parserTests.php | 2 +- tests/selenium/SeleniumServerManager.php | 2 +- 14 files changed, 61 insertions(+), 61 deletions(-) diff --git a/api.php b/api.php index b9efe2c252..9d7f6480ed 100644 --- a/api.php +++ b/api.php @@ -54,8 +54,8 @@ if ( !$wgRequest->checkUrlExtension() ) { // Verify that the API has not been disabled if ( !$wgEnableAPI ) { header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki configuration Error', true, 500 ); - echo( 'MediaWiki API is not enabled for this site. Add the following line to your LocalSettings.php' - . '
$wgEnableAPI=true;
' ); + echo 'MediaWiki API is not enabled for this site. Add the following line to your LocalSettings.php' + . '
$wgEnableAPI=true;
'; die( 1 ); } diff --git a/includes/Exception.php b/includes/Exception.php index c513ef7dbe..dc1208a0d1 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -668,7 +668,7 @@ class MWExceptionHandler { if ( defined( 'STDERR' ) ) { fwrite( STDERR, $message ); } else { - echo( $message ); + echo $message; } } diff --git a/includes/PHPVersionError.php b/includes/PHPVersionError.php index e8ecf6dbf4..c9321f00ff 100644 --- a/includes/PHPVersionError.php +++ b/includes/PHPVersionError.php @@ -112,6 +112,6 @@ HTML; $finalOutput = ( $type == 'load.php' ) ? "/* $message */" : $message; header( "$protocol 500 MediaWiki configuration Error" ); } - echo( "$finalOutput\n" ); + echo "$finalOutput\n"; die( 1 ); } diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index e8e6acf654..b89fb3a730 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -170,12 +170,12 @@ abstract class ApiFormatBase extends ApiBase { ?>
-You are looking at the HTML representation of the mFormat ); ?> format.
+You are looking at the HTML representation of the mFormat; ?> format.
HTML is good for debugging, but is unsuitable for application use.
Specify the format parameter to change the output format.
-To see the non HTML representation of the mFormat ); ?> format, set format=mFormat ) ); ?>.
+To see the non HTML representation of the mFormat; ?> format, set format=mFormat ); ?>.
See the complete documentation, or -API help for more information. +API help for more information.
 
 		 complete the installation and download LocalSettings.php." );
+			echo "Please  complete the installation and download LocalSettings.php.";
 		} else {
-			echo( "Please  set up the wiki first." );
+			echo "Please  set up the wiki first.";
 		}
 		?>
 		

diff --git a/maintenance/doMaintenance.php b/maintenance/doMaintenance.php index 8576b8acde..f471d50b0c 100644 --- a/maintenance/doMaintenance.php +++ b/maintenance/doMaintenance.php @@ -123,6 +123,6 @@ try { $factory->commitMasterChanges(); $factory->shutdown(); } catch ( MWException $mwe ) { - echo( $mwe->getText() ); + echo $mwe->getText(); exit( 1 ); } diff --git a/maintenance/dumpBackup.php b/maintenance/dumpBackup.php index bd7e464944..9254adc35a 100644 --- a/maintenance/dumpBackup.php +++ b/maintenance/dumpBackup.php @@ -44,7 +44,7 @@ if ( isset( $options['pagelist'] ) ) { $pages = file( $options['pagelist'] ); chdir( $olddir ); if ( $pages === false ) { - echo( "Unable to open file {$options['pagelist']}\n" ); + echo "Unable to open file {$options['pagelist']}\n"; die( 1 ); } $pages = array_map( 'trim', $pages ); diff --git a/maintenance/importImages.php b/maintenance/importImages.php index 7b340cc07b..2b5d690136 100644 --- a/maintenance/importImages.php +++ b/maintenance/importImages.php @@ -39,7 +39,7 @@ require_once( __DIR__ . '/commandLine.inc' ); require_once( __DIR__ . '/importImages.inc' ); $processed = $added = $ignored = $skipped = $overwritten = $failed = 0; -echo( "Import Images\n\n" ); +echo "Import Images\n\n"; # Need a path if ( count( $args ) == 0 ) { @@ -132,7 +132,7 @@ if ( $count > 0 ) { # Validate a title $title = Title::makeTitleSafe( NS_FILE, $base ); if ( !is_object( $title ) ) { - echo( "{$base} could not be imported; a valid title cannot be produced\n" ); + echo "{$base} could not be imported; a valid title cannot be produced\n"; continue; } @@ -148,7 +148,7 @@ if ( $count > 0 ) { if ( $checkUserBlock && ( ( $processed % $checkUserBlock ) == 0 ) ) { $user->clearInstanceCache( 'name' ); // reload from DB! if ( $user->isBlocked() ) { - echo( $user->getName() . " was blocked! Aborting.\n" ); + echo $user->getName() . " was blocked! Aborting.\n"; break; } } @@ -157,10 +157,10 @@ if ( $count > 0 ) { $image = wfLocalFile( $title ); if ( $image->exists() ) { if ( isset( $options['overwrite'] ) ) { - echo( "{$base} exists, overwriting..." ); + echo "{$base} exists, overwriting..."; $svar = 'overwritten'; } else { - echo( "{$base} exists, skipping\n" ); + echo "{$base} exists, skipping\n"; $skipped++; continue; } @@ -172,13 +172,13 @@ if ( $count > 0 ) { $dupes = $repo->findBySha1( $sha1 ); if ( $dupes ) { - echo( "{$base} already exists as " . $dupes[0]->getName() . ", skipping\n" ); + echo "{$base} already exists as " . $dupes[0]->getName() . ", skipping\n"; $skipped++; continue; } } - echo( "Importing {$base}..." ); + echo "Importing {$base}..."; $svar = 'added'; } @@ -199,7 +199,7 @@ if ( $count > 0 ) { $wgUser = User::newFromName( $real_user ); if ( $wgUser === false ) { # user does not exist in target wiki - echo ( "failed: user '$real_user' does not exist in target wiki." ); + echo "failed: user '$real_user' does not exist in target wiki."; continue; } } @@ -210,11 +210,11 @@ if ( $count > 0 ) { if ( $commentExt ) { $f = findAuxFile( $file, $commentExt ); if ( !$f ) { - echo( " No comment file with extension {$commentExt} found for {$file}, using default comment. " ); + echo " No comment file with extension {$commentExt} found for {$file}, using default comment. "; } else { $commentText = file_get_contents( $f ); if ( !$commentText ) { - echo( " Failed to load comment file {$f}, using default comment. " ); + echo " Failed to load comment file {$f}, using default comment. "; } } } @@ -226,7 +226,7 @@ if ( $count > 0 ) { # Import the file if ( isset( $options['dry'] ) ) { - echo( " publishing {$file} by '" . $wgUser->getName() . "', comment '$commentText'... " ); + echo " publishing {$file} by '" . $wgUser->getName() . "', comment '$commentText'... "; } else { $props = FSFile::getPropsFromPath( $file ); $flags = 0; @@ -239,9 +239,9 @@ if ( $count > 0 ) { } $archive = $image->publish( $file, $flags, $options ); if ( !$archive->isGood() ) { - echo( "failed. (" . + echo "failed. (" . $archive->getWikiText() . - ")\n" ); + ")\n"; $failed++; continue; } @@ -253,10 +253,10 @@ if ( $count > 0 ) { } if ( isset( $options['dry'] ) ) { - echo( "done.\n" ); + echo "done.\n"; } elseif ( $image->recordUpload2( $archive->value, $summary, $commentText, $props, $timestamp ) ) { # We're done! - echo( "done.\n" ); + echo "done.\n"; $doProtect = false; @@ -279,7 +279,7 @@ if ( $count > 0 ) { sleep( 2.0 ); # Why this sleep? wfWaitForSlaves(); - echo( "\nSetting image restrictions ... " ); + echo "\nSetting image restrictions ... "; $cascade = false; $restrictions = array(); @@ -289,11 +289,11 @@ if ( $count > 0 ) { $page = WikiPage::factory( $title ); $status = $page->doUpdateRestrictions( $restrictions, array(), $cascade, '', $user ); - echo( ( $status->isOK() ? 'done' : 'failed' ) . "\n" ); + echo ( $status->isOK() ? 'done' : 'failed' ) . "\n"; } } else { - echo( "failed. (at recordUpload stage)\n" ); + echo "failed. (at recordUpload stage)\n"; $svar = 'failed'; } @@ -310,24 +310,24 @@ if ( $count > 0 ) { } # Print out some statistics - echo( "\n" ); + echo "\n"; foreach ( array( 'count' => 'Found', 'limit' => 'Limit', 'ignored' => 'Ignored', 'added' => 'Added', 'skipped' => 'Skipped', 'overwritten' => 'Overwritten', 'failed' => 'Failed' ) as $var => $desc ) { if ( $$var > 0 ) { - echo( "{$desc}: {$$var}\n" ); + echo "{$desc}: {$$var}\n"; } } } else { - echo( "No suitable files could be found for import.\n" ); + echo "No suitable files could be found for import.\n"; } exit( 0 ); function showUsage( $reason = false ) { if ( $reason ) { - echo( $reason . "\n" ); + echo $reason . "\n"; } echo <<getPrefixedText() . "'..." ); + echo "\nUsing title '" . $title->getPrefixedText() . "'..."; if ( !$title->exists() || !isset( $options['nooverwrite'] ) ) { $text = file_get_contents( $filename ); @@ -49,31 +49,31 @@ if ( count( $args ) < 1 || isset( $options['help'] ) ) { if ( is_object( $user ) ) { - echo( "\nUsing username '" . $user->getName() . "'..." ); + echo "\nUsing username '" . $user->getName() . "'..."; $wgUser =& $user; $comment = isset( $options['comment'] ) ? $options['comment'] : 'Importing text file'; $flags = 0 | ( isset( $options['norc'] ) ? EDIT_SUPPRESS_RC : 0 ); - echo( "\nPerforming edit..." ); + echo "\nPerforming edit..."; $page = WikiPage::factory( $title ); $content = ContentHandler::makeContent( $text, $title ); $page->doEditContent( $content, $comment, $flags, false, $user ); - echo( "done.\n" ); + echo "done.\n"; } else { - echo( "invalid username.\n" ); + echo "invalid username.\n"; } } else { - echo( "page exists.\n" ); + echo "page exists.\n"; } } else { - echo( "invalid title.\n" ); + echo "invalid title.\n"; } } else { - echo( "does not exist.\n" ); + echo "does not exist.\n"; } } diff --git a/maintenance/language/rebuildLanguage.php b/maintenance/language/rebuildLanguage.php index e3fd01a493..02c41d298e 100644 --- a/maintenance/language/rebuildLanguage.php +++ b/maintenance/language/rebuildLanguage.php @@ -58,11 +58,11 @@ function removeDupes( $oldMsgArray, $dupeMsgSource ) { if ( file_exists( $dupeMsgSource ) ) { include( $dupeMsgSource ); if ( !isset( $dupeMessages ) ) { - echo( "There are no duplicated messages in the source file provided." ); + echo "There are no duplicated messages in the source file provided."; exit( 1 ); } } else { - echo ( "The specified file $dupeMsgSource cannot be found." ); + echo "The specified file $dupeMsgSource cannot be found."; exit( 1 ); } $newMsgArray = $oldMsgArray; diff --git a/maintenance/purgeOldText.inc b/maintenance/purgeOldText.inc index 111c786aa9..db961d81ec 100644 --- a/maintenance/purgeOldText.inc +++ b/maintenance/purgeOldText.inc @@ -34,42 +34,42 @@ function PurgeRedundantText( $delete = false ) { $tbl_txt = $dbw->tableName( 'text' ); # Get "active" text records from the revisions table - echo( "Searching for active text records in revisions table..." ); + echo "Searching for active text records in revisions table..."; $res = $dbw->query( "SELECT DISTINCT rev_text_id FROM $tbl_rev" ); foreach ( $res as $row ) { $cur[] = $row->rev_text_id; } - echo( "done.\n" ); + echo "done.\n"; # Get "active" text records from the archive table - echo( "Searching for active text records in archive table..." ); + echo "Searching for active text records in archive table..."; $res = $dbw->query( "SELECT DISTINCT ar_text_id FROM $tbl_arc" ); $cur = array(); foreach ( $res as $row ) { $cur[] = $row->ar_text_id; } - echo( "done.\n" ); + echo "done.\n"; # Get the IDs of all text records not in these sets - echo( "Searching for inactive text records..." ); + echo "Searching for inactive text records..."; $set = implode( ', ', $cur ); $res = $dbw->query( "SELECT old_id FROM $tbl_txt WHERE old_id NOT IN ( $set )" ); $old = array(); foreach ( $res as $row ) { $old[] = $row->old_id; } - echo( "done.\n" ); + echo "done.\n"; # Inform the user of what we're going to do $count = count( $old ); - echo( "$count inactive items found.\n" ); + echo "$count inactive items found.\n"; # Delete as appropriate if ( $delete && $count ) { - echo( "Deleting..." ); + echo "Deleting..."; $set = implode( ', ', $old ); $dbw->query( "DELETE FROM $tbl_txt WHERE old_id IN ( $set )" ); - echo( "done.\n" ); + echo "done.\n"; } # Done diff --git a/tests/RunSeleniumTests.php b/tests/RunSeleniumTests.php index 8896a90d41..0136a2a94e 100644 --- a/tests/RunSeleniumTests.php +++ b/tests/RunSeleniumTests.php @@ -99,8 +99,8 @@ class SeleniumTester extends Maintenance { die( "Unable to start the Selenium Server - " . "terminating RunSeleniumTests\n" ); case 'running': - echo ( "Warning: The Selenium Server is " . - "already running\n" ); + echo "Warning: The Selenium Server is " . + "already running\n"; break; } @@ -109,16 +109,16 @@ class SeleniumTester extends Maintenance { protected function stopServer() { if ( !isset( $this->serverManager ) ) { - echo ( "Warning: Request to stop Selenium Server, but it was " . + echo "Warning: Request to stop Selenium Server, but it was " . "not stared by RunSeleniumTests\n" . "RunSeleniumTests cannot stop a Selenium Server it " . - "did not start\n" ); + "did not start\n"; } else { switch ( $this->serverManager->stop() ) { case 'stopped': break; case 'failed': - echo ( "unable to stop the Selenium Server\n" ); + echo "unable to stop the Selenium Server\n"; } } return; diff --git a/tests/parserTests.php b/tests/parserTests.php index 2e5cd53d00..c04c159bed 100644 --- a/tests/parserTests.php +++ b/tests/parserTests.php @@ -84,7 +84,7 @@ if ( isset( $options['file'] ) ) { # Print out software version to assist with locating regressions $version = SpecialVersion::getVersion(); -echo( "This is MediaWiki version {$version}.\n\n" ); +echo "This is MediaWiki version {$version}.\n\n"; if ( isset( $options['fuzz'] ) ) { $tester->fuzzTest( $files ); diff --git a/tests/selenium/SeleniumServerManager.php b/tests/selenium/SeleniumServerManager.php index 9efa509a64..1a1ee00e65 100644 --- a/tests/selenium/SeleniumServerManager.php +++ b/tests/selenium/SeleniumServerManager.php @@ -214,7 +214,7 @@ class SeleniumServerManager { } } wfRestoreWarnings(); - echo ( "Starting Selenium server timed out.\n" ); + echo "Starting Selenium server timed out.\n"; return 'failed'; } else { // server already running. -- 2.20.1