MediaWiki
REL1_19
|
Some functions that are useful during startup. More...
Static Public Member Functions | |
static | callStaticMethod ($className, $methodName, $args) |
Call a static method of a class with variable arguments without causing it to become volatile. | |
static | classExists ($class) |
Determine whether a class exists, using a method which works under HipHop. | |
static | compiledPath ($file) |
If we are running code compiled by HipHop, this will pass through the input path, assumed to be relative to $IP. | |
static | extCompiledPath ($file) |
The equivalent of MWInit::compiledPath() but for files relative to the extensions directory. | |
static | extInterpretedPath ($file) |
The equivalent of MWInit::interpretedPath() but for files relative to the extensions directory. | |
static | extSetupPath ($extRel) |
Register an extension setup file and return its path for compiled inclusion. | |
static | functionExists ($function) |
Determine whether a function exists, using a method which works under HipHop. | |
static | getCompilerVersion () |
Get the version of HipHop used to compile, or false if MediaWiki was not compiled. | |
static | getExtensionsDirectory () |
static | interpretedPath ($file) |
Get a fully-qualified path for a source file relative to $IP. | |
static | isHipHop () |
Returns true if we are running under HipHop, whether in compiled or interpreted mode. | |
static | methodExists ($class, $method) |
Determine wether a method exists within a class, using a method which works under HipHop. | |
Static Public Attributes | |
static | $compilerVersion |
static MWInit::callStaticMethod | ( | $ | className, |
$ | methodName, | ||
$ | args | ||
) | [static] |
Call a static method of a class with variable arguments without causing it to become volatile.
$className | string |
$methodName | string |
$args | array |
Definition at line 201 of file Init.php.
Referenced by FileRepo\newFatal().
static MWInit::classExists | ( | $ | class | ) | [static] |
Determine whether a class exists, using a method which works under HipHop.
Note that it's not possible to implement this with any variant of class_exists(), because class_exists() returns false for classes which are compiled in.
Calling class_exists() on a literal string causes the class to be made "volatile", which means (as of March 2011) that the class is broken and can't be used at all. So don't do that. See https://github.com/facebook/hiphop-php/issues/314
$class | string |
Definition at line 146 of file Init.php.
Referenced by FSFileBackendFileList\__construct(), MWTidy\execInternalTidy(), ExternalStore\getStoreObject(), Language\newFromCode(), Skin\newFromKey(), UserDupes\newSchema(), and Maintenance\runChild().
static MWInit::compiledPath | ( | $ | file | ) | [static] |
If we are running code compiled by HipHop, this will pass through the input path, assumed to be relative to $IP.
If the code is interpreted, it will converted to a fully qualified path. It is necessary to use a path which is relative to $IP in order to make HipHop use its compiled code.
$file | string |
Definition at line 60 of file Init.php.
References $IP.
static MWInit::extCompiledPath | ( | $ | file | ) | [static] |
The equivalent of MWInit::compiledPath() but for files relative to the extensions directory.
Any files referenced in this way must be registered for compilation by including them in $wgCompiledFiles.
$file | string |
Definition at line 88 of file Init.php.
References $file, and getExtensionsDirectory().
static MWInit::extInterpretedPath | ( | $ | file | ) | [static] |
The equivalent of MWInit::interpretedPath() but for files relative to the extensions directory.
$file | string |
Definition at line 77 of file Init.php.
References $file, and getExtensionsDirectory().
static MWInit::extSetupPath | ( | $ | extRel | ) | [static] |
Register an extension setup file and return its path for compiled inclusion.
Use this function in LocalSettings.php to add extensions to the build. For example:
require( MWInit::extSetupPath( 'ParserFunctions/ParserFunctions.php' ) );
$extRel | string The path relative to the extensions directory, as defined by $wgExtensionsDirectory. |
Definition at line 108 of file Init.php.
References $wgCompiledFiles, and getExtensionsDirectory().
static MWInit::functionExists | ( | $ | function | ) | [static] |
Determine whether a function exists, using a method which works under HipHop.
$function | string |
Definition at line 184 of file Init.php.
Referenced by ProfilerSimpleUDP\logData(), and Maintenance\posix_isatty().
static MWInit::getCompilerVersion | ( | ) | [static] |
Get the version of HipHop used to compile, or false if MediaWiki was not compiled.
This works by having our build script insert a special function into the compiled code.
Definition at line 14 of file Init.php.
References $compilerVersion.
static MWInit::getExtensionsDirectory | ( | ) | [static] |
Definition at line 122 of file Init.php.
References $IP, and $wgExtensionsDirectory.
Referenced by extCompiledPath(), extInterpretedPath(), and extSetupPath().
static MWInit::interpretedPath | ( | $ | file | ) | [static] |
static MWInit::isHipHop | ( | ) | [static] |
static MWInit::methodExists | ( | $ | class, |
$ | method | ||
) | [static] |
Determine wether a method exists within a class, using a method which works under HipHop.
Note that under HipHop when method_exists is given a string for it's class such as to test for a static method has the same issues as class_exists does.
$class | string |
$method | string |
MWInit::$compilerVersion [static] |
Definition at line 7 of file Init.php.
Referenced by getCompilerVersion().