From: umherirrender Date: Sat, 15 Mar 2014 11:32:44 +0000 (+0100) Subject: Rename some local vars to start with a lowercase letter X-Git-Tag: 1.31.0-rc.0~16602 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=7c314de87627c3c99cef0b83a2a9c4bd115a5a51;p=lhc%2Fweb%2Fwiklou.git Rename some local vars to start with a lowercase letter Change-Id: I6e5975ed7351c1439eda19afaba5120c6afa50f1 --- diff --git a/includes/GitInfo.php b/includes/GitInfo.php index 877c2d24e5..6b092d96c6 100644 --- a/includes/GitInfo.php +++ b/includes/GitInfo.php @@ -82,18 +82,18 @@ class GitInfo { * @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 @@ class GitInfo { * @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 @@ class GitInfo { * @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 dd87b06c3b..245714ded1 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -1839,7 +1839,7 @@ class Sanitizer { $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 @@ class Sanitizer { $ # 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 998dd75df5..6e0490d110 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -1034,8 +1034,8 @@ class DatabaseOracle extends DatabaseBase { $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 @@ class DatabaseOracle extends DatabaseBase { $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 c8830d34a7..6aee528074 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -349,11 +349,11 @@ class DatabasePostgres extends DatabaseBase { } 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 @@ __INDEXATTR__; $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 @@ SQL; } 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 915bebaf52..f2c4fbff7c 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1293,19 +1293,19 @@ class Parser { 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 dff6a72ff2..142e5fd884 100644 --- a/includes/search/SearchPostgres.php +++ b/includes/search/SearchPostgres.php @@ -140,8 +140,8 @@ class SearchPostgres extends SearchDatabase { $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 @@ class SearchPostgres extends SearchDatabase { 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 da229f0d06..05c8872e5f 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -333,7 +333,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { * 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 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { if ( !$this->submitClicked ) { throw new PermissionsError( 'suppressrevision' ); } - $UserAllowed = false; + $userAllowed = false; } $numRevisions++; $this->getOutput()->addHTML( $item->getHTML() ); @@ -368,7 +368,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $this->addUsageText(); // Normal sysops can always see what they did, but can't always change it - if ( !$UserAllowed ) { + if ( !$userAllowed ) { return; }