Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355768 )
Change subject: Add explict var visibility ...................................................................... Add explict var visibility Change-Id: Iab8db9b74af4a2af2724d11df3d8dfe9fb255ff4 --- M api/ApiQueryLQTThreads.php M classes/DeletionController.php M classes/Dispatch.php M classes/Thread.php M classes/ThreadHistoryPager.php M classes/ThreadRevision.php M classes/Threads.php M classes/View.php 8 files changed, 139 insertions(+), 139 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads refs/changes/68/355768/1 diff --git a/api/ApiQueryLQTThreads.php b/api/ApiQueryLQTThreads.php index 458e75e..1208ee3 100644 --- a/api/ApiQueryLQTThreads.php +++ b/api/ApiQueryLQTThreads.php @@ -20,7 +20,7 @@ class ApiQueryLQTThreads extends ApiQueryBase { // Property definitions - static $propRelations = array( + public static $propRelations = array( 'id' => 'thread_id', 'subject' => 'thread_subject', 'page' => array( diff --git a/classes/DeletionController.php b/classes/DeletionController.php index 35d65ee..22d7479 100644 --- a/classes/DeletionController.php +++ b/classes/DeletionController.php @@ -1,8 +1,8 @@ <?php class LqtDeletionController { - static $pageids_to_revive; + public static $pageids_to_revive; - static function onArticleDeleteComplete( &$article, &$user, $reason, $id ) { + public static function onArticleDeleteComplete( &$article, &$user, $reason, $id ) { $title = $article->getTitle(); if ( $title->getNamespace() != NS_LQT_THREAD ) { @@ -41,7 +41,7 @@ return true; } - static function recursivelyDeleteReplies( $thread, $reason ) { + public static function recursivelyDeleteReplies( $thread, $reason ) { foreach ( $thread->replies() as $reply ) { $reply->root()->doDeleteArticle( $reason, false, $reply->root()->getId() ); $reply->delete( $reason ); @@ -49,7 +49,7 @@ } } - static function onArticleRevisionUndeleted( &$title, $revision, $page_id ) { + public static function onArticleRevisionUndeleted( &$title, $revision, $page_id ) { if ( $title->getNamespace() == NS_LQT_THREAD ) { self::$pageids_to_revive[$page_id] = $title; } @@ -57,7 +57,7 @@ return true; } - static function onArticleUndelete( &$udTitle, $created, $comment = '' ) { + public static function onArticleUndelete( &$udTitle, $created, $comment = '' ) { if ( empty( self::$pageids_to_revive ) ) { return true; } @@ -100,7 +100,7 @@ * @param $reason string * @return bool */ - static function onArticleConfirmDelete( $article, $out, &$reason ) { + public static function onArticleConfirmDelete( $article, $out, &$reason ) { if ( $article->getTitle()->getNamespace() != NS_LQT_THREAD ) { return true; } @@ -121,7 +121,7 @@ return true; } - static function onArticleDelete( $article ) { + public static function onArticleDelete( $article ) { // Synchronise article data so that moving the article doesn't break any // article association. Threads::synchroniseArticleData( $article ); diff --git a/classes/Dispatch.php b/classes/Dispatch.php index 3c76d91..3555240 100644 --- a/classes/Dispatch.php +++ b/classes/Dispatch.php @@ -2,8 +2,8 @@ class LqtDispatch { /** static cache of per-page LiquidThreads activation setting */ - static $userLqtOverride = array(); - static $primaryView = null; + public static $userLqtOverride = array(); + public static $primaryView = null; /** * @param $output OutputPage @@ -13,7 +13,7 @@ * @param $request WebRequest * @return bool */ - static function talkpageMain( &$output, &$article, &$title, &$user, &$request ) { + public static function talkpageMain( &$output, &$article, &$title, &$user, &$request ) { // We are given a talkpage article and title. Fire up a TalkpageView if ( $title->getNamespace() == NS_LQT_THREAD + 1 /* talk page */ ) { @@ -72,7 +72,7 @@ * @param $request WebRequest * @return bool */ - static function threadPermalinkMain( &$output, &$article, &$title, &$user, &$request ) { + public static function threadPermalinkMain( &$output, &$article, &$title, &$user, &$request ) { $action = $request->getVal( 'action' ); $lqt_method = $request->getVal( 'lqt_method' ); @@ -101,7 +101,7 @@ return $view->show(); } - static function threadSummaryMain( &$output, &$article, &$title, &$user, &$request ) { + public static function threadSummaryMain( &$output, &$article, &$title, &$user, &$request ) { $viewname = 'SummaryPageView'; $view = new $viewname( $output, $article, $title, $user, $request ); self::$primaryView = $view; @@ -112,7 +112,7 @@ * @param $title Title * @return bool|null */ - static function isLqtPage( $title ) { + public static function isLqtPage( $title ) { if ( !$title ) { return false; } @@ -152,7 +152,7 @@ * @param $title Title * @return null|int */ - static function getUserLqtOverride( $title ) { + public static function getUserLqtOverride( $title ) { if ( ! is_object( $title ) ) { return null; } @@ -214,7 +214,7 @@ * @param $request WebRequest * @return bool */ - static function tryPage( $output, $article, $title, $user, $request ) { + public static function tryPage( $output, $article, $title, $user, $request ) { if ( LqtDispatch::isLqtPage( $title ) ) { // LiquidThreads pages, Talk:X etc return self::talkpageMain( $output, $article, $title, $user, $request ); @@ -228,7 +228,7 @@ return true; } - static function onSkinTemplateNavigation( $skinTemplate, &$links ) { + public static function onSkinTemplateNavigation( $skinTemplate, &$links ) { if ( !self::$primaryView ) return true; self::$primaryView->customizeNavigation( $skinTemplate, $links ); @@ -243,7 +243,7 @@ * @param $wgLang * @return bool */ - static function onPageContentLanguage( $title, &$pageLang, $wgLang ) { + public static function onPageContentLanguage( $title, &$pageLang, $wgLang ) { global $wgRequest; $method = $wgRequest->getVal( 'lqt_method' ); $oldid = $wgRequest->getVal( 'lqt_oldid' ); diff --git a/classes/Thread.php b/classes/Thread.php index 6ffccc7..15412c8 100644 --- a/classes/Thread.php +++ b/classes/Thread.php @@ -48,18 +48,18 @@ public $dbVersion; // A copy of the thread as it exists in the database. - static $titleCacheById = array(); - static $replyCacheById = array(); - static $articleCacheById = array(); - static $reactionCacheById = array(); + public static $titleCacheById = array(); + public static $replyCacheById = array(); + public static $articleCacheById = array(); + public static $reactionCacheById = array(); - static $VALID_TYPES = array( Threads::TYPE_NORMAL, Threads::TYPE_MOVED, Threads::TYPE_DELETED ); + public static $VALID_TYPES = array( Threads::TYPE_NORMAL, Threads::TYPE_MOVED, Threads::TYPE_DELETED ); - function isHistorical() { + public function isHistorical() { return $this->isHistorical; } - static function create( $root, $article, $superthread = null, + public static function create( $root, $article, $superthread = null, $type = Threads::TYPE_NORMAL, $subject = '', $summary = '', $bump = null, $signature = null ) { @@ -117,7 +117,7 @@ return $thread; } - function insert() { + public function insert() { $this->dieIfHistorical(); if ( $this->id() ) { @@ -144,7 +144,7 @@ unset( $this->dbVersion->dbVersion ); } - function setRoot( $article ) { + public function setRoot( $article ) { $this->rootId = $article->getId(); $this->root = $article; @@ -153,12 +153,12 @@ } } - function setRootId( $article ) { + public function setRootId( $article ) { $this->rootId = $article; $this->root = null; } - function commitRevision( $change_type, $change_object = null, $reason = "", + public function commitRevision( $change_type, $change_object = null, $reason = "", $bump = null ) { $this->dieIfHistorical(); global $wgUser; @@ -193,7 +193,7 @@ } } - function logChange( $change_type, $original, $change_object = null, $reason = '' ) { + public function logChange( $change_type, $original, $change_object = null, $reason = '' ) { $log = new LogPage( 'liquidthreads' ); if ( is_null( $reason ) ) { @@ -235,7 +235,7 @@ } } - function updateEditedness( $change_type ) { + public function updateEditedness( $change_type ) { global $wgUser; if ( $change_type == Threads::CHANGE_REPLY_CREATED @@ -254,7 +254,7 @@ } /** Unless you know what you're doing, you want commitRevision */ - function save( $fname = null ) { + public function save( $fname = null ) { $this->dieIfHistorical(); $dbr = wfGetDB( DB_MASTER ); @@ -282,7 +282,7 @@ unset( $this->dbVersion->dbVersion ); } - function getRow() { + public function getRow() { $id = $this->id(); $dbw = wfGetDB( DB_MASTER ); @@ -325,7 +325,7 @@ ); } - function author() { + public function author() { if ( $this->authorId ) { return User::newFromId( $this->authorId ); } else { @@ -334,7 +334,7 @@ } } - function delete( $reason, $commit = true ) { + public function delete( $reason, $commit = true ) { if ( $this->type == Threads::TYPE_DELETED ) { return; } @@ -364,7 +364,7 @@ } } - function undelete( $reason ) { + public function undelete( $reason ) { $this->type = Threads::TYPE_NORMAL; $this->commitRevision( Threads::CHANGE_UNDELETED, $this, $reason ); @@ -376,7 +376,7 @@ } } - function moveToPage( $title, $reason, $leave_trace ) { + public function moveToPage( $title, $reason, $leave_trace ) { global $wgUser; if ( !$this->isTopmostThread() ) @@ -428,7 +428,7 @@ // Drop a note at the source location of a move, noting that a thread was moved from // there. - function leaveTrace( $reason, $oldTitle, $newTitle ) { + public function leaveTrace( $reason, $oldTitle, $newTitle ) { $this->dieIfHistorical(); // Create redirect text @@ -455,7 +455,7 @@ } // Lists total reply count, including replies to replies and such - function replyCount() { + public function replyCount() { // Populate reply count if ( $this->replyCount == - 1 ) { if ( $this->isTopmostThread() ) { @@ -474,7 +474,7 @@ return $this->replyCount; } - function incrementReplyCount( $val = 1 ) { + public function incrementReplyCount( $val = 1 ) { $this->replyCount += $val; wfDebug( "Incremented reply count for thread " . $this->id() . " to " . $this->replyCount . "\n" ); @@ -489,11 +489,11 @@ } } - function decrementReplyCount( $val = 1 ) { + public function decrementReplyCount( $val = 1 ) { $this->incrementReplyCount( - $val ); } - static function newFromRow( $row ) { + public static function newFromRow( $row ) { $id = $row->thread_id; if ( isset( Threads::$cache_by_id[$id] ) ) { @@ -577,7 +577,7 @@ } // Load a list of threads in bulk, including all subthreads. - static function bulkLoad( $rows ) { + public static function bulkLoad( $rows ) { // Preload subthreads $top_thread_ids = array(); $all_thread_rows = $rows; @@ -756,7 +756,7 @@ * Return the User object representing the author of the first revision * (or null, if the database is screwed up). */ - function loadOriginalAuthorFromRevision( ) { + public function loadOriginalAuthorFromRevision( ) { $this->dieIfHistorical(); $dbr = wfGetDB( DB_SLAVE ); @@ -779,7 +779,7 @@ return null; } - static function recursiveGetReplyCount( $thread, $level = 1 ) { + public static function recursiveGetReplyCount( $thread, $level = 1 ) { if ( $level > 80 ) { return 1; } @@ -798,7 +798,7 @@ // Lazy updates done whenever a thread is loaded. // Much easier than running a long-running maintenance script. - function doLazyUpdates( ) { + public function doLazyUpdates( ) { if ( $this->isHistorical() ) { return; // Don't do lazy updates on stored historical threads. } @@ -949,7 +949,7 @@ $doingUpdates = false; } - function addReply( $thread ) { + public function addReply( $thread ) { $thread->setSuperThread( $this ); if ( is_array( $this->replies ) ) { @@ -963,7 +963,7 @@ $this->incrementReplyCount( $thread->replyCount() + 1 ); } - function removeReply( $thread ) { + public function removeReply( $thread ) { if ( is_object( $thread ) ) { $thread = $thread->id(); } @@ -977,7 +977,7 @@ $this->decrementReplyCount( 1 + $threadObj->replyCount() ); } - function checkReplies( $replies ) { + public function checkReplies( $replies ) { // Fixes a bug where some history pages were not working, before // superthread was properly instance-cached. if ( $this->isHistorical() ) { return; } @@ -997,7 +997,7 @@ } } - function replies() { + public function replies() { if ( !$this->id() ) { return array(); } @@ -1035,7 +1035,7 @@ return $this->replies; } - function setSuperthread( $thread ) { + public function setSuperthread( $thread ) { if ( $thread == null ) { $this->parentId = null; $this->ancestorId = 0; @@ -1054,7 +1054,7 @@ } } - function superthread() { + public function superthread() { if ( !$this->hasSuperthread() ) { return null; } elseif ( $this->superthread ) { @@ -1066,11 +1066,11 @@ } } - function hasSuperthread() { + public function hasSuperthread() { return !$this->isTopmostThread(); } - function topmostThread() { + public function topmostThread() { if ( $this->isTopmostThread() ) { return $this->ancestor = $this; } elseif ( $this->ancestor ) { @@ -1090,7 +1090,7 @@ } } - function setAncestor( $newAncestor ) { + public function setAncestor( $newAncestor ) { if ( is_object( $newAncestor ) ) { $this->ancestorId = $newAncestor->id(); } else { @@ -1100,7 +1100,7 @@ // Due to a bug in earlier versions, the topmost thread sometimes isn't there. // Fix the corruption by repeatedly grabbing the parent until we hit the topmost thread. - function fixMissingAncestor() { + public function fixMissingAncestor() { $thread = $this; $this->dieIfHistorical(); @@ -1118,23 +1118,23 @@ return $thread; } - function isTopmostThread() { + public function isTopmostThread() { return $this->ancestorId == $this->id || $this->parentId == 0; } - function setArticle( $a ) { + public function setArticle( $a ) { $this->articleId = $a->getID(); $this->articleNamespace = $a->getTitle()->getNamespace(); $this->articleTitle = $a->getTitle()->getDBkey(); $this->touch(); } - function touch() { + public function touch() { // Nothing here yet } - function article() { + public function article() { if ( $this->article ) return $this->article; if ( !is_null( $this->articleId ) ) { @@ -1163,16 +1163,16 @@ } } - function id() { + public function id() { return $this->id; } - function ancestorId() { + public function ancestorId() { return $this->ancestorId; } // The 'root' is the page in the Thread namespace corresponding to this thread. - function root( ) { + public function root( ) { if ( !$this->rootId ) return null; if ( !$this->root ) { if ( isset( self::$articleCacheById[$this->rootId] ) ) { @@ -1203,11 +1203,11 @@ return $this->root; } - function editedness() { + public function editedness() { return $this->editedness; } - function summary() { + public function summary() { if ( !$this->summaryId ) return null; @@ -1227,18 +1227,18 @@ return $this->summary; } - function hasSummary() { + public function hasSummary() { return $this->summaryId != null; } - function setSummary( $post ) { + public function setSummary( $post ) { // Weird -- this was setting $this->summary to NULL before I changed it. // If there was some reason why, please tell me! -- Andrew $this->summary = $post; $this->summaryId = $post->getID(); } - function title() { + public function title() { if ( is_object( $this->root() ) ) { return $this->root()->getTitle(); } else { @@ -1247,7 +1247,7 @@ } } - static function splitIncrementFromSubject( $subject_string ) { + public static function splitIncrementFromSubject( $subject_string ) { preg_match( '/^(.*) \((\d+)\)$/', $subject_string, $matches ); if ( count( $matches ) != 3 ) throw new Exception( __METHOD__ . ": thread subject has no increment: " . $subject_string ); @@ -1255,15 +1255,15 @@ return $matches; } - function subject() { + public function subject() { return $this->subject; } - function formattedSubject() { + public function formattedSubject() { return LqtView::formatSubject( $this->subject() ); } - function setSubject( $subject ) { + public function setSubject( $subject ) { $this->subject = $subject; foreach ( $this->replies() as $reply ) { @@ -1272,41 +1272,41 @@ } // Deprecated, use subject(). - function subjectWithoutIncrement() { + public function subjectWithoutIncrement() { return $this->subject(); } // Currently equivalent to isTopmostThread. - function hasDistinctSubject() { + public function hasDistinctSubject() { return $this->isTopmostThread(); } - function hasSubthreads() { + public function hasSubthreads() { return count( $this->replies() ) != 0; } // Synonym for replies() - function subthreads() { + public function subthreads() { return $this->replies(); } - function modified() { + public function modified() { return $this->modified; } - function created() { + public function created() { return $this->created; } - function type() { + public function type() { return $this->type; } - function setType( $t ) { + public function setType( $t ) { $this->type = $t; } - function redirectThread() { + public function redirectThread() { $rev = Revision::newFromId( $this->root()->getLatest() ); $rtitle = ContentHandler::makeContent( $rev->getContent( Revision::RAW )->getNativeData(), @@ -1323,7 +1323,7 @@ // This only makes sense when called from the hook, because it uses the hook's // default behavior to check whether this thread itself is protected, so you'll // get false negatives if you use it from some other context. - function getRestrictions( $action, &$result ) { + public function getRestrictions( $action, &$result ) { if ( $this->hasSuperthread() ) { $parent_restrictions = $this->superthread()->root()->getTitle()->getRestrictions( $action ); } else { @@ -1341,21 +1341,21 @@ } - function getAnchorName() { + public function getAnchorName() { $wantedId = $this->subject() . "_{$this->id()}"; return Sanitizer::escapeId( $wantedId ); } - function updateHistory() { + public function updateHistory() { } - function setAuthor( $user ) { + public function setAuthor( $user ) { $this->authorId = $user->getId(); $this->authorName = $user->getName(); } // Load all lazy-loaded data in prep for (e.g.) serialization. - function loadAllData() { + public function loadAllData() { // Make sure superthread and topmost thread are loaded. $this->superthread(); $this->topmostThread(); @@ -1367,7 +1367,7 @@ } // On serialization, load all data because it will be different in the DB when we wake up. - function __sleep() { + public function __sleep() { $this->loadAllData(); $fields = array_keys( get_object_vars( $this ) ); @@ -1379,20 +1379,20 @@ return $fields; } - function __wakeup() { + public function __wakeup() { // Mark as historical. $this->isHistorical = true; } // This is a safety valve that makes sure that the DB is NEVER touched by a historical // thread (even for reading, because the data will be out of date). - function dieIfHistorical() { + public function dieIfHistorical() { if ( $this->isHistorical() ) { throw new Exception( "Attempted write or DB operation on historical thread" ); } } - function rootRevision() { + public function rootRevision() { if ( !$this->isHistorical() || !isset( $this->topmostThread()->threadRevision ) || ! $this->root() ) { @@ -1418,11 +1418,11 @@ return $row->rev_id; } - function sortkey() { + public function sortkey() { return $this->sortkey; } - function setSortKey( $k = null ) { + public function setSortKey( $k = null ) { if ( is_null( $k ) ) { $k = wfTimestamp( TS_MW ); } @@ -1430,7 +1430,7 @@ $this->sortkey = $k; } - function replyWithId( $id ) { + public function replyWithId( $id ) { if ( $this->id() == $id ) { return $this; } @@ -1444,7 +1444,7 @@ return null; } - static function createdSortCallback( $a, $b ) { + public static function createdSortCallback( $a, $b ) { $a = $a->created(); $b = $b->created(); @@ -1503,7 +1503,7 @@ $newParent->commitRevision( Threads::CHANGE_MERGED_TO, $this, $reason ); } - static function recursiveSet( $thread, $subject, $ancestor, $superthread = false ) { + public static function recursiveSet( $thread, $subject, $ancestor, $superthread = false ) { $thread->setSubject( $subject ); $thread->setAncestor( $ancestor->id() ); @@ -1518,7 +1518,7 @@ } } - static function validateSubject( $subject, &$title, $replyTo, $article ) { + public static function validateSubject( $subject, &$title, $replyTo, $article ) { $t = null; $ok = true; diff --git a/classes/ThreadHistoryPager.php b/classes/ThreadHistoryPager.php index e98c194..898c178 100644 --- a/classes/ThreadHistoryPager.php +++ b/classes/ThreadHistoryPager.php @@ -3,9 +3,9 @@ use MediaWiki\MediaWikiServices; class ThreadHistoryPager extends TablePager { - static $change_names; + public static $change_names; - function __construct( $view, $thread ) { + public function __construct( $view, $thread ) { parent::__construct(); $this->thread = $thread; @@ -31,7 +31,7 @@ ); } - function getQueryInfo() { + public function getQueryInfo() { $queryInfo = array( 'tables' => array( 'thread_history' ), 'fields' => '*', @@ -42,7 +42,7 @@ return $queryInfo; } - function getFieldMessages() { + public function getFieldMessages() { $headers = array( 'th_timestamp' => $this->msg( 'lqt-history-time' )->text(), 'th_user_text' => $this->msg( 'lqt-history-user' )->text(), @@ -53,7 +53,7 @@ return $headers; } - function getFieldNames() { + public function getFieldNames() { static $headers = null; if ( !empty( $headers ) ) { @@ -63,7 +63,7 @@ return $this->getFieldMessages(); } - function formatValue( $name, $value ) { + public function formatValue( $name, $value ) { global $wgLang, $wgTitle; $row = $this->mCurrentRow; @@ -93,7 +93,7 @@ } } - function getActionDescription( $type ) { + public function getActionDescription( $type ) { global $wgOut; $args = array(); @@ -146,18 +146,18 @@ return Html::rawElement( 'span', array( 'class' => 'plainlinks' ), $wgOut->parseInline( $content ) ); } - function getIndexField() { + public function getIndexField() { return 'th_timestamp'; } - function getDefaultSort() { + public function getDefaultSort() { return 'th_timestamp'; } - function isFieldSortable( $name ) { + public function isFieldSortable( $name ) { $sortable_fields = array( 'th_timestamp', 'th_user_text', 'th_change_type' ); return in_array( $name, $sortable_fields ); } - function getDefaultDirections() { return true; /* descending */ } + public function getDefaultDirections() { return true; /* descending */ } } diff --git a/classes/ThreadRevision.php b/classes/ThreadRevision.php index dcd42a4..1262434 100644 --- a/classes/ThreadRevision.php +++ b/classes/ThreadRevision.php @@ -1,7 +1,7 @@ <?php class ThreadRevision { - static $load = + public static $load = array( 'th_id' => 'mId', 'th_thread' => 'mThreadId', @@ -20,7 +20,7 @@ protected $mId, $mThreadId, $mTimestamp, $mUserId, $mUserText, $mChangeType, $mChangeObjectId, $mChangeObject, $mChangeComment, $mObjSer, $mThreadObj; - static function loadFromId( $id ) { + public static function loadFromId( $id ) { $dbr = wfGetDB( DB_SLAVE ); $row = $dbr->selectRow( 'thread_history', '*', array( 'th_id' => $id ), __METHOD__ ); @@ -29,7 +29,7 @@ return self::loadFromRow( $row ); } - static function loadFromRow( $row ) { + public static function loadFromRow( $row ) { if ( !$row ) return null; $rev = new ThreadRevision; @@ -44,7 +44,7 @@ return $rev; } - static function create( $thread, $change_type, $change_object = null, $comment = '', + public static function create( $thread, $change_type, $change_object = null, $comment = '', $user = null, $timestamp = null ) { global $wgContLang; @@ -94,7 +94,7 @@ return $rev; } - function insert() { + public function insert() { $dbw = wfGetDB( DB_MASTER ); $row = $this->getRow(); @@ -105,7 +105,7 @@ $this->mId = $dbw->insertId(); } - function save() { + public function save() { $row = $this->getRow(); $dbw = wfGetDB( DB_MASTER ); @@ -113,7 +113,7 @@ $dbw->replace( 'thread_history', array( 'th_thread' ), $row, __METHOD__ ); } - function getRow() { + public function getRow() { $row = array(); // First, prep the data for insertion @@ -127,11 +127,11 @@ return $row; } - function getTimestamp() { + public function getTimestamp() { return wfTimestamp( TS_MW, $this->mTimestamp ); } - function getUser() { + public function getUser() { if ( $this->mUserId ) { return User::newFromId( $this->mUserId ); } @@ -139,11 +139,11 @@ return User::newFromText( $this->mUserText, /* No validation */ false ); } - function getChangeType() { + public function getChangeType() { return $this->mChangeType; } - function getChangeObject() { + public function getChangeObject() { if ( is_null( $this->mChangeObject ) && $this->mChangeObjectId ) { $threadObj = $this->getThreadObj(); @@ -160,15 +160,15 @@ return $this->mChangeObject; } - function getChangeComment() { + public function getChangeComment() { return $this->mChangeComment; } - function getId() { + public function getId() { return $this->mId; } - function getThreadObj() { + public function getThreadObj() { if ( is_null( $this->mThreadObj ) && !is_null( $this->mObjSer ) ) { $this->mThreadObj = unserialize( $this->mObjSer ); } elseif ( is_null( $this->mThreadObj ) && is_null( $this->mObjSer ) ) { @@ -186,7 +186,7 @@ return $this->mThreadObj; } - function prev() { + public function prev() { $dbr = wfGetDB( DB_SLAVE ); $cond = 'th_id<' . $dbr->addQuotes( intval( $this->getId() ) ); @@ -197,7 +197,7 @@ return self::loadFromRow( $row ); } - function next() { + public function next() { $dbr = wfGetDB( DB_SLAVE ); $cond = 'th_id>' . $dbr->addQuotes( intval( $this->getId() ) ); diff --git a/classes/Threads.php b/classes/Threads.php index 8727b7d..6da8c88 100644 --- a/classes/Threads.php +++ b/classes/Threads.php @@ -24,7 +24,7 @@ const CHANGE_ADJUSTED_SORTKEY = 14; const CHANGE_EDITED_SIGNATURE = 15; - static $VALID_CHANGE_TYPES = array( + public static $VALID_CHANGE_TYPES = array( self::CHANGE_EDITED_SUMMARY, self::CHANGE_EDITED_ROOT, self::CHANGE_REPLY_CREATED, @@ -49,9 +49,9 @@ const EDITED_BY_AUTHOR = 2; const EDITED_BY_OTHERS = 3; - static $cache_by_root = array(); - static $cache_by_id = array(); - static $occupied_titles = array(); + public static $cache_by_root = array(); + public static $cache_by_id = array(); + public static $occupied_titles = array(); /** * Create the talkpage if it doesn't exist so that links to it @@ -75,7 +75,7 @@ } } - static function loadFromResult( $res, $db, $bulkLoad = false ) { + public static function loadFromResult( $res, $db, $bulkLoad = false ) { $rows = array(); $threads = array(); @@ -94,7 +94,7 @@ return Thread::bulkLoad( $rows ); } - static function where( $where, $options = array(), $bulkLoad = true ) { + public static function where( $where, $options = array(), $bulkLoad = true ) { $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'thread', '*', $where, __METHOD__, $options ); @@ -136,7 +136,7 @@ * @param $bulkLoad bool * @return Thread */ - static function withRoot( $post, $bulkLoad = true ) { + public static function withRoot( $post, $bulkLoad = true ) { if ( $post->getTitle()->getNamespace() != NS_LQT_THREAD ) { // No articles outside the thread namespace have threads associated with them; return null; @@ -161,7 +161,7 @@ * @param $bulkLoad bool * @return Thread */ - static function withId( $id, $bulkLoad = true ) { + public static function withId( $id, $bulkLoad = true ) { if ( array_key_exists( $id, self::$cache_by_id ) ) { return self::$cache_by_id[$id]; } @@ -176,13 +176,13 @@ * @param $bulkLoad bool * @return Thread */ - static function withSummary( $article, $bulkLoad = true ) { + public static function withSummary( $article, $bulkLoad = true ) { $ts = Threads::where( array( 'thread_summary_page' => $article->getId() ), array(), $bulkLoad ); return self::assertSingularity( $ts, 'thread_summary_page', $article->getId() ); } - static function articleClause( $article ) { + public static function articleClause( $article ) { $dbr = wfGetDB( DB_SLAVE ); $titleCond = array( 'thread_article_title' => $article->getTitle()->getDBKey(), @@ -199,7 +199,7 @@ return $dbr->makeList( $conds, LIST_OR ); } - static function topLevelClause() { + public static function topLevelClause() { $dbr = wfGetDB( DB_SLAVE ); $arr = array( 'thread_ancestor=thread_id', 'thread_parent' => null ); @@ -207,17 +207,17 @@ return $dbr->makeList( $arr, LIST_OR ); } - static function newThreadTitle( $subject, $article ) { + public static function newThreadTitle( $subject, $article ) { $base = $article->getTitle()->getPrefixedText() . "/$subject"; return self::incrementedTitle( $base, NS_LQT_THREAD ); } - static function newSummaryTitle( $t ) { + public static function newSummaryTitle( $t ) { return self::incrementedTitle( $t->title()->getText(), NS_LQT_SUMMARY ); } - static function newReplyTitle( $thread, $user ) { + public static function newReplyTitle( $thread, $user ) { $topThread = $thread->topmostThread(); $base = $topThread->title()->getText() . '/' @@ -311,7 +311,7 @@ // conversion, this function will return false. Otherwise, true will be returned. // If the queueMore parameter is set and rows are left to update, a job queue item // will then be added with the same limit, to finish the remainder of the update. - static function synchroniseArticleData( $article, $limit = false, $queueMore = false ) { + public static function synchroniseArticleData( $article, $limit = false, $queueMore = false ) { if ( !$article ) { throw new Exception( "synchroniseArticleData called on null article" ); } diff --git a/classes/View.php b/classes/View.php index b68c565..4f8f875 100644 --- a/classes/View.php +++ b/classes/View.php @@ -41,7 +41,7 @@ protected $sort_order = TalkpageView::LQT_NEWEST_CHANGES; - static $stylesAndScriptsDone = false; + public static $stylesAndScriptsDone = false; function __construct( &$output, &$article, &$title, &$user, &$request ) { $this->article = $article; -- To view, visit https://gerrit.wikimedia.org/r/355768 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iab8db9b74af4a2af2724d11df3d8dfe9fb255ff4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LiquidThreads 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