/**
 * 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);
    }
}
/**
 * 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);
    }
}
Exemple #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);
    }
}