check_php_version.php

来自「一个基于web的rpg游戏源代码」· PHP 代码 · 共 49 行

PHP
49
字号
<?php/*** Netlands World Server is the coordinator of the VR in the Netlands Project* Copyright (C) 2002 Ricard Pillosu* * This program is free software; you can redistribute it and/or* modify 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.*//* vim: set expandtab tabstop=4 shiftwidth=4 */function check_php_version($php_version, $zend_version, $extensions_needed, &$message) {    // Check php compilation    $current_php_version = substr(phpversion(), 0, 5);    if(version_compare($current_php_version, $php_version) < 0) {        $message.= "\nSorry, you need at least php version $php_version\n";        return(FALSE);    }    $current_zend_version = substr(zend_version(), 0, 5);    if(version_compare($current_zend_version, $zend_version) < 0) {        $message.= "\nSorry, you need at least Zend Engine version $zend_version\n";        return(FALSE);    }    // Extensions needed    foreach($extensions_needed as $extension) {        if(!extension_loaded($extension)) {            if(!dl($extension)) {                $message.= "\nSorry, I need the '$extension' extension with PHP\n";                return(FALSE);            }        }    }    return(TRUE);}?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?