function wfMkdirParents( $dir, $mode = null, $caller = null ) {
global $wgDirectoryMode;
+ if ( FileBackend::isStoragePath( $dir ) ) { // sanity
+ throw new MWException( __FUNCTION__ . " given storage path `$dir`.");
+ }
+
if ( !is_null( $caller ) ) {
wfDebug( "$caller: called wfMkdirParents($dir)\n" );
}
* Get an object referring to a locally registered file.
* Returns a valid placeholder object if the file does not exist.
*
- * @param $title Title or String
+ * @param $title Title|String
* @return File|null A File, or null if passed an invalid Title
*/
function wfLocalFile( $title ) {
*/
function wfDeprecated( $function, $version = false, $component = false ) {
static $functionsWarned = array();
-
- if ( !in_array( $function, $GLOBALS['wgDeprecationWhitelist'] ) && !isset( $functionsWarned[$function] ) ) {
+
+ MWDebug::deprecated( $function, $version, $component );
+
+ if ( !isset( $functionsWarned[$function] ) ) {
$functionsWarned[$function] = true;
if ( $version ) {
function wfWarn( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) {
global $wgDevelopmentWarnings;
+ MWDebug::warning( $msg, $callerOffset + 2 );
+
$callers = wfDebugBacktrace();
if ( isset( $callers[$callerOffset + 1] ) ) {
$callerfunc = $callers[$callerOffset + 1];
*
* @param $event String: event name
* @param $args Array: parameters passed to hook functions
- * @return Boolean
+ * @return Boolean True if no handler aborted the hook
*/
function wfRunHooks( $event, $args = array() ) {
return Hooks::run( $event, $args );