本文整理汇总了PHP中common::IniGet方法的典型用法代码示例。如果您正苦于以下问题:PHP common::IniGet方法的具体用法?PHP common::IniGet怎么用?PHP common::IniGet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common
的用法示例。
在下文中一共展示了common::IniGet方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Supported
/**
* Determine if a specific method is supported
*
*/
static function Supported($method)
{
if (common::IniGet('safe_mode')) {
return false;
}
$url_fopen = common::IniGet('allow_url_fopen');
$php5 = version_compare(phpversion(), '5.0', '>=');
switch ($method) {
case 'stream':
return $url_fopen && $php5;
case 'fopen':
return $url_fopen;
case 'fsockopen':
return function_exists('fsockopen');
}
return false;
}
示例2: CheckFolders
function CheckFolders()
{
global $ok, $langmessage;
$ok = true;
echo '<h2>' . $langmessage['Checking_server'] . '...</h2>';
echo '<table class="styledtable fullwidth">';
echo '<thead>';
echo '<tr>';
echo '<th>' . $langmessage['Checking'] . '...</th>';
echo '<th>' . $langmessage['Status'] . '</th>';
echo '<th>' . $langmessage['Current_Value'] . '</th>';
echo '<th>' . $langmessage['Expected_Value'] . '</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
$this->CheckDataFolder();
//Check PHP Version
echo '<tr>';
echo '<td>';
echo $langmessage['PHP_Version'];
echo '</td>';
if (!function_exists('version_compare')) {
echo '<td class="failed">' . $langmessage['Failed'] . '</td>';
echo '<td class="failed">???</td>';
$ok = false;
} elseif (version_compare(phpversion(), '5.3', '>=')) {
echo '<td class="passed">' . $langmessage['Passed'] . '</td>';
echo '<td class="passed">' . phpversion() . '</td>';
} else {
echo '<td class="failed">' . $langmessage['Failed'] . '</td>';
echo '<td class="failed">' . phpversion() . '</td>';
$ok = false;
}
echo '<td>5.3+</td>';
echo '</tr>';
//make sure $_SERVER['SCRIPT_NAME'] is set
echo '<tr>';
echo '<td>';
echo '<a href="http://www.php.net/manual/reserved.variables.server.php" target="_blank">';
echo 'SCRIPT_NAME or PHP_SELF';
echo '</a>';
echo '</td>';
$checkValue = common::GetEnv('SCRIPT_NAME', 'index.php') || common::GetEnv('PHP_SELF', 'index.php');
$ok = $ok && $checkValue;
$this->StatusRow($checkValue, $langmessage['Set'], $langmessage['Not_Set']);
echo '</tr>';
//Check Safe Mode
$checkValue = common::IniGet('safe_mode');
echo '<tr>';
echo '<td>';
echo '<a href="http://php.net/manual/features.safe-mode.php" target="_blank">';
echo 'Safe Mode';
echo '</a>';
echo '</td>';
if ($checkValue) {
echo '<td class="failed">' . $langmessage['Failed'] . ': ' . $langmessage['See_Below'] . '</td>';
echo '<td class="failed">' . $langmessage['On'] . '</td>';
$ok = false;
} else {
echo '<td class="passed">' . $langmessage['Passed'] . '</td>';
echo '<td class="passed">' . $langmessage['Off'] . '</td>';
}
echo '<td>' . $langmessage['Off'] . '</td>';
echo '</tr>';
//Check register_globals
$checkValue = common::IniGet('register_globals');
echo '<tr>';
echo '<td>';
echo '<a href="http://php.net/manual/security.globals.php" target="_blank">';
echo 'Register Globals';
echo '</a>';
echo '</td>';
if ($checkValue) {
echo '<td class="passed_orange">' . $langmessage['Passed'] . '</td>';
echo '<td class="passed_orange">' . $langmessage['On'] . '</td>';
} else {
echo '<td class="passed">' . $langmessage['Passed'] . '</td>';
echo '<td class="passed">' . $langmessage['Off'] . '</td>';
}
echo '<td>' . $langmessage['Off'] . '</td>';
echo '</tr>';
//Check common::IniGet( 'magic_quotes_sybase' )
$checkValue = !common::IniGet('magic_quotes_sybase');
$ok = $ok && $checkValue;
echo '<tr>';
echo '<td>';
echo '<a href="http://php.net/manual/security.magicquotes.disabling.php" target="_blank">';
echo 'Magic Quotes Sybase';
echo '</a>';
echo '</td>';
$this->StatusRow($checkValue, $langmessage['Off'], $langmessage['On']);
echo '</tr>';
//magic_quotes_runtime
$checkValue = !common::IniGet('magic_quotes_runtime');
$ok = $ok && $checkValue;
echo '<tr>';
echo '<td>';
echo '<a href="http://php.net/manual/security.magicquotes.disabling.php" target="_blank">';
echo 'Magic Quotes Runtime';
echo '</a>';
//.........这里部分代码省略.........
示例3: function_exists
/**
* Test if function exists. Also handles case where function is disabled via Suhosin.
* Modified from: http://dev.piwik.org/trac/browser/trunk/plugins/Installation/Controller.php
*
* @param string $function Function name
* @return bool True if function exists (not disabled); False otherwise.
*/
static function function_exists($function)
{
$function = strtolower($function);
// eval() is a language construct
if ($function == 'eval') {
// does not check suhosin.executor.eval.whitelist (or blacklist)
if (extension_loaded('suhosin') && common::IniGet('suhosin.executor.disable_eval')) {
return false;
}
return true;
}
if (!function_exists($function)) {
return false;
}
$blacklist = @ini_get('disable_functions');
if (extension_loaded('suhosin')) {
$blacklist .= ',' . @ini_get('suhosin.executor.func.blacklist');
}
$blacklist = explode(',', $blacklist);
$blacklist = array_map('trim', $blacklist);
$blacklist = array_map('strtolower', $blacklist);
if (in_array($function, $blacklist)) {
return false;
}
return true;
}
示例4: CanRate
function CanRate()
{
/*
if( $this->rate_testing ){
message('rate_testing is enabled');
}elseif( strpos($_SERVER['SERVER_ADDR'],'127') === 0 ){
$this->messages[] = 'This installation of gpEasy is on a local server and is not accessible via the internet.';
}
*/
if (!common::IniGet('allow_url_fopen')) {
$this->messages[] = 'Your installation of PHP does not support url fopen wrappers.';
}
if (count($this->messages) > 0) {
$message = 'Oops, you are currently unable to rate this addon for the following reasons:';
$message .= '<ul>';
$message .= '<li>' . implode('</li><li>', $this->messages) . '</li>';
$message .= '</ul>';
message($message);
$this->ShowRatingText = false;
return false;
}
return true;
}
示例5: function_exists
/**
* Test if function exists. Also handles case where function is disabled via Suhosin.
* Modified from: http://dev.piwik.org/trac/browser/trunk/plugins/Installation/Controller.php
*
* @param string $functionName Function name
* @return bool True if function exists (not disabled); False otherwise.
*/
function function_exists($functionName)
{
$functionName = strtolower($functionName);
// eval() is a language construct
if ($functionName == 'eval') {
// does not check suhosin.executor.eval.whitelist (or blacklist)
if (extension_loaded('suhosin') && common::IniGet('suhosin.executor.disable_eval')) {
return false;
}
return true;
}
if (!function_exists($functionName)) {
return false;
}
if (extension_loaded('suhosin')) {
$blacklist = @ini_get('suhosin.executor.func.blacklist');
if (!empty($blacklist)) {
$blacklistFunctions = array_map('strtolower', array_map('trim', explode(',', $blacklist)));
return !in_array($functionName, $blacklistFunctions);
}
}
return true;
}
示例6: CheckFolders
function CheckFolders()
{
global $ok, $langmessage;
$ok = true;
echo '<h2>' . $langmessage['Checking_server'] . '...</h2>';
echo '<table cellpadding="5" cellspacing="0" class="styledtable fullwidth">';
echo '<thead>';
echo '<tr>';
echo '<th>' . $langmessage['Checking'] . '...</th>';
echo '<th>' . $langmessage['Status'] . '</th>';
echo '<th>' . $langmessage['Current_Value'] . '</th>';
echo '<th>' . $langmessage['Expected_Value'] . '</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
$this->CheckDataFolder();
//Check PHP Version
echo '<tr>';
echo '<td>';
echo $langmessage['PHP_Version'];
echo '</td>';
if (!function_exists('version_compare')) {
echo '<td class="failed">' . $langmessage['Failed'] . '</td>';
echo '<td class="failed">???</td>';
$ok = false;
} elseif (version_compare(phpversion(), '5.2', '>=')) {
echo '<td class="passed">' . $langmessage['Passed'] . '</td>';
echo '<td class="passed">' . phpversion() . '</td>';
} else {
echo '<td class="failed">' . $langmessage['Failed'] . '</td>';
echo '<td class="failed">' . phpversion() . '</td>';
$ok = false;
}
echo '<td>5.2+</td>';
echo '</tr>';
//make sure $_SERVER['SCRIPT_NAME'] is set
echo '<tr>';
echo '<td>';
echo '<a href="http://www.php.net/manual/reserved.variables.server.php" target="_blank">';
echo 'SCRIPT_NAME or PHP_SELF';
echo '</a>';
echo '</td>';
$checkValue = common::GetEnv('SCRIPT_NAME', 'index.php') || common::GetEnv('PHP_SELF', 'index.php');
$ok = $ok && $checkValue;
$this->StatusRow($checkValue, $langmessage['Set'], $langmessage['Not_Set']);
echo '</tr>';
//Check Safe Mode
$checkValue = common::IniGet('safe_mode');
echo '<tr>';
echo '<td>';
echo '<a href="http://php.net/manual/features.safe-mode.php" target="_blank">';
echo 'Safe Mode';
echo '</a>';
echo '</td>';
if ($checkValue) {
echo '<td class="failed">' . $langmessage['Failed'] . ': ' . $langmessage['See_Below'] . '</td>';
echo '<td class="failed">' . $langmessage['On'] . '</td>';
$ok = false;
} else {
echo '<td class="passed">' . $langmessage['Passed'] . '</td>';
echo '<td class="passed">' . $langmessage['Off'] . '</td>';
}
echo '<td>' . $langmessage['Off'] . '</td>';
echo '</tr>';
//Check register_globals
$checkValue = common::IniGet('register_globals');
echo '<tr>';
echo '<td>';
echo '<a href="http://php.net/manual/security.globals.php" target="_blank">';
echo 'Register Globals';
echo '</a>';
echo '</td>';
if ($checkValue) {
echo '<td class="passed_orange">' . $langmessage['Passed'] . '</td>';
echo '<td class="passed_orange">' . $langmessage['On'] . '</td>';
} else {
echo '<td class="passed">' . $langmessage['Passed'] . '</td>';
echo '<td class="passed">' . $langmessage['Off'] . '</td>';
}
echo '<td>' . $langmessage['Off'] . '</td>';
echo '</tr>';
//Check common::IniGet( 'magic_quotes_sybase' )
$checkValue = !common::IniGet('magic_quotes_sybase');
$ok = $ok && $checkValue;
echo '<tr>';
echo '<td>';
echo '<a href="http://php.net/manual/security.magicquotes.disabling.php" target="_blank">';
echo 'Magic Quotes Sybase';
echo '</a>';
echo '</td>';
$this->StatusRow($checkValue, $langmessage['Off'], $langmessage['On']);
echo '</tr>';
//magic_quotes_runtime
$checkValue = !common::IniGet('magic_quotes_runtime');
$ok = $ok && $checkValue;
echo '<tr>';
echo '<td>';
echo '<a href="http://php.net/manual/security.magicquotes.disabling.php" target="_blank">';
echo 'Magic Quotes Runtime';
echo '</a>';
//.........这里部分代码省略.........