コード例 #1
0
ファイル: get.php プロジェクト: Artea/freebeer
function do_option($option)
{
    switch ($option) {
        case 0:
            global $options;
            foreach ($options as $key => $value) {
                if ($key == 0) {
                    continue;
                }
                do_option($key);
                echo "<hr />\n";
            }
            break;
        case 1:
            echo "get_declared_classes()=";
            $a = get_declared_classes();
            ksort($a);
            print_r($a);
            foreach ($a as $class) {
                echo "get_class_methods('{$class}')=";
                $b = get_class_methods($class);
                sort($b);
                print_r($b);
            }
            break;
        case 2:
            $a = get_loaded_extensions();
            echo "get_loaded_extensions()=";
            sort($a);
            print_r($a);
            break;
        case 3:
            $a = get_loaded_extensions();
            sort($a);
            foreach ($a as $ext) {
                echo "get_extension_funcs('{$ext}')=";
                $b = get_extension_funcs($ext);
                sort($b);
                print_r($b);
            }
            break;
        case 4:
            echo "get_user_constants()=";
            $a = get_defined_constants();
            $user_constants = array();
            foreach ($a as $key => $value) {
                if (isset($PHP_CONSTANTS[$key])) {
                    continue;
                }
                $user_constants[$key] = $value;
            }
            ksort($user_constants);
            print_r($user_constants);
            break;
        case 5:
            echo "get_defined_constants()=";
            $a = get_defined_constants();
            ksort($a);
            print_r($a);
            break;
        case 6:
            echo "ini_get_all()=";
            if (function_exists('ini_get_all')) {
                $a = ini_get_all();
                ksort($a);
                print_r($a);
            } else {
                echo "not available in PHP version ", phpversion(), "\n";
            }
            break;
        case 7:
            echo "ini_get_all() (different)=";
            if (function_exists('ini_get_all')) {
                $a = ini_get_all();
                $diff = array();
                foreach ($a as $key => $value) {
                    if ($value['global_value'] != $value['local_value']) {
                        $diff[$key] = $value;
                    }
                }
                ksort($diff);
                print_r($diff);
            } else {
                echo "not available in PHP version ", phpversion(), "\n";
            }
            break;
        case 8:
            if (function_exists('dba_handlers')) {
                echo "dba_handlers()=";
                $a = dba_handlers();
                ksort($a);
                print_r($a);
            }
            break;
        case 9:
            echo "getrandmax()=", getrandmax(), "\n";
            echo "mt_getrandmax()=", mt_getrandmax(), "\n";
            break;
        case 10:
            if (function_exists('stream_get_wrappers')) {
                echo "stream_get_wrappers()=";
                $a = stream_get_wrappers();
                ksort($a);
                print_r($a);
            }
            break;
        case 11:
            echo "\$_ENV=";
            $a = $_ENV;
            ksort($a);
            print_r($a);
            break;
        case 12:
            echo "\$_SERVER=";
            $a = $_SERVER;
            ksort($a);
            print_r($a);
            break;
        default:
            break;
    }
}
コード例 #2
0
ファイル: preferences.php プロジェクト: kawf/kawf
        $success .= "Timezone has been set to " . $_REQUEST['timezone'] . "\n";
    */
    $user->set_timezone($_REQUEST['timezone']);
    $user->update();
}
do_option('ShowOffTopic');
#do_option('ShowModerated');
do_option('Collapsed');
do_option('CollapseOffTopic');
do_option('SecretEmail');
do_option('SimpleHTML');
do_option('FlatThread');
do_option('AutoTrack');
do_option('HideSignatures');
do_option('AutoUpdateTracking');
do_option('OldestFirst');
if (!empty($success)) {
    $text = $success . "<br>\n";
} else {
    $text = "";
}
$text .= 'To change your password or update your preferences, please fill out the information below and click "Update".';
if (empty($error)) {
    $tpl->set_var("error", "");
} else {
    $tpl->set_var("ERROR", $error);
}
if (empty($user->signature)) {
    $tpl->set_var("signature", "");
}
$tpl->set_var("SIGNATURE_COOKED", nl2brPre::out($user->signature));