(added in 1.13)
$status: Status object, modify this to throw an error. Overridden by $error
(added in 1.20)
+$suppress: Whether this is a suppression deletion or not (added in 1.27)
'ArticleDeleteAfterSuccess': Output after an article has been deleted.
$title: Title of the article that has been deleted.
* @return string
*/
function wfFormatStackFrame( $frame ) {
- return isset( $frame['class'] ) ?
- $frame['class'] . '::' . $frame['function'] :
+ if ( !isset( $frame['function'] ) ) {
+ return 'NO_FUNCTION_GIVEN';
+ }
+ return isset( $frame['class'] ) && isset( $frame['type'] ) ?
+ $frame['class'] . $frame['type'] . $frame['function'] :
$frame['function'];
}
* Deprecated for public use, use Title::makeTitle() with fragment parameter.
* Still in active use privately.
*
+ * @private
* @param string $fragment Text
*/
public function setFragment( $fragment ) {
}
}
+ /**
+ * Format a line
+ *
+ * @since 1.27
+ *
+ * @param RecentChange $rc Passed by reference
+ * @param bool $watched (default false)
+ * @param int $linenumber (default null)
+ *
+ * @return string|bool
+ */
+ public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
+ throw new RuntimeException( 'recentChangesLine should be implemented' );
+ }
+
/**
* Sets the list to use a "<li class='watchlist-(namespace)-(page)'>" tag
* @param bool $value
/**
* Format a line for enhanced recentchange (aka with javascript and block of lines).
*
- * @param RecentChange $baseRC
+ * @param RecentChange $rc
* @param bool $watched
+ * @param int $linenumber (default null)
*
* @return string
*/
- public function recentChangesLine( &$baseRC, $watched = false ) {
+ public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
$date = $this->getLanguage()->userDate(
- $baseRC->mAttribs['rc_timestamp'],
+ $rc->mAttribs['rc_timestamp'],
$this->getUser()
);
$this->lastdate = $date;
}
- $cacheEntry = $this->cacheEntryFactory->newFromRecentChange( $baseRC, $watched );
+ $cacheEntry = $this->cacheEntryFactory->newFromRecentChange( $rc, $watched );
$this->addCacheEntry( $cacheEntry );
return $ret;
$sql = mb_convert_encoding( $sql, 'UTF-8' );
}
// Clear previously left over PQresult
- while ( $res = pg_get_result( $this->mConn ) )
+ while ( $res = pg_get_result( $this->mConn ) ) {
pg_free_result( $res );
+ }
if ( pg_send_query( $this->mConn, $sql ) === false ) {
throw new DBUnexpectedError( $this, "Unable to post new query to PostgreSQL\n" );
}
}
$x1 = $xoff + (int)( ( $numer + ( $xlim - $xoff ) * $chunk ) / $nchunks );
- // @codingStandardsIgnoreFile Ignore Squiz.WhiteSpace.SemicolonSpacing.Incorrect
+ // @codingStandardsIgnoreStart Ignore Squiz.WhiteSpace.SemicolonSpacing.Incorrect
for ( ; $x < $x1; $x++ ) {
// @codingStandardsIgnoreEnd
$line = $flip ? $this->yv[$x] : $this->xv[$x];
if ( $y > $this->seq[$k - 1] ) {
assert( '$y < $this->seq[$k]' );
// Optimization: this is a common case:
- // next match is just replacing previous match.
+ // next match is just replacing previous match.
$this->in_seq[$this->seq[$k]] = false;
$this->seq[$k] = $y;
$this->in_seq[$y] = 1;
$text .= "{$pad}#{$level} [internal function]: ";
}
- if ( isset( $frame['class'] ) ) {
+ if ( isset( $frame['class'] ) && isset( $frame['type'] ) && isset( $frame['function'] ) ) {
$text .= $frame['class'] . $frame['type'] . $frame['function'];
- } else {
+ } elseif ( isset( $frame['function'] ) ) {
$text .= $frame['function'];
+ } else {
+ $text .= 'NO_FUNCTION_GIVEN';
}
if ( isset( $frame['args'] ) ) {
application/x-tar [ARCHIVE]
application/x-stuffit [ARCHIVE]
application/x-opc+zip [ARCHIVE]
-
+application/x-7z-compressed [ARCHIVE]
text/javascript application/x-javascript application/x-ecmascript text/ecmascript [EXECUTABLE]
application/x-bash [EXECUTABLE]
application/vnd.wap.wmlc wmlc
application/vnd.wap.wmlscriptc wmlsc
application/voicexml+xml vxml
+application/x-7z-compressed 7z
application/x-bcpio bcpio
application/x-bzip bz
application/x-bzip2 bz2
$user = is_null( $user ) ? $wgUser : $user;
if ( !Hooks::run( 'ArticleDelete',
- array( &$this, &$user, &$reason, &$error, &$status )
+ array( &$this, &$user, &$reason, &$error, &$status, $suppress )
) ) {
if ( $status->isOK() ) {
// Hook aborted but didn't set a fatal status
return true;
}
- // Dumb stuff to run a mode.
+ /**
+ * Dumb stuff to run a mode.
+ */
public function run() {
if ( !$this->mReady ) {
return false;
return true;
}
- #
- # Modes.
- #
-
- /** List default options and their value */
+ /**
+ * List default options and their value
+ */
private function LISTER() {
$def = User::getDefaultOptions();
ksort( $def );
}
}
- /** List options usage */
+ /**
+ * List options usage
+ */
private function USAGER() {
$ret = array();
$defaultOptions = User::getDefaultOptions();
}
}
- /** Change our users options */
+ /**
+ * Change our users options
+ */
private function CHANGER() {
$this->warn();
return $ret;
}
- #
- # Helper methods
- #
-
public static function showUsageAndExit() {
print <<<USAGE
// if you hack it just right are kinda pathological,
// and unreliable cross-platform or on IE which means they're
// unlikely to appear on intranets.
- //
// Those will survive the algorithm but with results that
// are less consistent.
*/
class WfGetCallerTest extends MediaWikiTestCase {
public function testZero() {
- $this->assertEquals( __METHOD__, wfGetCaller( 1 ) );
+ $this->assertEquals( 'WfGetCallerTest->testZero', wfGetCaller( 1 ) );
}
function callerOne() {
}
public function testOne() {
- $this->assertEquals( 'WfGetCallerTest::testOne', self::callerOne() );
+ $this->assertEquals( 'WfGetCallerTest->testOne', self::callerOne() );
}
- function intermediateFunction( $level = 2, $n = 0 ) {
+ static function intermediateFunction( $level = 2, $n = 0 ) {
if ( $n > 0 ) {
return self::intermediateFunction( $level, $n - 1 );
}
}
public function testTwo() {
- $this->assertEquals( 'WfGetCallerTest::testTwo', self::intermediateFunction() );
+ $this->assertEquals( 'WfGetCallerTest->testTwo', self::intermediateFunction() );
}
public function testN() {
- $this->assertEquals( 'WfGetCallerTest::testN', self::intermediateFunction( 2, 0 ) );
+ $this->assertEquals( 'WfGetCallerTest->testN', self::intermediateFunction( 2, 0 ) );
$this->assertEquals(
'WfGetCallerTest::intermediateFunction',
self::intermediateFunction( 1, 0 )
array( array(
'msg' => 'logging a string',
'type' => 'log',
- 'caller' => __METHOD__,
+ 'caller' => 'MWDebugTest->testAddLog',
) ),
MWDebug::getLog()
);