r111320 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111319‎ | r111320 | r111321 >
Date:19:25, 12 February 2012
Author:hashar
Status:ok
Tags:
Comment:
revert r111234 (deprecated methods removal)

Reasons invoked by Rob Lanphier are:
* ongoing code slush
* backwards compatilibility issues
Modified paths:
  • /trunk/phase3/includes/FakeTitle.php (modified) (history)
  • /trunk/phase3/includes/Preferences.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/parser/ParserOptions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/ParserOptions.php
@@ -278,6 +278,9 @@
279279 function setNumberHeadings( $x ) { return wfSetVar( $this->mNumberHeadings, $x ); }
280280 function setAllowSpecialInclusion( $x ) { return wfSetVar( $this->mAllowSpecialInclusion, $x ); }
281281 function setTidy( $x ) { return wfSetVar( $this->mTidy, $x ); }
 282+
 283+ /** @deprecated in 1.19; will be removed in 1.20 */
 284+ function setSkin( $x ) { wfDeprecated( __METHOD__, '1.19' ); }
282285 function setInterfaceMessage( $x ) { return wfSetVar( $this->mInterfaceMessage, $x ); }
283286 function setTargetLanguage( $x ) { return wfSetVar( $this->mTargetLanguage, $x, true ); }
284287 function setMaxIncludeSize( $x ) { return wfSetVar( $this->mMaxIncludeSize, $x ); }
Index: trunk/phase3/includes/Title.php
@@ -2129,6 +2129,34 @@
21302130 }
21312131
21322132 /**
 2133+ * Protect css subpages of user pages: can $wgUser edit
 2134+ * this page?
 2135+ *
 2136+ * @deprecated in 1.19; will be removed in 1.20. Use getUserPermissionsErrors() instead.
 2137+ * @return Bool
 2138+ */
 2139+ public function userCanEditCssSubpage() {
 2140+ global $wgUser;
 2141+ wfDeprecated( __METHOD__, '1.19' );
 2142+ return ( ( $wgUser->isAllowedAll( 'editusercssjs', 'editusercss' ) )
 2143+ || preg_match( '/^' . preg_quote( $wgUser->getName(), '/' ) . '\//', $this->mTextform ) );
 2144+ }
 2145+
 2146+ /**
 2147+ * Protect js subpages of user pages: can $wgUser edit
 2148+ * this page?
 2149+ *
 2150+ * @deprecated in 1.19; will be removed in 1.20. Use getUserPermissionsErrors() instead.
 2151+ * @return Bool
 2152+ */
 2153+ public function userCanEditJsSubpage() {
 2154+ global $wgUser;
 2155+ wfDeprecated( __METHOD__, '1.19' );
 2156+ return ( ( $wgUser->isAllowedAll( 'editusercssjs', 'edituserjs' ) )
 2157+ || preg_match( '/^' . preg_quote( $wgUser->getName(), '/' ) . '\//', $this->mTextform ) );
 2158+ }
 2159+
 2160+ /**
21332161 * Get a filtered list of all restriction types supported by this wiki.
21342162 * @param bool $exists True to get all restriction types that apply to
21352163 * titles that do exist, False for all restriction types that apply to
@@ -2204,6 +2232,29 @@
22052233 }
22062234
22072235 /**
 2236+ * Update the title protection status
 2237+ *
 2238+ * @deprecated in 1.19; will be removed in 1.20. Use WikiPage::doUpdateRestrictions() instead.
 2239+ * @param $create_perm String Permission required for creation
 2240+ * @param $reason String Reason for protection
 2241+ * @param $expiry String Expiry timestamp
 2242+ * @return boolean true
 2243+ */
 2244+ public function updateTitleProtection( $create_perm, $reason, $expiry ) {
 2245+ wfDeprecated( __METHOD__, '1.19' );
 2246+
 2247+ global $wgUser;
 2248+
 2249+ $limit = array( 'create' => $create_perm );
 2250+ $expiry = array( 'create' => $expiry );
 2251+
 2252+ $page = WikiPage::factory( $this );
 2253+ $status = $page->doUpdateRestrictions( $limit, $expiry, false, $reason, $wgUser );
 2254+
 2255+ return $status->isOK();
 2256+ }
 2257+
 2258+ /**
22082259 * Remove any title protection due to page existing
22092260 */
22102261 public function deleteTitleProtection() {
Index: trunk/phase3/includes/Preferences.php
@@ -1461,6 +1461,27 @@
14621462
14631463 return array( true, $info );
14641464 }
 1465+
 1466+ /**
 1467+ * @deprecated in 1.19; will be removed in 1.20.
 1468+ * @param $user User
 1469+ * @return array
 1470+ */
 1471+ public static function loadOldSearchNs( $user ) {
 1472+ wfDeprecated( __METHOD__, '1.19' );
 1473+
 1474+ $searchableNamespaces = SearchEngine::searchableNamespaces();
 1475+ // Back compat with old format
 1476+ $arr = array();
 1477+
 1478+ foreach ( $searchableNamespaces as $ns => $name ) {
 1479+ if ( $user->getOption( 'searchNs' . $ns ) ) {
 1480+ $arr[] = $ns;
 1481+ }
 1482+ }
 1483+
 1484+ return $arr;
 1485+ }
14651486 }
14661487
14671488 /** Some tweaks to allow js prefs to work */
Index: trunk/phase3/includes/FakeTitle.php
@@ -46,6 +46,7 @@
4747 function isNamespaceProtected( User $user ) { $this->error(); }
4848 function userCan( $action, $user = null, $doExpensiveQueries = true ) { $this->error(); }
4949 function getUserPermissionsErrors( $action, $user, $doExpensiveQueries = true, $ignoreErrors = array() ) { $this->error(); }
 50+ function updateTitleProtection( $create_perm, $reason, $expiry ) { $this->error(); }
5051 function deleteTitleProtection() { $this->error(); }
5152 function isMovable() { $this->error(); }
5253 function userCanRead() { $this->error(); }
@@ -58,6 +59,9 @@
5960 function getSkinFromCssJsSubpage() { $this->error(); }
6061 function isCssSubpage() { $this->error(); }
6162 function isJsSubpage() { $this->error(); }
 63+ function userCanEditCssJsSubpage() { $this->error(); }
 64+ function userCanEditCssSubpage() { $this->error(); }
 65+ function userCanEditJsSubpage() { $this->error(); }
6266 function isCascadeProtected() { $this->error(); }
6367 function getCascadeProtectionSources( $get_pages = true ) { $this->error(); }
6468 function areRestrictionsCascading() { $this->error(); }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111234Remove some methods marked for removal in 1.20 and update FakeTitle accordingly....ialex14:36, 11 February 2012

Status & tagging log