* @param $value Mixed
* @param $default Mixed
* @param $changed Array to alter
+ * @throws MWException
*/
function wfAppendToArrayIfNotDefault( $key, $value, $default, &$changed ) {
if ( is_null( $changed ) ) {
*
* @param $text String
* @param $file String filename
+ * @throws MWException
*/
function wfErrorLog( $text, $file ) {
if ( substr( $file, 0, 4 ) == 'udp:' ) {
/**
* Replace message parameter keys on the given formatted output.
*
- * @deprecated since 1.18
- *
* @param $message String
* @param $args Array
* @return string
* but now throws an exception instead, with similar results.
*
* @param $msg String: message shown when dying.
+ * @throws MWException
*/
function wfDebugDieBacktrace( $msg = '' ) {
throw new MWException( $msg );
/**
* Get a timestamp string in one of various formats
*
- * @deprecated
* @param $outputtype Mixed: A timestamp in one of the supported formats, the
* function will autodetect which format is supplied and act
* accordingly.
* @return Mixed: String / false The same date in the format specified in $outputtype or false
*/
function wfTimestamp( $outputtype = TS_UNIX, $ts = 0 ) {
- $timestamp = new MWTimestamp( $ts );
- return $timestamp->getTimestamp( $outputtype );
+ try {
+ $timestamp = new MWTimestamp( $ts );
+ return $timestamp->getTimestamp( $outputtype );
+ } catch( TimestampException $e ) {
+ wfDebug("wfTimestamp() fed bogus time value: TYPE=$outputtype; VALUE=$ts\n");
+ return false;
+ }
}
/**
* @param $dir String: full path to directory to create
* @param $mode Integer: chmod value to use, default is $wgDirectoryMode
* @param $caller String: optional caller param for debugging.
+ * @throws MWException
* @return bool
*/
function wfMkdirParents( $dir, $mode = null, $caller = null ) {
*
* @param $req_ver Mixed: the version to check, can be a string, an integer, or
* a float
+ * @throws MWException
*/
function wfUsePHP( $req_ver ) {
$php_ver = PHP_VERSION;
*
* @param $req_ver Mixed: the version to check, can be a string, an integer, or
* a float
+ * @throws MWException
*/
function wfUseMW( $req_ver ) {
global $wgVersion;
return $value ? 'true' : 'false';
}
-/**
- * Load an extension messages file
- *
- * @deprecated since 1.16, warnings in 1.18, remove in 1.20
- * @codeCoverageIgnore
- */
-function wfLoadExtensionMessages() {
- wfDeprecated( __FUNCTION__, '1.16' );
-}
-
/**
* Get a platform-independent path to the null file, e.g. /dev/null
*