本文整理汇总了PHP中ioncube_loader_version函数的典型用法代码示例。如果您正苦于以下问题:PHP ioncube_loader_version函数的具体用法?PHP ioncube_loader_version怎么用?PHP ioncube_loader_version使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ioncube_loader_version函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: com_install
/**
* 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: checkIonCubeLoader
/**
* Checks the ion cube loader
*
* @return bool|string
*/
function checkIonCubeLoader()
{
if (!extension_loaded('ionCube Loader')) {
return false;
}
if (!function_exists('ioncube_loader_version')) {
return false;
}
return ioncube_loader_version();
}
示例3: ioncube_loader_version_array
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: check
/**
* @param array $requirement
* @return array
*/
public function check($requirement)
{
$requiredVersion = $requirement['value'];
if (!extension_loaded('ionCube Loader')) {
return null;
}
if (!function_exists('ioncube_loader_version')) {
return array('type' => self::CHECK_TYPE, 'errorLevel' => $requirement['level'], 'message' => sprintf($this->namespace->get('controller/check_ioncubeloaderversion_unknown'), $requiredVersion));
}
$installedVersion = ioncube_loader_version();
$isValid = version_compare(strtolower($installedVersion), $requiredVersion, '>');
if ($isValid) {
return array('type' => self::CHECK_TYPE, 'errorLevel' => Validation::REQUIREMENT_VALID, 'message' => sprintf($this->namespace->get('controller/check_ioncubeloaderversion_success'), $requiredVersion, $installedVersion));
} else {
return array('type' => self::CHECK_TYPE, 'errorLevel' => $requirement['level'], 'message' => sprintf($this->namespace->get('check_ioncubeloaderversion_failure'), $requiredVersion, $installedVersion));
}
}
示例5: mswManSchemaFix
function mswManSchemaFix($s)
{
if ($s->email == '' && $s->scriptpath == '' && $s->attachpath == '' && $s->attachhref == '') {
$hdeskPath = 'http://www.example.com/helpdesk';
if (isset($_SERVER['HTTP_HOST']) && isset($_SERVER['PHP_SELF'])) {
$hdeskPath = 'http' . (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'], 0, -10);
}
$hdeskPathAtt = $hdeskPath . '/content/attachments';
$hdeskPathFaq = $hdeskPath . '/content/attachments-faq';
$attachPath = mswSafeImportString(PATH . 'content/attachments');
$attFaqPath = mswSafeImportString(PATH . 'content/attachments-faq');
$apiKey = strtoupper(substr(md5(uniqid(rand(), 1)), 3, 10) . '-' . substr(md5(uniqid(rand(), 1)), 3, 8));
mysql_query("UPDATE `" . DB_PREFIX . "settings` SET\n `website` = 'My Help Desk',\n `email` = 'email@example.com',\n `scriptpath` = '{$hdeskPath}',\n `attachpath` = '{$attachPath}',\n\t`attachhref` = '{$hdeskPathAtt}',\n\t`attachpathfaq` = '{$attFaqPath}',\n\t`attachhreffaq` = '{$hdeskPathFaq}',\n `adminFooter` = 'To add your own footer code, click "Settings & Tools > Other Options > Edit Footers"',\n `publicFooter` = 'To add your own footer code, click "Settings & Tools > Other Options > Edit Footers"',\n `prodKey` = '" . mswProdKeyGen() . "',\n `encoderVersion` = '" . (function_exists('ioncube_loader_version') ? ioncube_loader_version() : 'XX') . "',\n `softwareVersion` = '" . SCRIPT_VERSION . "',\n\t`apiKey` = '{$apiKey}'\n LIMIT 1\n ") or die(mswMysqlErrMsg(mysql_errno(), mysql_error(), __LINE__, __FILE__));
// Insert user..
if (mswRowCount('users') == 0) {
mysql_query("INSERT INTO `" . DB_PREFIX . "users` (\n `id`, `ts`, `name`, `email`, `accpass`, `signature`, `notify`, `pageAccess`, `emailSigs`, `notePadEnable`, `delPriv`,\n `nameFrom`, `emailFrom`, `assigned`, `timezone`\n ) VALUES (\n 1, UNIX_TIMESTAMP(UTC_TIMESTAMP), 'admin', 'admin@example.com', '" . md5(SECRET_KEY . 'admin') . "', '', 'yes', '', 'no', 'yes', 'yes',\n '', '', 'no', 'Europe/London'\n )");
} else {
mysql_query("UPDATE `" . DB_PREFIX . "users` SET\n\t `accpass` = '" . md5(SECRET_KEY . 'admin') . "'\n\t WHERE `id` = '1'\n\t ");
}
// Page reload..
header("Location: index.php");
exit;
}
}
示例6: checkPlatform
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;
//.........这里部分代码省略.........
示例7: checkPlatform
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':
//.........这里部分代码省略.........
示例8: isset
* BlockScript
******************************************************************/
/*****************************************************************
* BlockScript
******************************************************************/
case 'blockscript':
if (file_exists($bsc = $_SERVER['DOCUMENT_ROOT'] . '/blockscript/tmp/config.php')) {
include $bsc;
# header('Location: /blockscript/detector.php?blockscript=setup&bsap='.$BS_VAL['admin_password']); exit;
}
$installed = isset($BS_VAL['license_agreement_accepted']) ? '<span class="ok-color">installed</span>' : '<span class="error-color">not installed</span>';
$enabled = isset($BS_VAL['license_agreement_accepted']) && !empty($CONFIG['enable_blockscript']) ? '<span class="ok-color">enabled</span>' : '<span class="error-color">disabled</span>';
if (!($ok = function_exists('ioncube_loader_version'))) {
$error->add('BlockScript requires IonCube.');
}
$IonCubeVersion = $ok && ($tmp = ioncube_loader_version()) ? $tmp : 'not available';
if ($ok && $tmp != 'not available') {
}
# Print header
$output->title = 'BlockScript®';
$output->bodyTitle = 'BlockScript® Integration';
echo <<<OUT
t\t\t<form action="{$self}?blockscript" method="post">
t\t\t<table class="form_table" border="0" cellpadding="0" cellspacing="0">
t\t\t\t<tr>
t\t\t\t\t<td align="right">BlockScript status:</td>
t\t\t\t\t<td><b>{$installed} and {$enabled}</b></td>
t\t\t\t</tr>
t\t\t</table>
t\t\t</form>
t\t\t<div class="hr"></div>
示例9: ini_get
$white = ini_get('suhosin.executor.include.whitelist');
$black = ini_get('suhosin.executor.include.blacklist');
if (false === stripos($white, 'phar') || false !== stripos($black, 'phar')) {
return false;
}
return true;
});
}
// check allow url open setting
check('The "allow_url_fopen" setting is on.', 'The "allow_url_fopen" setting needs to be on.', function () {
return true == ini_get('allow_url_fopen');
});
// check ioncube loader version
if (extension_loaded('ionCube_loader')) {
check('You have a supported version of ionCube Loader.', 'Your version of the ionCube Loader is not compatible with Phars.', function () {
return 40009 > ioncube_loader_version();
});
}
// check apc cli caching
if (!defined('HHVM_VERSION') && !extension_loaded('apcu') && extension_loaded('apc')) {
check('The "apc.enable_cli" setting is off.', 'Notice: The "apc.enable_cli" is on and may cause problems with Phars.', function () {
return false == ini_get('apc.enable_cli');
}, false);
}
echo "{$n}Everything seems good!{$n}{$n}";
echo "Download{$n}";
echo "--------{$n}{$n}";
// Retrieve manifest
echo " - Downloading manifest...{$n}";
$manifest = file_get_contents('http://box-project.github.io/box2/manifest.json');
echo " - Reading manifest...{$n}";
示例10: sprintf
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);
JFile::write($path, $replace);
JPath::setPermissions($path, '0444');
示例11: explode
<td>
<?php
$qualified = true;
if (isset($_SERVER['SERVER_SOFTWARE'])) {
$http = $_SERVER['SERVER_SOFTWARE'];
$http = explode(" ", $http);
$http = $http[0];
} else {
if ($sf = getenv('SERVER_SOFTWARE')) {
$http = $sf;
} else {
$http = 'n/a';
}
}
if (extension_loaded('ionCube Loader')) {
$ioncube_version = ioncube_loader_version();
if (ioncube_loader_iversion() < 40000) {
$ioncube = "<span style=\"color:#F00\">very old! =(</span>";
$qualified = false;
} else {
$ioncube = "<span style=\"color:#060\">OK! =)</span>";
}
} else {
$ioncube_version = "none";
$ioncube = "<span style=\"color:#900\">Not installed! =(</span>";
$qualified = false;
}
$mssql = "";
if (extension_loaded('sqlsrv')) {
$mssql .= "<span style=\"color:#060\">sqlsrv</span><br />";
}
示例12: mswProdKeyGen
<?php
if (!defined('PARENT')) {
exit;
}
// Check product key exists..
if ($SETTINGS->prodKey == '' || strlen($SETTINGS->prodKey) != 60) {
$productKey = mswProdKeyGen();
mysql_query("UPDATE `" . DB_PREFIX . "settings` SET\n `prodKey` = '{$productKey}'\n ") or die(mswMysqlErrMsg(mysql_errno(), mysql_error(), __LINE__, __FILE__));
$SETTINGS->prodKey = $productKey;
}
// Update encoder version if not already..
if ($SETTINGS->encoderVersion == 'XX' && function_exists('ioncube_loader_version')) {
mysql_query("UPDATE `" . DB_PREFIX . "settings` SET\n `encoderVersion` = '" . ioncube_loader_version() . "'\n ") or die(mswMysqlErrMsg(mysql_errno(), mysql_error(), __LINE__, __FILE__));
}
?>
<div class="content">
<div class="header">
<h1 class="page-title"><?php
echo $msg_adheader9;
?>
</h1>
<span class="clearfix"></span>
</div>
<ul class="breadcrumb">
<li class="active"><?php
示例13: getPlatformIssues
/**
* 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: substr
// HTTP Paths..
$hdeskPath = 'http://www.example.com/helpdesk';
if (isset($_SERVER['HTTP_HOST']) && isset($_SERVER['PHP_SELF'])) {
$hdeskPath = 'http' . (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], 'install') - 1);
}
$hdeskPathAtt = $hdeskPath . '/content/attachments';
$hdeskPathFaq = $hdeskPath . '/content/attachments-faq';
// Server Paths..
$attachPath = mswSafeImportString(substr(PATH, 0, strpos(PATH, 'install') - 1) . '/content/attachments');
$attFaqPath = mswSafeImportString(substr(PATH, 0, strpos(PATH, 'install') - 1) . '/content/attachments-faq');
// Other..
$defKeepLogs = mswSafeImportString('a:2:{s:4:"user";s:2:"50";s:3:"acc";s:2:"50";}');
$langSets = mswSafeImportString('a:1:{s:7:"english";s:12:"_default_set";}');
$apiKey = strtoupper(substr(md5(uniqid(rand(), 1)), 3, 10) . '-' . substr(md5(uniqid(rand(), 1)), 3, 8));
mysql_query("TRUNCATE TABLE `" . DB_PREFIX . "settings`");
$q = mysql_query("INSERT INTO `" . DB_PREFIX . "settings` (\n`id`, `website`, `email`, `replyto`, `scriptpath`, `attachpath`, `attachhref`, `attachpathfaq`, `attachhreffaq`, \n`language`, `langSets`, `dateformat`, `timeformat`, `timezone`, `weekStart`, `jsDateFormat`, `kbase`, `enableVotes`, \n`multiplevotes`, `popquestions`, `quePerPage`, `cookiedays`, `renamefaq`, `attachment`, `rename`, `attachboxes`, \n`filetypes`, `maxsize`, `enableBBCode`, `afolder`, `autoClose`, `autoCloseMail`, `smtp_host`, `smtp_user`, `smtp_pass`, \n`smtp_port`, `smtp_security`, `smtp_debug`, `prodKey`, `publicFooter`, `adminFooter`, `encoderVersion`, `softwareVersion`, \n`apiKey`, `apiLog`, `apiHandlers`, `recaptchaPublicKey`, `recaptchaPrivateKey`, `enCapLogin`, `sysstatus`, `autoenable`, \n`disputes`, `offlineReason`, `createPref`, `createAcc`, `loginLimit`, `banTime`, `ticketHistory`, `backupEmails`, \n`closenotify`, `minPassValue`, `accProfNotify`, `newAccNotify`, `recaptchaTheme`, `recaptchaLang`, `enableLog`, \n`defKeepLogs`, `minTickDigits`, `enableMail`, `imap_debug`, `imap_param`, `imap_memory`, `imap_timeout`, \n`disputeAdminStop`\n) VALUES (\n1, '" . mswSafeImportString($_POST['website']) . "', '" . mswSafeImportString($_POST['email']) . "', '',\n'{$hdeskPath}', '{$attachPath}', '{$hdeskPathAtt}', '{$attFaqPath}', '{$hdeskPathFaq}', \n'english', '{$langSets}', 'd M Y', 'H:iA', '" . mswSafeImportString($_POST['timezone']) . "', 'sun', 'DD-MM-YYYY', 'yes', \n'yes', 'yes', 10, 10, 360, 'no', 'yes', 'yes', 5, '.jpg|.zip|.gif|.rar|.png|.pdf', 1048576, 'yes', \n'admin', 0, 'yes', '', '', '', 587, '', 'no', '{$prodKey}', '', '', '" . (function_exists('ioncube_loader_version') ? ioncube_loader_version() : 'XX') . "', \n'" . SCRIPT_VERSION . "', '{$apiKey}', 'yes', 'json,xml', '', '', 'yes', 'yes', '0000-00-00', 'no', '', 'no', 'yes', 5, 5, 'yes', '', 'no', 8, \n'yes', 'yes', 'white', 'en', 'yes', '{$defKeepLogs}', 5, 'yes', 'yes', 'pipe', '0', '0', 'no'\n)");
if (!$q) {
$data[] = DB_PREFIX . 'settings';
mswlogDBError(DB_PREFIX . 'settings', mysql_error(), mysql_errno(), __LINE__, __FILE__, 'Insert');
}
//=========================
// INSTALL DEPARTMENTS
//=========================
$depts = array('General Tickets', 'Sales and Billing', 'Technical Support');
mysql_query("TRUNCATE TABLE `" . DB_PREFIX . "departments`");
for ($i = 0; $i < count($depts); $i++) {
$deptID = $i + 1;
$q = mysql_query("INSERT INTO `" . DB_PREFIX . "departments` (\n `id`, `name`, `showDept`, `dept_subject`, `dept_comments`, `orderBy`, `manual_assign`\n ) VALUES (\n " . $deptID . ", '" . $depts[$i] . "', 'yes', '', '', '" . $deptID . "', 'no'\n )");
if (!$q) {
$data[] = DB_PREFIX . 'departments';
mswlogDBError(DB_PREFIX . 'departments', mysql_error(), mysql_errno(), __LINE__, __FILE__, 'Insert ' . $deptID);
示例15: test_ioncube_loading
print "<br />";
return $res;
}
function test_ioncube_loading()
{
echo "Testing whether your system can load ionCube Loader dynamically...";
$err = ioncube_will_work($what_to_do);
print $err == '' && phpversion() < '5.2' ? "OK" : "<font color=red>Failed {$err}</font>";
print "<br />";
return $err == '' && phpversion() < '5.2';
}
if (phpversion() < "4.0.6") {
print "aMember requires PHP version 4.0.6 or later. We recommend you to upgrade\n to <a href='http://www.php.net/downloads.php' target=_blank>latest version</a>";
exit;
} elseif (ioncube_is_installed()) {
$enc = "ionCube Loader installed (v." . @ioncube_loader_version() . ")";
} elseif (zend_is_installed()) {
$enc = "Zend Optimizer installed";
} elseif (test_ioncube_loading()) {
$enc = "ionCube dynamic loading possible";
} else {
}
print "<b>Testing results:</b><br />";
if ($enc) {
print "No additional configuration required and aMember will work on your \n hosting using the following loading method: <b>{$enc}</b><br /><br />";
} else {
print "Unfortunately, no available loaders found in your system and\n some additional configuration required. Please \n contact your hosting support and ask them to do <b>ONE</b> from the \n following:<ul>\n<li> Disable PHP safe_mode;\n<br />OR\n<li> Install free <a href='http://www.zend.com/store/products/zend-optimizer.php' target=_blank>Zend Optimizer</a>\n<br />OR\n<li> Install free <a href='http://www.ioncube.com/loaders/' target=_blank>ionCube Loader</a>\n</ul>\n ";
}
if (!function_exists('mysql_connect')) {
print "<br /><font color=red><b>Additionally, PHP has no MySQL support \n compiled-in</b></font>, please ask your hosting provider to add it.<br /><br />";
}