コード例 #1
0
ファイル: install.php プロジェクト: ravenlife/Ninja-Framework
 /**
  * This function is required by JInstallerComponent in order to run this script
  *
  * @return	boolean	true
  */
 function com_install()
 {
     static $installable;
     if (isset($installable)) {
         return $installable;
     }
     $db = JFactory::getDBO();
     //Run check on the minimum required server specs. Will roll back install if any check fails
     foreach (array(class_exists('mysqli') => "Your server don't have MySQLi.", version_compare(phpversion(), '5.2', '>=') => "Your PHP version is older than 5.2.", version_compare($db->getVersion(), '5.0.41', '>=') => "Your MySQL server version is older than 5.0.41.") as $succeed => $fail) {
         if (!$succeed) {
             JError::raiseWarning(0, $fail);
             return $installable = false;
         }
     }
     if (extension_loaded('suhosin')) {
         //Attempt setting the whitelist value
         @ini_set('suhosin.executor.include.whitelist', 'tmpl://, file://');
         //Checking if the whitelist is ok
         if (!@ini_get('suhosin.executor.include.whitelist') || strpos(@ini_get('suhosin.executor.include.whitelist'), 'tmpl://') === false) {
             JError::raiseWarning(0, sprintf(JText::_('The install failed because your server has Suhosin loaded, but it\'s not configured correctly. Please follow <a href="%s" target="_blank">this</a> tutorial before you reinstall.'), 'https://nooku.assembla.com/wiki/show/nooku-framework/Known_Issues'));
             return $installable = false;
         }
     }
     if (version_compare('5.3', phpversion(), '<=') && extension_loaded('ionCube Loader')) {
         if (ioncube_loader_iversion() < 40002) {
             JError::raiseWarning(0, sprintf(JText::_('Your server is affected by a bug in ionCube Loader for PHP 5.3 that causes our template layout parsing to fail. Please update to a version later than ionCube Loader 4.0 (your server is %s) before reinstalling.'), ioncube_loader_version()));
             return $installable = false;
         }
     }
     return $installable = true;
 }
コード例 #2
0
ファイル: zoomInc.inc.php プロジェクト: hevelmo/templates
function getIonCubeVersion()
{
    if (function_exists('ioncube_loader_iversion')) {
        $liv = ioncube_loader_iversion();
        $lv = sprintf("%d.%d.%d", $liv / 10000, $liv / 100 % 100, $liv % 100);
        return $lv;
    } else {
        return '';
    }
}
コード例 #3
0
ファイル: general.php プロジェクト: abhiesa-tolexo/loaded7
function ioncube_loader_version_array()
{
    if (function_exists('ioncube_loader_iversion')) {
        $ioncube_loader_iversion = ioncube_loader_iversion();
        $ioncube_loader_version_major = (int) substr($ioncube_loader_iversion, 0, 1);
        $ioncube_loader_version_minor = (int) substr($ioncube_loader_iversion, 1, 2);
        $ioncube_loader_version_revision = (int) substr($ioncube_loader_iversion, 3, 2);
        $ioncube_loader_version = "{$ioncube_loader_version_major}.{$ioncube_loader_version_minor}.{$ioncube_loader_version_revision}";
    } else {
        $ioncube_loader_version = ioncube_loader_version();
        $ioncube_loader_version_major = (int) substr($ioncube_loader_version, 0, 1);
        $ioncube_loader_version_minor = (int) substr($ioncube_loader_version, 2, 1);
    }
    return array('version' => $ioncube_loader_version, 'major' => $ioncube_loader_version_major, 'minor' => $ioncube_loader_version_minor);
}
コード例 #4
0
ファイル: loader-wizard.php プロジェクト: NeformatDev/v2
function ioncube_loader_version_information()
{
    $old_version = true;
    $liv = "";
    if (function_exists('ioncube_loader_iversion')) {
        $liv = ioncube_loader_iversion();
        $lv = sprintf("%d.%d.%d", $liv / 10000, $liv / 100 % 100, $liv % 100);
        if ($liv >= get_latestversion()) {
            $old_version = false;
        }
    }
    return array($lv, $old_version);
}
コード例 #5
0
</td>
  </tr>
  <tr>
    <td>eAccelerator</td>
    <td><?php 
if (phpversion('eAccelerator') != '') {
    echo phpversion('eAccelerator');
} else {
    echo "<font color=red>×</font>";
}
?>
</td>
    <td>ioncube</td>
    <td><?php 
if (extension_loaded('ionCube Loader')) {
    $ys = ioncube_loader_iversion();
    $gm = "." . (int) substr($ys, 3, 2);
    echo ionCube_Loader_version() . $gm;
} else {
    echo "<font color=red>×</font>";
}
?>
</td>
  </tr>
  <tr>
    <td>XCache</td>
    <td><?php 
