本文整理匯總了PHP中Settings::test方法的典型用法代碼示例。如果您正苦於以下問題:PHP Settings::test方法的具體用法?PHP Settings::test怎麽用?PHP Settings::test使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Settings
的用法示例。
在下文中一共展示了Settings::test方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_item
/** function get_item
* Generate the HTML content portion of the page
*
* @param string contents
* @param string instructions for page
* @param string [optional] title for page
* @return string HTML content for page
*/
function get_item($contents, $hint, $title = '', $extra_html = '')
{
$hint_html = "\n\t\t\t<p><strong>Welcome";
if (!empty($GLOBALS['Player']) && !empty($_SESSION['player_id'])) {
$hint_html .= ", {$GLOBALS['Player']->username}";
}
$hint_html .= '</strong></p>';
if (is_array($hint)) {
foreach ($hint as $line) {
$hint_html .= "\n\t\t\t<p>{$line}</p>";
}
} else {
$hint_html .= "\n\t\t\t<p>{$hint}</p>";
}
if ('' != $title) {
$title = '<h2>' . $title . '</h2>';
}
$long_date = class_exists('Settings') && Settings::test() ? Settings::read('long_date') : 'M j, Y g:i a';
$html = '
<aside id="info">
<div id="notes" class="box">
<div>
<div id="date">' . date($long_date) . '</div>
' . $hint_html . '
</div>
</div>
' . $extra_html . '
</aside><!-- #info -->
<div id="content" class="box">
<div>
' . $title . '
' . $contents . '
</div>
</div><!-- #content -->
';
return $html;
}
示例2: define
define('DEBUG', (bool) $debug);
// set to true for output of debugging code
}
if (DEBUG) {
if (isset($_GET['DEBUG'])) {
$GLOBALS['_&_DEBUG_QUERY'] = '&DEBUG=' . $_GET['DEBUG'];
$GLOBALS['_?_DEBUG_QUERY'] = '?DEBUG=' . $_GET['DEBUG'];
} else {
$GLOBALS['_&_DEBUG_QUERY'] = '';
$GLOBALS['_?_DEBUG_QUERY'] = '?z';
}
}
}
$GLOBALS['_LOGGING'] = DEBUG;
// do not change, rather, change debug value
if (class_exists('Settings') && Settings::test()) {
$Mysql->set_settings(array('log_errors' => Settings::read('DB_error_log'), 'email_errors' => Settings::read('DB_error_email'), 'email_from' => Settings::read('from_email'), 'email_to' => Settings::read('to_email')));
}
if (defined('DEBUG') && DEBUG) {
ini_set('display_errors', 'On');
error_reporting(-1);
// everything
if (isset($Mysql)) {
$Mysql->set_error(3);
}
}
// log the player in
if ((!defined('LOGIN') || LOGIN) && isset($Mysql)) {
$GLOBALS['Player'] = new GamePlayer();
// this will redirect to login if failed
$GLOBALS['Player']->log_in();
示例3: test_debug
/** function test_debug
* This function tests the debug given by the
* URL and checks it against the globals debug password
* and if they do not match, doesn't debug
*
* @param void
* @action tests debug pass
* @return bool success
*/
function test_debug()
{
if (!isset($_GET['DEBUG'])) {
return false;
}
if (!class_exists('Settings') || !Settings::test()) {
return false;
}
if ('' == trim(Settings::read('debug_pass'))) {
return false;
}
if (0 !== strcmp($_GET['DEBUG'], Settings::read('debug_pass'))) {
return false;
}
return true;
}
示例4: test_debug
/** function test_debug
* This function tests the debug given by the
* URL and checks it against the globals debug password
* and if they do not match, doesn't debug
*
* @param void
* @action tests debug pass
* @return bool success
*/
function test_debug()
{
if (!isset($_GET['DEBUG'])) {
return false;
}
if (!class_exists('Settings') || !Settings::test()) {
return false;
}
if ('' == trim(Settings::read('debug_pass'))) {
return false;
}
if (0 !== strcmp($_GET['DEBUG'], Settings::read('debug_pass'))) {
return false;
}
$GLOBALS['_&_DEBUG_QUERY'] = '&DEBUG=' . $_GET['DEBUG'];
$GLOBALS['_?_DEBUG_QUERY'] = '?DEBUG=' . $_GET['DEBUG'];
return true;
}
示例5: var_dump
<pre><?php
require_once 'classes/mysql.class.php';
require_once 'classes/settings.class.php';
var_dump(class_exists('Settings') && Settings::test());
?>
</pre>