Umherirrender has uploaded a new change for review. https://gerrit.wikimedia.org/r/118808
Change subject: Rename some local vars to start with a lowercase letter ...................................................................... Rename some local vars to start with a lowercase letter Change-Id: I6e5975ed7351c1439eda19afaba5120c6afa50f1 --- M includes/GitInfo.php M includes/Sanitizer.php M includes/db/DatabaseOracle.php M includes/db/DatabasePostgres.php M includes/parser/Parser.php M includes/search/SearchPostgres.php M includes/specials/SpecialRevisiondelete.php 7 files changed, 36 insertions(+), 36 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/08/118808/1 diff --git a/includes/GitInfo.php b/includes/GitInfo.php index 877c2d2..6b092d9 100644 --- a/includes/GitInfo.php +++ b/includes/GitInfo.php @@ -82,18 +82,18 @@ * @return string The HEAD */ public function getHead() { - $HEADfile = "{$this->basedir}/HEAD"; + $headFile = "{$this->basedir}/HEAD"; - if ( !is_readable( $HEADfile ) ) { + if ( !is_readable( $headFile ) ) { return false; } - $HEAD = file_get_contents( $HEADfile ); + $head = file_get_contents( $headFile ); - if ( preg_match( "/ref: (.*)/", $HEAD, $m ) ) { + if ( preg_match( "/ref: (.*)/", $head, $m ) ) { return rtrim( $m[1] ); } else { - return rtrim( $HEAD ); + return rtrim( $head ); } } @@ -102,20 +102,20 @@ * @return string A SHA1 or false */ public function getHeadSHA1() { - $HEAD = $this->getHead(); + $head = $this->getHead(); // If detached HEAD may be a SHA1 - if ( self::isSHA1( $HEAD ) ) { - return $HEAD; + if ( self::isSHA1( $head ) ) { + return $head; } // If not a SHA1 it may be a ref: - $REFfile = "{$this->basedir}/{$HEAD}"; - if ( !is_readable( $REFfile ) ) { + $refFile = "{$this->basedir}/{$head}"; + if ( !is_readable( $refFile ) ) { return false; } - $sha1 = rtrim( file_get_contents( $REFfile ) ); + $sha1 = rtrim( file_get_contents( $refFile ) ); return $sha1; } @@ -150,11 +150,11 @@ * @return string The branch name, HEAD, or false */ public function getCurrentBranch() { - $HEAD = $this->getHead(); - if ( $HEAD && preg_match( "#^refs/heads/(.*)$#", $HEAD, $m ) ) { + $head = $this->getHead(); + if ( $head && preg_match( "#^refs/heads/(.*)$#", $head, $m ) ) { return $m[1]; } else { - return $HEAD; + return $head; } } diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index 90548fe..9c58b8e 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -1839,7 +1839,7 @@ $rfc5322_atext = "a-z0-9!#$%&'*+\\-\/=?^_`{|}~"; $rfc1034_ldh_str = "a-z0-9\\-"; - $HTML5_email_regexp = "/ + $html5_email_regexp = "/ ^ # start of string [$rfc5322_atext\\.]+ # user part which is liberal :p @ # 'apostrophe' @@ -1848,6 +1848,6 @@ $ # End of string /ix"; // case Insensitive, eXtended - return (bool)preg_match( $HTML5_email_regexp, $addr ); + return (bool)preg_match( $html5_email_regexp, $addr ); } } diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 998dd75..6e0490d 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -1034,8 +1034,8 @@ $table = strtoupper( $this->removeIdentifierQuotes( $table ) ); $index = strtoupper( $index ); $owner = strtoupper( $this->mDBname ); - $SQL = "SELECT 1 FROM all_indexes WHERE owner='$owner' AND index_name='{$table}_{$index}'"; - $res = $this->doQuery( $SQL ); + $sql = "SELECT 1 FROM all_indexes WHERE owner='$owner' AND index_name='{$table}_{$index}'"; + $res = $this->doQuery( $sql ); if ( $res ) { $count = $res->numRows(); $res->free(); @@ -1056,8 +1056,8 @@ $table = $this->tableName( $table ); $table = $this->addQuotes( strtoupper( $this->removeIdentifierQuotes( $table ) ) ); $owner = $this->addQuotes( strtoupper( $this->mDBname ) ); - $SQL = "SELECT 1 FROM all_tables WHERE owner=$owner AND table_name=$table"; - $res = $this->doQuery( $SQL ); + $sql = "SELECT 1 FROM all_tables WHERE owner=$owner AND table_name=$table"; + $res = $this->doQuery( $sql ); if ( $res && $res->numRows() > 0 ) { $exists = true; } else { diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index c8830d3..6aee528 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -349,11 +349,11 @@ } function hasConstraint( $name ) { - $SQL = "SELECT 1 FROM pg_catalog.pg_constraint c, pg_catalog.pg_namespace n " . + $sql = "SELECT 1 FROM pg_catalog.pg_constraint c, pg_catalog.pg_namespace n " . "WHERE c.connamespace = n.oid AND conname = '" . pg_escape_string( $this->mConn, $name ) . "' AND n.nspname = '" . pg_escape_string( $this->mConn, $this->getCoreSchema() ) . "'"; - $res = $this->doQuery( $SQL ); + $res = $this->doQuery( $sql ); return $this->numRows( $res ); } @@ -1360,10 +1360,10 @@ $table = $this->realTableName( $table, 'raw' ); $etable = $this->addQuotes( $table ); $eschema = $this->addQuotes( $schema ); - $SQL = "SELECT 1 FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n " + $sql = "SELECT 1 FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n " . "WHERE c.relnamespace = n.oid AND c.relname = $etable AND n.nspname = $eschema " . "AND c.relkind IN ('" . implode( "','", $types ) . "')"; - $res = $this->query( $SQL ); + $res = $this->query( $sql ); $count = $res ? $res->numRows() : 0; return (bool)$count; @@ -1421,13 +1421,13 @@ } function constraintExists( $table, $constraint ) { - $SQL = sprintf( "SELECT 1 FROM information_schema.table_constraints " . + $sql = sprintf( "SELECT 1 FROM information_schema.table_constraints " . "WHERE constraint_schema = %s AND table_name = %s AND constraint_name = %s", $this->addQuotes( $this->getCoreSchema() ), $this->addQuotes( $table ), $this->addQuotes( $constraint ) ); - $res = $this->query( $SQL ); + $res = $this->query( $sql ); if ( !$res ) { return null; } diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index e3d7fdf..7d9f103 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1293,19 +1293,19 @@ if ( substr( $m[0], 0, 3 ) === 'RFC' ) { $keyword = 'RFC'; $urlmsg = 'rfcurl'; - $CssClass = 'mw-magiclink-rfc'; + $cssClass = 'mw-magiclink-rfc'; $id = $m[4]; } elseif ( substr( $m[0], 0, 4 ) === 'PMID' ) { $keyword = 'PMID'; $urlmsg = 'pubmedurl'; - $CssClass = 'mw-magiclink-pmid'; + $cssClass = 'mw-magiclink-pmid'; $id = $m[4]; } else { throw new MWException( __METHOD__ . ': unrecognised match type "' . substr( $m[0], 0, 20 ) . '"' ); } $url = wfMessage( $urlmsg, $id )->inContentLanguage()->text(); - return Linker::makeExternalLink( $url, "{$keyword} {$id}", true, $CssClass ); + return Linker::makeExternalLink( $url, "{$keyword} {$id}", true, $cssClass ); } elseif ( isset( $m[5] ) && $m[5] !== '' ) { # ISBN $isbn = $m[5]; diff --git a/includes/search/SearchPostgres.php b/includes/search/SearchPostgres.php index 9dc1e77..01e6c48 100644 --- a/includes/search/SearchPostgres.php +++ b/includes/search/SearchPostgres.php @@ -140,8 +140,8 @@ $searchstring = $this->parseQuery( $term ); ## We need a separate query here so gin does not complain about empty searches - $SQL = "SELECT to_tsquery($searchstring)"; - $res = $this->db->query( $SQL ); + $sql = "SELECT to_tsquery($searchstring)"; + $res = $this->db->query( $sql ); if ( !$res ) { ## TODO: Better output (example to catch: one 'two) die( "Sorry, that was not a valid search string. Please go back and try again" ); @@ -196,10 +196,10 @@ function update( $pageid, $title, $text ) { ## We don't want to index older revisions - $SQL = "UPDATE pagecontent SET textvector = NULL WHERE old_id IN " . + $sql = "UPDATE pagecontent SET textvector = NULL WHERE old_id IN " . "(SELECT rev_text_id FROM revision WHERE rev_page = " . intval( $pageid ) . " ORDER BY rev_text_id DESC OFFSET 1)"; - $this->db->query( $SQL ); + $this->db->query( $sql ); return true; } diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index da229f0..05c8872 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -333,7 +333,7 @@ * which will allow the user to choose new visibility settings. */ protected function showForm() { - $UserAllowed = true; + $userAllowed = true; if ( $this->typeName == 'logging' ) { $this->getOutput()->addWikiMsg( 'logdelete-selected', $this->getLanguage()->formatNum( count( $this->ids ) ) ); @@ -353,7 +353,7 @@ if ( !$this->submitClicked ) { throw new PermissionsError( 'suppressrevision' ); } - $UserAllowed = false; + $userAllowed = false; } $numRevisions++; $this->getOutput()->addHTML( $item->getHTML() ); @@ -368,7 +368,7 @@ $this->addUsageText(); // Normal sysops can always see what they did, but can't always change it - if ( !$UserAllowed ) { + if ( !$userAllowed ) { return; } -- To view, visit https://gerrit.wikimedia.org/r/118808 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e5975ed7351c1439eda19afaba5120c6afa50f1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits