Example #1
0
/**
 * Check php version and that external dependencies are installed, and
 * display an informative error if either condition is not satisfied.
 *
 * @note Since we can't rely on anything, the minimum PHP versions and MW current
 * version are hardcoded here
 */
function wfEntryPointCheck($entryPoint)
{
    $mwVersion = '1.29';
    $minimumVersionPHP = '5.5.9';
    $phpVersion = PHP_VERSION;
    if (!function_exists('version_compare') || version_compare($phpVersion, $minimumVersionPHP) < 0) {
        wfPHPVersionError($entryPoint, $mwVersion, $minimumVersionPHP, $phpVersion);
    }
    // @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
    if (!file_exists(dirname(__FILE__) . '/../vendor/autoload.php')) {
        // @codingStandardsIgnoreEnd
        wfMissingVendorError($entryPoint, $mwVersion);
    }
    // List of functions and their associated PHP extension to check for
    // @codingStandardsIgnoreStart Generic.Arrays.DisallowLongArraySyntax
    $extensions = array('mb_substr' => 'mbstring', 'utf8_encode' => 'xml', 'ctype_digit' => 'ctype', 'json_decode' => 'json', 'iconv' => 'iconv');
    // List of extensions we're missing
    $missingExtensions = array();
    // @codingStandardsIgnoreEnd
    foreach ($extensions as $function => $extension) {
        if (!function_exists($function)) {
            $missingExtensions[] = $extension;
        }
    }
    if ($missingExtensions) {
        wfMissingExtensions($entryPoint, $mwVersion, $missingExtensions);
    }
}
Example #2
0
/**
 * Check php version and that external dependencies are installed, and
 * display an informative error if either condition is not satisfied.
 *
 * @note Since we can't rely on anything, the minimum PHP versions and MW current
 * version are hardcoded here
 */
function wfEntryPointCheck($entryPoint)
{
    $mwVersion = '1.27';
    $minimumVersionPHP = '5.3.3';
    $phpVersion = PHP_VERSION;
    if (!function_exists('version_compare') || version_compare($phpVersion, $minimumVersionPHP) < 0) {
        wfPHPVersionError($entryPoint, $mwVersion, $minimumVersionPHP, $phpVersion);
    }
    if (!file_exists(dirname(__FILE__) . '/../vendor/autoload.php')) {
        wfMissingVendorError($entryPoint, $mwVersion);
    }
}
Example #3
0
/**
 * Check php version and that external dependencies are installed, and
 * display an informative error if either condition is not satisfied.
 *
 * @note Since we can't rely on anything, the minimum PHP versions and MW current
 * version are hardcoded here
 */
function wfEntryPointCheck($entryPoint)
{
    $mwVersion = '1.27';
    $minimumVersionPHP = '5.3.3';
    $phpVersion = PHP_VERSION;
    if (!function_exists('version_compare') || version_compare($phpVersion, $minimumVersionPHP) < 0) {
        wfPHPVersionError($entryPoint, $mwVersion, $minimumVersionPHP, $phpVersion);
    }
    // @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
    if (!file_exists(dirname(__FILE__) . '/../vendor/autoload.php')) {
        // @codingStandardsIgnoreEnd
        wfMissingVendorError($entryPoint, $mwVersion);
    }
}
Example #4
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @file
 */