if (phpversion('XCache') != '') {
    echo phpversion('XCache');
} else {
    echo "<font color=red>×</font>";
コード例 #6
0
ファイル: DiagnoseCommand.php プロジェクト: Flesh192/magento
 private function checkPlatform()
 {
     $output = '';
     $out = function ($msg, $style) use(&$output) {
         $output .= '<' . $style . '>' . $msg . '</' . $style . '>' . PHP_EOL;
     };
     // code below taken from getcomposer.org/installer, any changes should be made there and replicated here
     $errors = array();
     $warnings = array();
     $iniPath = php_ini_loaded_file();
     $displayIniMessage = false;
     if ($iniPath) {
         $iniMessage = PHP_EOL . PHP_EOL . 'The php.ini used by your command-line PHP is: ' . $iniPath;
     } else {
         $iniMessage = PHP_EOL . PHP_EOL . 'A php.ini file does not exist. You will have to create one.';
     }
     $iniMessage .= PHP_EOL . 'If you can not modify the ini file, you can also run `php -d option=value` to modify ini values on the fly. You can use -d multiple times.';
     if (!function_exists('json_decode')) {
         $errors['json'] = true;
     }
     if (!extension_loaded('Phar')) {
         $errors['phar'] = true;
     }
     if (!extension_loaded('filter')) {
         $errors['filter'] = true;
     }
     if (!extension_loaded('hash')) {
         $errors['hash'] = true;
     }
     if (!extension_loaded('ctype')) {
         $errors['ctype'] = true;
     }
     if (!ini_get('allow_url_fopen')) {
         $errors['allow_url_fopen'] = true;
     }
     if (extension_loaded('ionCube Loader') && ioncube_loader_iversion() < 40009) {
         $errors['ioncube'] = ioncube_loader_version();
     }
     if (version_compare(PHP_VERSION, '5.3.2', '<')) {
         $errors['php'] = PHP_VERSION;
     }
     if (!isset($errors['php']) && version_compare(PHP_VERSION, '5.3.4', '<')) {
         $warnings['php'] = PHP_VERSION;
     }
     if (!extension_loaded('openssl')) {
         $errors['openssl'] = true;
     }
     if (!defined('HHVM_VERSION') && !extension_loaded('apcu') && ini_get('apc.enable_cli')) {
         $warnings['apc_cli'] = true;
     }
     ob_start();
     phpinfo(INFO_GENERAL);
     $phpinfo = ob_get_clean();
     if (preg_match('{Configure Command(?: *</td><td class="v">| *=> *)(.*?)(?:</td>|$)}m', $phpinfo, $match)) {
         $configure = $match[1];
         if (false !== strpos($configure, '--enable-sigchild')) {
             $warnings['sigchild'] = true;
         }
         if (false !== strpos($configure, '--with-curlwrappers')) {
             $warnings['curlwrappers'] = true;
         }
     }
     if (ini_get('xdebug.profiler_enabled')) {
         $warnings['xdebug_profile'] = true;
     } elseif (extension_loaded('xdebug')) {
         $warnings['xdebug_loaded'] = true;
     }
     if (!empty($errors)) {
         foreach ($errors as $error => $current) {
             switch ($error) {
                 case 'json':
                     $text = PHP_EOL . "The json extension is missing." . PHP_EOL;
                     $text .= "Install it or recompile php without --disable-json";
                     break;
                 case 'phar':
                     $text = PHP_EOL . "The phar extension is missing." . PHP_EOL;
                     $text .= "Install it or recompile php without --disable-phar";
                     break;
                 case 'filter':
                     $text = PHP_EOL . "The filter extension is missing." . PHP_EOL;
                     $text .= "Install it or recompile php without --disable-filter";
                     break;
                 case 'hash':
                     $text = PHP_EOL . "The hash extension is missing." . PHP_EOL;
                     $text .= "Install it or recompile php without --disable-hash";
                     break;
                 case 'ctype':
                     $text = PHP_EOL . "The ctype extension is missing." . PHP_EOL;
                     $text .= "Install it or recompile php without --disable-ctype";
                     break;
                 case 'unicode':
                     $text = PHP_EOL . "The detect_unicode setting must be disabled." . PHP_EOL;
                     $text .= "Add the following to the end of your `php.ini`:" . PHP_EOL;
                     $text .= "    detect_unicode = Off";
                     $displayIniMessage = true;
                     break;
                 case 'suhosin':
                     $text = PHP_EOL . "The suhosin.executor.include.whitelist setting is incorrect." . PHP_EOL;
                     $text .= "Add the following to the end of your `php.ini` or suhosin.ini (Example path [for Debian]: /etc/php5/cli/conf.d/suhosin.ini):" . PHP_EOL;
                     $text .= "    suhosin.executor.include.whitelist = phar " . $current;
                     $displayIniMessage = true;
                     break;
                 case 'php':
                     $text = PHP_EOL . "Your PHP ({$current}) is too old, you must upgrade to PHP 5.3.2 or higher.";
                     break;
                 case 'allow_url_fopen':
                     $text = PHP_EOL . "The allow_url_fopen setting is incorrect." . PHP_EOL;
                     $text .= "Add the following to the end of your `php.ini`:" . PHP_EOL;
                     $text .= "    allow_url_fopen = On";
                     $displayIniMessage = true;
                     break;
                 case 'ioncube':
                     $text = PHP_EOL . "Your ionCube Loader extension ({$current}) is incompatible with Phar files." . PHP_EOL;
                     $text .= "Upgrade to ionCube 4.0.9 or higher or remove this line (path may be different) from your `php.ini` to disable it:" . PHP_EOL;
                     $text .= "    zend_extension = /usr/lib/php5/20090626+lfs/ioncube_loader_lin_5.3.so";
                     $displayIniMessage = true;
                     break;
                 case 'openssl':
                     $text = PHP_EOL . "The openssl extension is missing, which means that secure HTTPS transfers are impossible." . PHP_EOL;
                     $text .= "If possible you should enable it or recompile php with --with-openssl";
                     break;
             }
             $out($text, 'error');
         }
         $output .= PHP_EOL;
     }
     if (!empty($warnings)) {
         foreach ($warnings as $warning => $current) {
             switch ($warning) {
                 case 'apc_cli':
                     $text = "The apc.enable_cli setting is incorrect." . PHP_EOL;
                     $text .= "Add the following to the end of your `php.ini`:" . PHP_EOL;
                     $text .= "  apc.enable_cli = Off";
                     $displayIniMessage = true;
                     break;
                 case 'sigchild':
                     $text = "PHP was compiled with --enable-sigchild which can cause issues on some platforms." . PHP_EOL;
                     $text .= "Recompile it without this flag if possible, see also:" . PHP_EOL;
                     $text .= "  https://bugs.php.net/bug.php?id=22999";
                     break;
                 case 'curlwrappers':
                     $text = "PHP was compiled with --with-curlwrappers which will cause issues with HTTP authentication and GitHub." . PHP_EOL;
                     $text .= " Recompile it without this flag if possible";
                     break;
                 case 'php':
                     $text = "Your PHP ({$current}) is quite old, upgrading to PHP 5.3.4 or higher is recommended." . PHP_EOL;
                     $text .= " Composer works with 5.3.2+ for most people, but there might be edge case issues.";
                     break;
                 case 'xdebug_loaded':
                     $text = "The xdebug extension is loaded, this can slow down Composer a little." . PHP_EOL;
                     $text .= " Disabling it when using Composer is recommended.";
                     break;
                 case 'xdebug_profile':
                     $text = "The xdebug.profiler_enabled setting is enabled, this can slow down Composer a lot." . PHP_EOL;
                     $text .= "Add the following to the end of your `php.ini` to disable it:" . PHP_EOL;
                     $text .= "  xdebug.profiler_enabled = 0";
                     $displayIniMessage = true;
                     break;
             }
             $out($text, 'comment');
         }
     }
     if ($displayIniMessage) {
         $out($iniMessage, 'comment');
     }
     return !$warnings && !$errors ? true : $output;
 }
コード例 #7
0
ファイル: installer.php プロジェクト: rawphp/slicer
function checkPlatform($quiet, $disableTls)
{
    $errors = [];
    $warnings = [];
    $iniPath = php_ini_loaded_file();
    $displayIniMessage = FALSE;
    if ($iniPath) {
        $iniMessage = PHP_EOL . PHP_EOL . 'The php.ini used by your command-line PHP is: ' . $iniPath;
    } else {
        $iniMessage = PHP_EOL . PHP_EOL . 'A php.ini file does not exist. You will have to create one.';
    }
    $iniMessage .= PHP_EOL . 'If you can not modify the ini file, you can also run `php -d option=value` to modify ini values on the fly. You can use -d multiple times.';
    if (ini_get('detect_unicode')) {
        $errors['unicode'] = 'On';
    }
    if (extension_loaded('suhosin')) {
        $suhosin = ini_get('suhosin.executor.include.whitelist');
        $suhosinBlacklist = ini_get('suhosin.executor.include.blacklist');
        if (FALSE === stripos($suhosin, 'phar') && (!$suhosinBlacklist || FALSE !== stripos($suhosinBlacklist, 'phar'))) {
            $errors['suhosin'] = $suhosin;
        }
    }
    if (!function_exists('json_decode')) {
        $errors['json'] = TRUE;
    }
    if (!extension_loaded('Phar')) {
        $errors['phar'] = TRUE;
    }
    if (!extension_loaded('filter')) {
        $errors['filter'] = TRUE;
    }
    if (!extension_loaded('hash')) {
        $errors['hash'] = TRUE;
    }
    if (!ini_get('allow_url_fopen')) {
        $errors['allow_url_fopen'] = TRUE;
    }
    if (extension_loaded('ionCube Loader') && ioncube_loader_iversion() < 40009) {
        $errors['ioncube'] = ioncube_loader_version();
    }
    if (version_compare(PHP_VERSION, '5.3.2', '<')) {
        $errors['php'] = PHP_VERSION;
    }
    if (version_compare(PHP_VERSION, '5.3.4', '<')) {
        $warnings['php'] = PHP_VERSION;
    }
    if (!extension_loaded('openssl') && TRUE === $disableTls) {
        $warnings['openssl'] = TRUE;
    } elseif (!extension_loaded('openssl')) {
        $errors['openssl'] = TRUE;
    }
    if (!defined('HHVM_VERSION') && !extension_loaded('apcu') && ini_get('apc.enable_cli')) {
        $warnings['apc_cli'] = TRUE;
    }
    ob_start();
    phpinfo(INFO_GENERAL);
    $phpinfo = ob_get_clean();
    if (preg_match('{Configure Command(?: *</td><td class="v">| *=> *)(.*?)(?:</td>|$)}m', $phpinfo, $match)) {
        $configure = $match[1];
        if (FALSE !== strpos($configure, '--enable-sigchild')) {
            $warnings['sigchild'] = TRUE;
        }
        if (FALSE !== strpos($configure, '--with-curlwrappers')) {
            $warnings['curlwrappers'] = TRUE;
        }
    }
    if (!empty($errors)) {
        out("Some settings on your machine make Composer unable to work properly.", 'error');
        out('Make sure that you fix the issues listed below and run this script again:', 'error');
        foreach ($errors as $error => $current) {
            switch ($error) {
                case 'json':
                    $text = PHP_EOL . "The json extension is missing." . PHP_EOL;
                    $text .= "Install it or recompile php without --disable-json";
                    break;
                case 'phar':
                    $text = PHP_EOL . "The phar extension is missing." . PHP_EOL;
                    $text .= "Install it or recompile php without --disable-phar";
                    break;
                case 'filter':
                    $text = PHP_EOL . "The filter extension is missing." . PHP_EOL;
                    $text .= "Install it or recompile php without --disable-filter";
                    break;
                case 'hash':
                    $text = PHP_EOL . "The hash extension is missing." . PHP_EOL;
                    $text .= "Install it or recompile php without --disable-hash";
                    break;
                case 'unicode':
                    $text = PHP_EOL . "The detect_unicode setting must be disabled." . PHP_EOL;
                    $text .= "Add the following to the end of your `php.ini`:" . PHP_EOL;
                    $text .= "    detect_unicode = Off";
                    $displayIniMessage = TRUE;
                    break;
                case 'suhosin':
                    $text = PHP_EOL . "The suhosin.executor.include.whitelist setting is incorrect." . PHP_EOL;
                    $text .= "Add the following to the end of your `php.ini` or suhosin.ini (Example path [for Debian]: /etc/php5/cli/conf.d/suhosin.ini):" . PHP_EOL;
                    $text .= "    suhosin.executor.include.whitelist = phar " . $current;
                    $displayIniMessage = TRUE;
                    break;
                case 'php':
                    $text = PHP_EOL . "Your PHP ({$current}) is too old, you must upgrade to PHP 5.3.2 or higher.";
                    break;
                case 'allow_url_fopen':
                    $text = PHP_EOL . "The allow_url_fopen setting is incorrect." . PHP_EOL;
                    $text .= "Add the following to the end of your `php.ini`:" . PHP_EOL;
                    $text .= "    allow_url_fopen = On";
                    $displayIniMessage = TRUE;
                    break;
                case 'ioncube':
                    $text = PHP_EOL . "Your ionCube Loader extension ({$current}) is incompatible with Phar files." . PHP_EOL;
                    $text .= "Upgrade to ionCube 4.0.9 or higher or remove this line (path may be different) from your `php.ini` to disable it:" . PHP_EOL;
                    $text .= "    zend_extension = /usr/lib/php5/20090626+lfs/ioncube_loader_lin_5.3.so";
                    $displayIniMessage = TRUE;
                    break;
                case 'openssl':
                    $text = PHP_EOL . "The openssl extension is missing, which means that secure HTTPS transfers are impossible." . PHP_EOL;
                    $text .= "If possible you should enable it or recompile php with --with-openssl";
                    break;
            }
            if ($displayIniMessage) {
                $text .= $iniMessage;
            }
            out($text, 'info');
        }
        out('');
        return FALSE;
    }
    if (!empty($warnings)) {
        out("Some settings on your machine may cause stability issues with Composer.", 'error');
        out('If you encounter issues, try to change the following:', 'error');
        foreach ($warnings as $warning => $current) {
            switch ($warning) {
                case 'apc_cli':
                    $text = PHP_EOL . "The apc.enable_cli setting is incorrect." . PHP_EOL;
                    $text .= "Add the following to the end of your `php.ini`:" . PHP_EOL;
                    $text .= "    apc.enable_cli = Off";
                    $displayIniMessage = TRUE;
                    break;
                case 'sigchild':
                    $text = PHP_EOL . "PHP was compiled with --enable-sigchild which can cause issues on some platforms." . PHP_EOL;
                    $text .= "Recompile it without this flag if possible, see also:" . PHP_EOL;
                    $text .= "    https://bugs.php.net/bug.php?id=22999";
                    break;
                case 'curlwrappers':
                    $text = PHP_EOL . "PHP was compiled with --with-curlwrappers which will cause issues with HTTP authentication and GitHub." . PHP_EOL;
                    $text .= "Recompile it without this flag if possible";
                    break;
                case 'openssl':
                    $text = PHP_EOL . "The openssl extension is missing, which means that secure HTTPS transfers are impossible." . PHP_EOL;
                    $text .= "If possible you should enable it or recompile php with --with-openssl";
                    break;
                case 'php':
                    $text = PHP_EOL . "Your PHP ({$current}) is quite old, upgrading to PHP 5.3.4 or higher is recommended." . PHP_EOL;
                    $text .= "Composer works with 5.3.2+ for most people, but there might be edge case issues.";
                    break;
            }
            if ($displayIniMessage) {
                $text .= $iniMessage;
            }
            out($text, 'info');
        }
        out('');
        return TRUE;
    }
    if (!$quiet) {
        out("All settings correct for using Slicer", 'success');
    }
    return TRUE;
}
コード例 #8
0
function ioncube_loader_version_information()
{
    $old_version = true;
    $liv = "";
    $lv = "";
    $mv = 0;
    if (function_exists('ioncube_loader_iversion')) {
        $liv = ioncube_loader_iversion();
        $lv = sprintf("%d.%d.%d", $liv / 10000, $liv / 100 % 100, $liv % 100);
        $latest_version = get_latestversion();
        $lat_parts = explode('.', $latest_version);
        $cur_parts = explode('.', $lv);
        if ($cur_parts[0] > $lat_parts[0] || $cur_parts[0] == $lat_parts[0] && $cur_parts[1] > $lat_parts[1] || $cur_parts[0] == $lat_parts[0] && $cur_parts[1] == $lat_parts[1] && $cur_parts[2] >= $lat_parts[2]) {
            $old_version = false;
        } else {
            $old_version = $latest_version;
        }
        $mv = $cur_parts[0];
    }
    return array($lv, $mv, $old_version);
}
コード例 #9
0
     _e('Zend Optimizer+ Extension is Loaded and Enabled', 'bulletproof-security');
 }
 if (extension_loaded('Zend Optimizer')) {
     _e('Zend Optimizer Extension is Loaded', 'bulletproof-security');
 }
 if (extension_loaded('Zend Guard Loader')) {
     _e('Zend Guard Loader Extension is Loaded', 'bulletproof-security');
 } else {
     if (!extension_loaded('Zend Optimizer+') && !extension_loaded('Zend Optimizer') && !extension_loaded('Zend Guard Loader')) {
         _e('A Zend Extension is Not Loaded', 'bulletproof-security');
     }
 }
 echo '</strong><br>';
 echo __('ionCube Loader', 'bulletproof-security') . ': <strong>';
 if (extension_loaded('IonCube Loader') && function_exists('ioncube_loader_iversion')) {
     echo __('ionCube Loader Extension is Loaded ', 'bulletproof-security') . __('Version: ', 'bulletproof-security') . ioncube_loader_iversion();
 } else {
     echo __('ionCube Loader Extension is Not Loaded', 'bulletproof-security');
 }
 echo '</strong><br>';
 echo __('Suhosin', 'bulletproof-security') . ': <strong>';
 $bpsconstants = get_defined_constants();
 if (isset($bpsconstants['SUHOSIN_PATCH']) && $bpsconstants['SUHOSIN_PATCH'] == 1) {
     _e('The Suhosin-Patch is installed', 'bulletproof-security');
 }
 if (extension_loaded('suhosin')) {
     _e('Suhosin-Extension is Loaded', 'bulletproof-security');
 } else {
     if (!isset($bpsconstants['SUHOSIN_PATCH']) && @$bpsconstants['SUHOSIN_PATCH'] != 1 && !extension_loaded('suhosin')) {
         _e('Suhosin is Not Installed|Loaded', 'bulletproof-security');
     }
コード例 #10
0
ファイル: ninja.php プロジェクト: ravenlife/Ninja-Framework
    return $notify($condition, $message);
}
if (!version_compare(phpversion(), '5.2', '>=')) {
    $message = JText::_('%s does not support PHP %s. The minimum requirement is PHP 5.2 or later.');
    $message = sprintf($message, $extension_name, phpversion());
    $condition = $user->authorize('com_config', 'manage');
    return $notify($condition, $message);
}
if (!class_exists('mysqli')) {
    $message = JText::_('%s needs the MySQLi (MySQL improved) PHP extension enabled in order to connect with your MySQL database server. MySQLi gives access to security and performance features in MySQL server 4.1 and higher.');
    $message = sprintf($message, $extension_name);
    $condition = $user->authorize('com_config', 'manage');
    return $notify($condition, $message);
}
if (version_compare('5.3', phpversion(), '<=') && extension_loaded('ionCube Loader')) {
    if (ioncube_loader_iversion() < 40002) {
        $message = JText::_('Your server is affected by a bug in ionCube Loader for PHP 5.3 that causes our template layout parsing to fail. Please update to a version later than ionCube Loader 4.0 (your server is %s) before using %s.');
        $message = sprintf($message, ioncube_loader_version(), $extension_name);
        $condition = $user->authorize('com_config', 'manage');
        //Don't return this one, in case the site still works with ionCube loader present
        $notify($condition, $message);
    }
}
// Check if Koowa is active
if (JFactory::getApplication()->getCfg('dbtype') != 'mysqli') {
    $conf = JFactory::getConfig();
    $path = JPATH_CONFIGURATION . DS . 'configuration.php';
    if (JFile::exists($path)) {
        JPath::setPermissions($path, '0644');
        $search = JFile::read($path);
        $replace = str_replace('var $dbtype = \'mysql\';', 'var $dbtype = \'mysqli\';', $search);
コード例 #11
0
 /**
  *	Private: Check ionCube Version
  *
  *	@param	string	ionCube minimum version
  *	@return	boolean
  */
 private function loadCheckionCubeVersion($version)
 {
     if (function_exists("ioncube_loader_iversion")) {
         $ic_iversion = ioncube_loader_iversion();
         $ic_version = sprintf("%d.%d.%d", $ic_iversion / 10000, $ic_iversion / 100 % 100, $ic_iversion % 100);
         return version_compare($ic_version, $version, ">=");
     } else {
         return "0.0.0";
     }
 }
コード例 #12
0
ファイル: tz.php プロジェクト: noikiy/mdwp
<!--服务器相关参数-->

<table>

  <tr><th colspan="4">服务器参数</th></tr>

  <tr>

    <td>服务器域名/IP地址</td>

    <td colspan="3"><?php echo @get_current_user();?> - <?php echo $_SERVER['SERVER_NAME'];?>(<?php if('/'==DIRECTORY_SEPARATOR){echo $_SERVER['SERVER_ADDR'];}else{echo @gethostbyname($_SERVER['SERVER_NAME']);} ?>)&nbsp;&nbsp;你的IP地址是:<?php echo @$_SERVER['REMOTE_ADDR'];?></td>

  </tr>

  <tr>

    <td>服务器标识</td>

    <td colspan="3"><?php if($sysInfo['win_n'] != ''){echo $sysInfo['win_n'];}else{echo @php_uname();};?></td>

  </tr>

  <tr>

    <td width="13%">服务器操作系统</td>

    <td width="37%"><?php $os = explode(" ", php_uname()); echo $os[0];?> &nbsp;内核版本:<?php if('/'==DIRECTORY_SEPARATOR){echo $os[2];}else{echo $os[1];} ?></td>

    <td width="13%">服务器解译引擎</td>

    <td width="37%"><?php echo $_SERVER['SERVER_SOFTWARE'];?></td>
コード例 #13
0
ファイル: composer-setup.php プロジェクト: hisambahaa/DARES
/**
 * Checks platform configuration for common incompatibility issues
 *
 * @param array $errors Populated by method
 * @param array $warnings Populated by method
 *
 * @return bool If any errors or warnings have been found
 */
function getPlatformIssues(&$errors, &$warnings)
{
    $errors = array();
    $warnings = array();
    if ($iniPath = php_ini_loaded_file()) {
        $iniMessage = PHP_EOL . 'The php.ini used by your command-line PHP is: ' . $iniPath;
    } else {
        $iniMessage = PHP_EOL . 'A php.ini file does not exist. You will have to create one.';
    }
    $iniMessage .= PHP_EOL . 'If you can not modify the ini file, you can also run `php -d option=value` to modify ini values on the fly. You can use -d multiple times.';
    if (ini_get('detect_unicode')) {
        $errors['unicode'] = array('The detect_unicode setting must be disabled.', 'Add the following to the end of your `php.ini`:', '    detect_unicode = Off', $iniMessage);
    }
    if (extension_loaded('suhosin')) {
        $suhosin = ini_get('suhosin.executor.include.whitelist');
        $suhosinBlacklist = ini_get('suhosin.executor.include.blacklist');
        if (false === stripos($suhosin, 'phar') && (!$suhosinBlacklist || false !== stripos($suhosinBlacklist, 'phar'))) {
            $errors['suhosin'] = array('The suhosin.executor.include.whitelist setting is incorrect.', 'Add the following to the end of your `php.ini` or suhosin.ini (Example path [for Debian]: /etc/php5/cli/conf.d/suhosin.ini):', '    suhosin.executor.include.whitelist = phar ' . $suhosin, $iniMessage);
        }
    }
    if (!function_exists('json_decode')) {
        $errors['json'] = array('The json extension is missing.', 'Install it or recompile php without --disable-json');
    }
    if (!extension_loaded('Phar')) {
        $errors['phar'] = array('The phar extension is missing.', 'Install it or recompile php without --disable-phar');
    }
    if (!extension_loaded('filter')) {
        $errors['filter'] = array('The filter extension is missing.', 'Install it or recompile php without --disable-filter');
    }
    if (!extension_loaded('hash')) {
        $errors['hash'] = array('The hash extension is missing.', 'Install it or recompile php without --disable-hash');
    }
    if (!extension_loaded('iconv') && !extension_loaded('mbstring')) {
        $errors['iconv_mbstring'] = array('The iconv OR mbstring extension is required and both are missing.', 'Install either of them or recompile php without --disable-iconv');
    }
    if (!ini_get('allow_url_fopen')) {
        $errors['allow_url_fopen'] = array('The allow_url_fopen setting is incorrect.', 'Add the following to the end of your `php.ini`:', '    allow_url_fopen = On', $iniMessage);
    }
    if (extension_loaded('ionCube Loader') && ioncube_loader_iversion() < 40009) {
        $ioncube = ioncube_loader_version();
        $errors['ioncube'] = array('Your ionCube Loader extension (' . $ioncube . ') is incompatible with Phar files.', 'Upgrade to ionCube 4.0.9 or higher or remove this line (path may be different) from your `php.ini` to disable it:', '    zend_extension = /usr/lib/php5/20090626+lfs/ioncube_loader_lin_5.3.so', $iniMessage);
    }
    if (version_compare(PHP_VERSION, '5.3.2', '<')) {
        $errors['php'] = array('Your PHP (' . PHP_VERSION . ') is too old, you must upgrade to PHP 5.3.2 or higher.');
    }
    if (version_compare(PHP_VERSION, '5.3.4', '<')) {
        $warnings['php'] = array('Your PHP (' . PHP_VERSION . ') is quite old, upgrading to PHP 5.3.4 or higher is recommended.', 'Composer works with 5.3.2+ for most people, but there might be edge case issues.');
    }
    if (!extension_loaded('openssl')) {
        $warnings['openssl'] = array('The openssl extension is missing, which means that secure HTTPS transfers are impossible.', 'If possible you should enable it or recompile php with --with-openssl');
    }
    if (extension_loaded('openssl') && OPENSSL_VERSION_NUMBER < 0x1000100f) {
        // Attempt to parse version number out, fallback to whole string value.
        $opensslVersion = trim(strstr(OPENSSL_VERSION_TEXT, ' '));
        $opensslVersion = substr($opensslVersion, 0, strpos($opensslVersion, ' '));
        $opensslVersion = $opensslVersion ? $opensslVersion : OPENSSL_VERSION_TEXT;
        $warnings['openssl_version'] = array('The OpenSSL library (' . $opensslVersion . ') used by PHP does not support TLSv1.2 or TLSv1.1.', 'If possible you should upgrade OpenSSL to version 1.0.1 or above.');
    }
    if (!defined('HHVM_VERSION') && !extension_loaded('apcu') && ini_get('apc.enable_cli')) {
        $warnings['apc_cli'] = array('The apc.enable_cli setting is incorrect.', 'Add the following to the end of your `php.ini`:', '    apc.enable_cli = Off', $iniMessage);
    }
    if (extension_loaded('xdebug')) {
        $warnings['xdebug_loaded'] = array('The xdebug extension is loaded, this can slow down Composer a little.', 'Disabling it when using Composer is recommended.');
        if (ini_get('xdebug.profiler_enabled')) {
            $warnings['xdebug_profile'] = array('The xdebug.profiler_enabled setting is enabled, this can slow down Composer a lot.', 'Add the following to the end of your `php.ini` to disable it:', '    xdebug.profiler_enabled = 0', $iniMessage);
        }
    }
    ob_start();
    phpinfo(INFO_GENERAL);
    $phpinfo = ob_get_clean();
    if (preg_match('{Configure Command(?: *</td><td class="v">| *=> *)(.*?)(?:</td>|$)}m', $phpinfo, $match)) {
        $configure = $match[1];
        if (false !== strpos($configure, '--enable-sigchild')) {
            $warnings['sigchild'] = array('PHP was compiled with --enable-sigchild which can cause issues on some platforms.', 'Recompile it without this flag if possible, see also:', '    https://bugs.php.net/bug.php?id=22999');
        }
        if (false !== strpos($configure, '--with-curlwrappers')) {
            $warnings['curlwrappers'] = array('PHP was compiled with --with-curlwrappers which will cause issues with HTTP authentication and GitHub.', 'Recompile it without this flag if possible');
        }
    }
    // Stringify the message arrays
    foreach ($errors as $key => $value) {
        $errors[$key] = PHP_EOL . implode(PHP_EOL, $value);
    }
    foreach ($warnings as $key => $value) {
        $warnings[$key] = PHP_EOL . implode(PHP_EOL, $value);
    }
    return !empty($errors) || !empty($warnings);
}
コード例 #14
0
ファイル: Installer.php プロジェクト: tgalopin/installer
 /**
  * Check the platform for possible issues on running Puli.
  *
  * @return bool Whether the platform requirements are satisfied.
  */
 private function validateSystem()
 {
     $errors = array();
     $warnings = array();
     $iniPath = php_ini_loaded_file();
     $displayIniMessage = false;
     if ($iniPath) {
         $iniMessage = PHP_EOL . PHP_EOL . 'The php.ini used by your command-line PHP is: ' . $iniPath;
     } else {
         $iniMessage = PHP_EOL . PHP_EOL . 'A php.ini file does not exist. You will have to create one.';
     }
     $iniMessage .= PHP_EOL . 'If you can not modify the ini file, you can also run `php -d option=value` to modify ini values on the fly. You can use -d multiple times.';
     if (ini_get('detect_unicode')) {
         $errors['unicode'] = 'On';
     }
     if (extension_loaded('suhosin')) {
         $suhosin = ini_get('suhosin.executor.include.whitelist');
         $suhosinBlacklist = ini_get('suhosin.executor.include.blacklist');
         if (false === stripos($suhosin, 'phar') && (!$suhosinBlacklist || false !== stripos($suhosinBlacklist, 'phar'))) {
             $errors['suhosin'] = $suhosin;
         }
     }
     if (!function_exists('json_decode')) {
         $errors['json'] = true;
     }
     if (!extension_loaded('Phar')) {
         $errors['phar'] = true;
     }
     if (!ini_get('allow_url_fopen')) {
         $errors['allow_url_fopen'] = true;
     }
     if (extension_loaded('ionCube Loader') && ioncube_loader_iversion() < 40009) {
         $errors['ioncube'] = ioncube_loader_version();
     }
     if (version_compare(PHP_VERSION, '5.3.9', '<')) {
         $errors['php'] = PHP_VERSION;
     }
     if (!extension_loaded('openssl')) {
         $errors['openssl'] = true;
     }
     if (!defined('HHVM_VERSION') && !extension_loaded('apcu') && ini_get('apc.enable_cli')) {
         $warnings['apc_cli'] = true;
     }
     ob_start();
     phpinfo(INFO_GENERAL);
     $phpinfo = ob_get_clean();
     if (preg_match('{Configure Command(?: *</td><td class="v">| *=> *)(.*?)(?:</td>|$)}m', $phpinfo, $match)) {
         $configure = $match[1];
         if (false !== strpos($configure, '--enable-sigchild')) {
             $warnings['sigchild'] = true;
         }
         if (false !== strpos($configure, '--with-curlwrappers')) {
             $warnings['curlwrappers'] = true;
         }
     }
     if (!empty($errors)) {
         $this->error('Some settings on your machine make Puli unable to work properly.');
         $this->error('Make sure that you fix the issues listed below and run this script again:');
         foreach ($errors as $error => $current) {
             $text = '';
             switch ($error) {
                 case 'json':
                     $text = PHP_EOL . 'The json extension is missing.' . PHP_EOL;
                     $text .= 'Install it or recompile php without --disable-json';
                     break;
                 case 'phar':
                     $text = PHP_EOL . 'The phar extension is missing.' . PHP_EOL;
                     $text .= 'Install it or recompile php without --disable-phar';
                     break;
                 case 'unicode':
                     $text = PHP_EOL . 'The detect_unicode setting must be disabled.' . PHP_EOL;
                     $text .= 'Add the following to the end of your `php.ini`:' . PHP_EOL;
                     $text .= '    detect_unicode = Off';
                     $displayIniMessage = true;
                     break;
                 case 'suhosin':
                     $text = PHP_EOL . 'The suhosin.executor.include.whitelist setting is incorrect.' . PHP_EOL;
                     $text .= 'Add the following to the end of your `php.ini` or suhosin.ini (Example path [for Debian]: /etc/php5/cli/conf.d/suhosin.ini):' . PHP_EOL;
                     $text .= '    suhosin.executor.include.whitelist = phar ' . $current;
                     $displayIniMessage = true;
                     break;
                 case 'php':
                     $text = PHP_EOL . "Your PHP ({$current}) is too old, you must upgrade to PHP 5.3.9 or higher.";
                     break;
                 case 'allow_url_fopen':
                     $text = PHP_EOL . 'The allow_url_fopen setting is incorrect.' . PHP_EOL;
                     $text .= 'Add the following to the end of your `php.ini`:' . PHP_EOL;
                     $text .= '    allow_url_fopen = On';
                     $displayIniMessage = true;
                     break;
                 case 'ioncube':
                     $text = PHP_EOL . "Your ionCube Loader extension ({$current}) is incompatible with Phar files." . PHP_EOL;
                     $text .= 'Upgrade to ionCube 4.0.9 or higher or remove this line (path may be different) from your `php.ini` to disable it:' . PHP_EOL;
                     $text .= '    zend_extension = /usr/lib/php5/20090626+lfs/ioncube_loader_lin_5.3.so';
                     $displayIniMessage = true;
                     break;
                 case 'openssl':
                     $text = PHP_EOL . 'The openssl extension is missing, which means that secure HTTPS transfers are impossible.' . PHP_EOL;
                     $text .= 'If possible you should enable it or recompile php with --with-openssl';
                     break;
             }
             if ($displayIniMessage) {
                 $text .= $iniMessage;
             }
             $this->info($text);
         }
         echo PHP_EOL;
         return false;
     }
     if (!empty($warnings)) {
         $this->error('Some settings on your machine may cause stability issues with Puli.');
         $this->error('If you encounter issues, try to change the following:');
         foreach ($warnings as $warning => $current) {
             $text = '';
             switch ($warning) {
                 case 'apc_cli':
                     $text = PHP_EOL . 'The apc.enable_cli setting is incorrect.' . PHP_EOL;
                     $text .= 'Add the following to the end of your `php.ini`:' . PHP_EOL;
                     $text .= '    apc.enable_cli = Off';
                     $displayIniMessage = true;
                     break;
                 case 'sigchild':
                     $text = PHP_EOL . 'PHP was compiled with --enable-sigchild which can cause issues on some platforms.' . PHP_EOL;
                     $text .= 'Recompile it without this flag if possible, see also:' . PHP_EOL;
                     $text .= '    https://bugs.php.net/bug.php?id=22999';
                     break;
                 case 'curlwrappers':
                     $text = PHP_EOL . 'PHP was compiled with --with-curlwrappers which will cause issues with HTTP authentication and GitHub.' . PHP_EOL;
                     $text .= 'Recompile it without this flag if possible';
                     break;
                 case 'openssl':
                     $text = PHP_EOL . 'The openssl extension is missing, which means that secure HTTPS transfers are impossible.' . PHP_EOL;
                     $text .= 'If possible you should enable it or recompile php with --with-openssl';
                     break;
             }
             if ($displayIniMessage) {
                 $text .= $iniMessage;
             }
             $this->info($text);
         }
         echo PHP_EOL;
         return true;
     }
     if (!$this->quiet) {
         $this->success('All settings correct for using Puli');
     }
     return true;
 }
コード例 #15
0
 /**
  * Check Ioncube Loader version
  */
 private function test_loader_ioncube()
 {
     if (extension_loaded('ionCube Loader') && $this->function_usable('ioncube_loader_version')) {
         if (!$this->function_usable('ioncube_loader_iversion')) {
             $this->warnings[__METHOD__][] = 'You have a VERY old version of IonCube Loader which is known to cause problems.';
         } elseif (ioncube_loader_iversion() < 40400 && version_compare(PHP_VERSION, '5.4') >= 0) {
             $this->warnings[__METHOD__][] = 'You have an old version of IonCube Loader (earlier than 4.4.0) which is known to cause problems with PHP 5.4.';
         } elseif (ioncube_loader_iversion() < 40007) {
             $this->warnings[__METHOD__][] = 'You have an old version of IonCube Loader (earlier than 4.0.7) which is known to cause problems with PHP scripts.';
         }
     } else {
         $this->warnings[__METHOD__][] = 'You do not seem to have IonCube Loader installed.';
     }
 }
コード例 #16
0
ファイル: live-update.php プロジェクト: hbelow/check
 /**
  * Check whether the ionCube Loader is enabled
  *
  * @return boolean True if the ionCube Loader is enabled
  */
 public function hasIonCube()
 {
     if (!extension_loaded('ionCube Loader')) {
         return false;
     }
     // The issues have been fixed in version 4.0.9
     if (function_exists('ioncube_loader_iversion') && ioncube_loader_iversion() >= 40009) {
         return false;
     }
     $this->available = false;
     return true;
 }
コード例 #17
0
 function GetIonCubeVersion()
 {
     return ioncube_loader_iversion();
 }