Refactor diffs
[mediawiki.git] / includes / Init.php
blob64431f09a8931301a846b9a00556a13d4164533a
1 <?php
2 /**
3 * Some functions that are useful during startup.
5 * This class previously contained some functionality related to a PHP compiler
6 * called hphpc. That compiler has now been discontinued.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * http://www.gnu.org/copyleft/gpl.html
23 * @file
26 /**
27 * Some functions that are useful during startup.
29 * This class previously contained some functionality related to a PHP compiler
30 * called hphpc. That compiler has now been discontinued. All methods are now
31 * deprecated.
33 class MWInit {
34 static $compilerVersion;
36 /**
37 * @deprecated since 1.22
39 static function getCompilerVersion() {
40 return false;
43 /**
44 * Returns true if we are running under HipHop, whether in compiled or
45 * interpreted mode.
47 * @deprecated since 1.22
48 * @return bool
50 static function isHipHop() {
51 return defined( 'HPHP_VERSION' );
54 /**
55 * Get a fully-qualified path for a source file relative to $IP.
56 * @deprecated since 1.22
58 * @param $file string
60 * @return string
62 static function interpretedPath( $file ) {
63 global $IP;
64 return "$IP/$file";
67 /**
68 * @deprecated since 1.22
69 * @param $file string
70 * @return string
72 static function compiledPath( $file ) {
73 global $IP;
74 return "$IP/$file";
77 /**
78 * @deprecated since 1.22
79 * @param $file string
80 * @return string
82 static function extCompiledPath( $file ) {
83 return false;
86 /**
87 * Deprecated wrapper for class_exists()
88 * @deprecated since 1.22
90 * @param $class string
92 * @return bool
94 static function classExists( $class ) {
95 return class_exists( $class );
98 /**
99 * Deprecated wrapper for method_exists()
100 * @deprecated since 1.22
102 * @param $class string
103 * @param $method string
105 * @return bool
107 static function methodExists( $class, $method ) {
108 return method_exists( $class, $method );
112 * Deprecated wrapper for function_exists()
113 * @deprecated since 1.22
115 * @param $function string
117 * @return bool
119 static function functionExists( $function ) {
120 return function_exists( $function );
124 * Deprecated wrapper for call_user_func_array()
125 * @deprecated since 1.22
127 * @param $className string
128 * @param $methodName string
129 * @param $args array
131 * @return mixed
133 static function callStaticMethod( $className, $methodName, $args ) {
134 return call_user_func_array( array( $className, $methodName ), $args );