// So extensions (and other code) can check whether they're running in API mode
define('MW_API', true);
// Bail if PHP is too low
if (!function_exists('version_compare') || version_compare(PHP_VERSION, '5.3.2') < 0) {
    // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
    require dirname(__FILE__) . '/includes/PHPVersionError.php';
    wfPHPVersionError('api.php');
}
require __DIR__ . '/includes/WebStart.php';
wfProfileIn('api.php');
$starttime = microtime(true);
// URL safety checks
if (!$wgRequest->checkUrlExtension()) {
    return;
}
// Verify that the API has not been disabled
if (!$wgEnableAPI) {
    header($_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki configuration Error', true, 500);
    echo 'MediaWiki API is not enabled for this site. Add the following line to your LocalSettings.php' . '<pre><b>$wgEnableAPI=true;</b></pre>';
    die(1);
}
// Set a dummy $wgTitle, because $wgTitle == null breaks various things
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @file
 * @ingroup Maintenance
 * @defgroup Maintenance Maintenance
 */
// Make sure we're on PHP5.3.2 or better
if (!function_exists('version_compare') || version_compare(PHP_VERSION, '5.3.2') < 0) {
    // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
    require_once dirname(__FILE__) . '/../includes/PHPVersionError.php';
    wfPHPVersionError('cli');
}
/**
 * @defgroup MaintenanceArchive Maintenance archives
 * @ingroup Maintenance
 */
// Define this so scripts can easily find doMaintenance.php
define('RUN_MAINTENANCE_IF_MAIN', __DIR__ . '/doMaintenance.php');
define('DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN);
// original name, harmless
$maintClass = false;
/**
 * Abstract maintenance class for quickly writing and churning out
 * maintenance scripts with minimal effort. All that _must_ be defined
 * is the execute() method. See docs/maintenance.txt for more info
 * and a quick demo of how to use it.
Example #6
0
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @file
 */
# Bail on old versions of PHP.  Pretty much every other file in the codebase
# has structures (try/catch, foo()->bar(), etc etc) which throw parse errors in
# PHP 4. Setup.php and ObjectCache.php have structures invalid in PHP 5.0 and
# 5.1, respectively.
if (!function_exists('version_compare') || version_compare(phpversion(), '5.3.2') < 0) {
    // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
    require dirname(__FILE__) . '/includes/PHPVersionError.php';
    wfPHPVersionError('index.php');
}
# Initialise common code.  This gives us access to GlobalFunctions, the
# AutoLoader, and the globals $wgRequest, $wgOut, $wgUser, $wgLang and
# $wgContLang, amongst others; it does *not* load $wgTitle
require __DIR__ . '/includes/WebStart.php';
$mediaWiki = new MediaWiki();
$mediaWiki->run();
Example #7
0
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @file
 * @author Roan Kattouw
 * @author Trevor Parscal
 *
 */

// Bail if PHP is too low
if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.2.3' ) < 0 ) {
	require( dirname( __FILE__ ) . '/includes/PHPVersionError.php' );
	wfPHPVersionError( 'load.php' );
}

if ( isset( $_SERVER['MW_COMPILED'] ) ) {
	require ( 'phase3/includes/WebStart.php' );
} else {
	require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
}

// Construct a tag for newrelic -- wgRequest is global in this scope
if( function_exists( 'newrelic_name_transaction' ) ) {
	if ( function_exists( 'newrelic_disable_autorum') ) {
		newrelic_disable_autorum();
	}
	if (is_object($wgRequest)) {
		$sharedWiki = (preg_match("/^slot[0-9]\$/",$wgDBname) || $wgDBname == 'devbox') ? "shared" : "local";
Example #8
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @file
 */
// Bail if PHP is too low
if (!function_exists('version_compare') || version_compare(PHP_VERSION, '5.3.2') < 0) {
    // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
    require dirname(dirname(__FILE__)) . '/includes/PHPVersionError.php';
    wfPHPVersionError('mw-config/index.php');
}
define('MW_CONFIG_CALLBACK', 'Installer::overrideConfig');
define('MEDIAWIKI_INSTALL', true);
// Resolve relative to regular MediaWiki root
// instead of mw-config subdirectory.
chdir(dirname(__DIR__));
require dirname(__DIR__) . '/includes/WebStart.php';
wfInstallerMain();
function wfInstallerMain()
{
    global $wgRequest, $wgLang, $wgMetaNamespace, $wgCanonicalNamespaceNames;
    $installer = InstallerOverrides::getWebInstaller($wgRequest);
    if (!$installer->startSession()) {
        if ($installer->request->getVal("css")) {
            // Do not display errors on css pages
Example #9
0
/**
 * Check php version and that external dependencies are installed, and
 * display an informative error if either condition is not satisfied.
 */
function wfEntryPointCheck($entryPoint)
{
    if (!function_exists('version_compare') || version_compare(PHP_VERSION, '5.3.3') < 0 || !file_exists(dirname(__FILE__) . '/../vendor/autoload.php')) {
        wfPHPVersionError($entryPoint);
    }
}