* @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 );
}
}
* @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;
}
* @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;
}
}
$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'
$ # End of string
/ix"; // case Insensitive, eXtended
- return (bool)preg_match( $HTML5_email_regexp, $addr );
+ return (bool)preg_match( $html5_email_regexp, $addr );
}
}
$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();
$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 {
}
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 );
}
$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;
}
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;
}
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];
$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" );
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;
}
* 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 ) ) );
if ( !$this->submitClicked ) {
throw new PermissionsError( 'suppressrevision' );
}
- $UserAllowed = false;
+ $userAllowed = false;
}
$numRevisions++;
$this->getOutput()->addHTML( $item->getHTML() );
$this->addUsageText();
// Normal sysops can always see what they did, but can't always change it
- if ( !$UserAllowed ) {
+ if ( !$userAllowed ) {
return;
}