当前位置: 首页>>代码示例>>PHP>>正文


PHP get_options函数代码示例

本文整理汇总了PHP中get_options函数的典型用法代码示例。如果您正苦于以下问题:PHP get_options函数的具体用法?PHP get_options怎么用?PHP get_options使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_options函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: main

function main($server_cfg)
{
    $options = get_options($server_cfg);
    foreach ($options['games'] as $game) {
        zpm_preamble($game);
        $game_cfg = load_game_config($game);
        if (!$game_cfg) {
            error_log("Daily job: Failed to load config for {$game}\n", 3, sprintf($server_cfg['log_file'], $game));
            continue;
        }
        // log_file and logger object are used by all child functions.
        $game_cfg['log_file'] = sprintf($server_cfg['log_file'], $game);
        $game_cfg['logger'] = new Logger($server_cfg, $game_cfg);
        $job = $options['job'];
        //instance detail report per game
        if ($job == "both" or $job == "report") {
            InstanceReport::generate_detail_report($server_cfg, $game_cfg, $options['timeslot'], $options['period']);
        }
        zpm_postamble($game);
    }
    //instance summary report for all games
    $job = $options['job'];
    if ($job == "both" or $job == "report") {
        InstanceReport::generate_summary_report($server_cfg, $options['timeslot'], $options['period']);
    }
}
开发者ID:shourya07,项目名称:zperfmon,代码行数:26,代码来源:daily_instance_report_job.php

示例2: main

function main($server_cfg)
{
    $options = get_options($server_cfg);
    foreach ($options['games'] as $game) {
        zpm_preamble($game);
        $game_cfg = load_game_config($game);
        if (!$game_cfg) {
            error_log("Daily job: Failed to load config for {$game}\n", 3, sprintf($server_cfg['log_file'], $game));
            continue;
        }
        // log_file and logger object are used by all child functions.
        $game_cfg['log_file'] = sprintf($server_cfg['log_file'], $game);
        $game_cfg['logger'] = new Logger($server_cfg, $game_cfg);
        $job = $options['job'];
        if ($job == "both" or $job == "daily") {
            process_daily($server_cfg, $game_cfg, $options['timeslot'], $options['period']);
        }
        //performance report
        /*
        		if ($job == "both" or $job == "report") {
        			generate_report($server_cfg, $game_cfg,
        					$options['timeslot'], $options['period']);
        		}*/
        zpm_postamble($game);
    }
}
开发者ID:shourya07,项目名称:zperfmon,代码行数:26,代码来源:daily_job.php

示例3: main

function main($server_cfg)
{
    $options = get_options();
    if (isset($options['g']) && $options['g'] !== '') {
        $game_names = explode(",", $options['g']);
    } else {
        $game_names = $server_cfg['game_list'];
    }
    foreach ($game_names as $game) {
        zpm_preamble($game);
        $game_cfg = load_game_config($game);
        $retval = null;
        // refs will start failing in 5.3.x if not declared
        $cleanup = "/usr/local/zperfmon/bin/clean.sh -g " . $game_cfg['name'] . " > /dev/null ";
        $output = system($cleanup, $retval);
        if ($retval != 0) {
            error_log("Couldn`t cleanup game {$game}", 3, sprintf($server_cfg['log_file'], $game_cfg['name']));
            continue;
        }
        $arrays_to_id = get_array_id_map($server_cfg, $game_cfg);
        foreach ($arrays_to_id as $array => $id) {
            $game_cfg = load_game_config($game, $id);
            $cleanup = "/usr/local/zperfmon/bin/clean.sh -g " . $game_cfg['name'] . " > /dev/null ";
            $output = system($cleanup, $retval);
            if ($retval != 0) {
                error_log("Couldn`t cleanup game {$game}", 3, sprintf($server_cfg['log_file'], $game_cfg['name']));
                continue;
            }
        }
        zpm_postamble($game);
    }
}
开发者ID:shourya07,项目名称:zperfmon,代码行数:32,代码来源:clean.php

示例4: admin_server

function admin_server()
{
    global $db;
    $tpl = new smarty();
    $db->query('SELECT `ID`, `verwendung`, `intervall`, `betrag`, `nextbuch` FROM ' . DB_PRE . 'ecp_clankasse_auto');
    $auto = array();
    while ($row = $db->fetch_assoc()) {
        $row['nextbuch'] = date(LONG_DATE, $row['nextbuch']);
        $row['betrag'] = number_format($row['betrag'], 2, ',', '.');
        $auto[] = $row;
    }
    $tpl->assign('auto', $auto);
    ob_start();
    $tpl->display(DESIGN . '/tpl/admin/clankasse_auto_overview.html');
    $content = ob_get_contents();
    ob_end_clean();
    $tpl->assign('overview', $content);
    $db->query('SELECT a.*, b.username FROM ' . DB_PRE . 'ecp_clankasse_transaktion as a LEFT JOIN ' . DB_PRE . 'ecp_user as b ON b.ID = vonuser ORDER BY datum DESC');
    $buchung = array();
    while ($row = $db->fetch_assoc()) {
        $row['datum'] = date(LONG_DATE, $row['datum']);
        if ($row['vonuser']) {
            $row['verwendung'] .= ' ' . FROM . ' ' . $row['username'];
        }
        $row['geld'] = number_format($row['geld'], 2, ',', '.');
        $buchung[] = $row;
    }
    $tpl->assign('buchung', $buchung);
    ob_start();
    $tpl->display(DESIGN . '/tpl/admin/clankasse_trans_overview.html');
    $content = ob_get_contents();
    ob_end_clean();
    $tpl->assign('buch_overview', $content);
    $db->query('SELECT username, userID, verwendung, monatgeld FROM ' . DB_PRE . 'ecp_clankasse_member LEFT JOIN ' . DB_PRE . 'ecp_user ON userID = ID ORDER BY username ASC');
    $user = array();
    while ($row = $db->fetch_assoc()) {
        $row['geld'] = number_format($row['monatgeld'], 2, ',', '.');
        $user[] = $row;
    }
    $tpl->assign('user', $user);
    ob_start();
    $tpl->display(DESIGN . '/tpl/admin/clankasse_user_overview.html');
    $content = ob_get_contents();
    ob_end_clean();
    $tpl->assign('user_trans', $content);
    $konto = $db->fetch_assoc('SELECT * FROM ' . DB_PRE . 'ecp_clankasse');
    $konto['kontostand'] = number_format($konto['kontostand'], 2, ',', '');
    foreach ($konto as $key => $value) {
        $tpl->assign($key, $value);
    }
    $tpl->assign('options', get_options(date('m'), date('Y')));
    ob_start();
    $tpl->display(DESIGN . '/tpl/admin/clankasse.html');
    $content = ob_get_contents();
    ob_end_clean();
    main_content(FINANCES, $content, '', 1);
}
开发者ID:ECP-Black,项目名称:ECP,代码行数:57,代码来源:clankasse.php

示例5: get_options

function get_options($array, $parent = 0, $indent = "")
{
    $return = array();
    foreach ($array as $key => $val) {
        if ($val["parent_category_id"] == $parent) {
            $return["x" . $val["category_id"]] = $indent . $val["category_name"];
            $return = array_merge($return, get_options($array, $val["category_id"], $indent . "       "));
        }
    }
    return $return;
}
开发者ID:jkmorayur,项目名称:gtech,代码行数:11,代码来源:common_helper.php

示例6: common_ticket

function common_ticket($vars, $pre)
{
    $options = get_options();
    $ticketid = $vars['ticketid'];
    $userid = $vars['userid'];
    $user = get_client_info($userid);
    $ticket = get_ticket_info($ticketid);
    if (!$user || !$ticket) {
        return;
    }
    $msg = $pre . $ticket['tid'] . ' from ' . $user['lastname'] . ' ' . $user['firstname'] . '(' . $user['email'] . ')';
    $url = $options['whmcs_host'] . '/supporttickets.php?action=view&id=' . $ticketid;
    $attach = [array('title' => $ticket['subject'], 'text' => $url)];
    send_mesage($options['channel_tickets'], $msg, $attach);
}
开发者ID:vitaliy-orlov,项目名称:whmcs-slack-notif,代码行数:15,代码来源:tickets_hook.php

示例7: __construct

 /**
  * Set up our object.
  *
  * @param string $path Project root path, should contain composer.json.
  * @param string $plugin_file Path to the plugin file calling Horme class.
  */
 public function __construct($path, $plugin_file)
 {
     $defaults = ['installed' => false, 'path' => '', 'plugins' => []];
     $options = get_option(self::OPTION_KEY, $defaults);
     // Old version... start from scratch.
     if ('1' === $options['installed']) {
         delete_option(self::OPTION_KEY);
         $options = get_options(self::OPTION_KEY, $defaults);
     }
     $this->project_path = $path;
     $this->plugin_file = plugin_basename($plugin_file);
     $this->installed = $options['installed'];
     $this->path = $options['path'];
     $this->plugins = $options['plugins'];
     $this->prepare_paths_index();
 }
开发者ID:ssnepenthe,项目名称:horme,代码行数:22,代码来源:Options.php

示例8: better_excerpt

function better_excerpt()
{
    $options = get_options();
    extract($options);
    $permalink = get_permalink($post->ID);
    $text = get_the_content();
    $text = preg_replace(" (\\[.*?\\])", '', $text);
    $text = strip_tags($text);
    $text = substr($text, 0, $length);
    $text = substr($text, 0, strripos($text, " "));
    $text = trim(preg_replace('/\\s+/', ' ', $text));
    $text = stripslashes($before_text) . $text . $ellipsis;
    if ($link_to_post == 1) {
        $text = $text . ' <a href="' . $permalink . '">' . $link_text . '</a>';
    }
    $text .= stripslashes($after_text);
    return $text;
}
开发者ID:bi0xid,项目名称:youare-plugins,代码行数:18,代码来源:betterexcerpt.php

示例9: validazione_impostazioni_tema

function validazione_impostazioni_tema($input)
{
    //echo "<pre>"; print_r( $_FILES ); echo "</pre>";
    foreach ($_FILES as $image) {
        // Controllo che sia stato effettivamente inviato un file
        if ($image['size']) {
            if (preg_match('/(jpg|jpeg|png|gif)$/i', $image['type'])) {
                $sovrascrivi = array('test_form' => false);
                $file = wp_handle_upload($image, $sovrascrivi);
                $input['logo'] = $file['url'];
            } else {
                wp_die('Nessuna immagine e&amp;grave; stata caricata');
            }
        } else {
            // Questo codice viene lanciato se non viene caricata nessuna immagine
            $opzioni = get_options('opt_impostazioni_tema');
            $input['logo'] = $opzioni['logo'];
        }
    }
    return $input;
}
开发者ID:simonkozmik,项目名称:Template-da-Zero,代码行数:21,代码来源:impostazioni_tema.php

示例10: main

function main($server_cfg)
{
    $options = get_options();
    if (isset($options['g']) && $options['g'] !== '') {
        $game_names = explode(",", $options['g']);
    } else {
        $game_names = $server_cfg['game_list'];
    }
    foreach ($game_names as $game_name) {
        zpm_preamble($game_name);
        try {
            $game_cfg = load_game_config($game_name);
            //$game_cfg = $game_cfg[$game_name];
            $now = time();
            $query_period = $now - 5 * 60;
            // 5 minutes ago
            if (isset($game_cfg['splunk_url'])) {
                $splunk_url = $game_cfg['splunk_url'];
                $splunk_user = $game_cfg['splunk_user'];
                $splunk_pass = $game_cfg['splunk_password'];
                $splunk_queries = $game_cfg['splunk_queries'];
                $splunk_collector = new SplunkCollector($splunk_url, $splunk_user, $splunk_pass);
                $splunk_store = new SplunkAdapter($game_cfg);
                foreach ($splunk_queries as $query_name => $query) {
                    $results = $splunk_collector->run_query($query, $query_period);
                    if (is_array($results)) {
                        $count = $results[0]["count"];
                        $splunk_store->store_splunk_count($now, $query_name, $count);
                    } else {
                        echo "Could not fetch {$query_name} for {$game_name}\n";
                    }
                }
            }
        } catch (Exception $e) {
        }
        zpm_postamble($game_name);
    }
}
开发者ID:shourya07,项目名称:zperfmon,代码行数:38,代码来源:get_splunk_metrics.php

示例11: get_options

/**
 * Get all Recursive Relationship into select field options
 *
 * @param $f1 = root/parent id
 * @param $table_name = name of the table
 * @param $dir = direction of breadcrumbs
*/
function get_options($f1, $table_name, $dir = 'left')
{
    $frm = '';
    $breadcr = '&laquo;&laquo;';
    if ($dir == 'right') {
        $breadcr = '&raquo;&raquo;';
    }
    $sql = "select id, parent_id, title from {$table_name} where parent_id='{$f1}' order by sort_order";
    //echo $sql;
    $res = mysql_exec($sql);
    if ($res !== false) {
        foreach ($res as $k => $v) {
            if ($v['parent_id'] != 0) {
                $frm .= '<option value="' . $v['id'] . '">' . get_uppers($v['id'], $table_name, 'right') . '</option>';
            }
            $t1 = get_options($v['id'], $table_name, $dir);
            if (!empty($t1) && $t1 != '0') {
                $frm .= $t1;
            }
        }
        //end foreach....
    }
    return $frm;
}
开发者ID:centaurustech,项目名称:collaborate-usa,代码行数:31,代码来源:func_tree.php

示例12: main

function main($server_cfg)
{
    $options = get_options();
    if (isset($options['g']) && $options['g'] !== '') {
        $game_names = explode(",", $options['g']);
    } else {
        $game_names = $server_cfg['game_list'];
    }
    $time_slots = null;
    if (!empty($options['t'])) {
        $time_slots = $options['t'];
    }
    $timestamp = $_SERVER['REQUEST_TIME'];
    $current_time_slot = (int) ($timestamp / (30 * 60));
    foreach ($game_names as $game_name) {
        zpm_preamble($game_name);
        // MODIFIED!!!! Create and mount next two timeslots !!!
        $game_cfg = load_game_config($game_name);
        if (!$game_cfg) {
            error_log("configuration for " . $game_name . " is not loaded\n", 3, sprintf($server_cfg['log_file'], $game_cfg['name']));
            continue;
        }
        $target_dir = sprintf($server_cfg['root_upload_directory'], $game_cfg["name"]);
        $target_dir = $target_dir . "/%s/" . $server_cfg["profile_upload_directory"];
        $dir_name_array = create_directory($target_dir, $current_time_slot, $server_cfg, $game_cfg);
        if ($dir_name_array === null) {
            error_log("Directory creation failed for the game " . $game_cfg['name'], 3, sprintf($server_cfg['log_file'], $game_cfg['name']));
            continue;
        }
        if ($dir_name_array === 0) {
            error_log("No Ram disk Exist!!!" . $game_cfg['name'], 3, sprintf($server_cfg['log_file'], $game_cfg['name']));
        }
        //creating new games and getting the list of web arrays to process data for
        $rs = new RightScale($server_cfg, load_game_config($game_name));
        $rs->make_array_games();
        $array_ids = $rs->get_arrays_to_serve();
        //
        // Wrap processing for each game inside a file lock
        //
        $game_lock_file = sprintf($server_cfg["zperfmon_lock_file"], $game_name);
        $game_lock_handle = grab_lock($game_lock_file, $server_cfg, $game_cfg);
        if (!$game_lock_handle) {
            error_log("Could not get exclusive lock for \"{$game_name}\"\n", 3, sprintf($server_cfg['log_file'], $game_cfg['name']));
            delete_ramdisk_data($game_name, $time_slots, $timestamp, $server_cfg, $game_cfg);
            continue;
        }
        //processing parent game
        try {
            //
            // process uploaded data
            //
            run_cron_for_game($server_cfg, $game_cfg, $time_slots);
        } catch (Exception $e) {
            error_log("Upload processing for {$game_name} failed\n", 3, sprintf($server_cfg['log_file'], $game_cfg['name']));
            error_log("Exception says: " . $e->getMessage() . "\n", 3, sprintf($server_cfg['log_file'], $game_cfg['name']));
        }
        // loop to process data for each web array
        foreach ($array_ids as $array) {
            try {
                $game_cfg = load_game_config($game_name, $array);
                if (!$game_cfg) {
                    error_log("configuration for " . $game_name . " is not loaded\n", 3, sprintf($server_cfg['log_file'], $game_cfg['name']));
                    continue;
                }
                //
                // process uploaded data
                //
                run_cron_for_game($server_cfg, $game_cfg, $time_slots);
            } catch (Exception $e) {
                error_log("Upload processing for {$game_name} failed\n", 3, sprintf($server_cfg['log_file'], $game_cfg['name']));
                error_log("Exception says: " . $e->getMessage() . "\n", 3, sprintf($server_cfg['log_file'], $game_cfg['name']));
            }
        }
        // compress for parent game
        // This implementation forces us to always pass a timeslot
        // while calling this script. otherwise compression will fail.
        $game_cfg = load_game_config($game_name);
        compress_unziped_profiles($server_cfg, $game_cfg, $time_slots);
        // Now compress the array games
        foreach ($array_ids as $array) {
            $game_cfg = load_game_config($game_name, $array);
            compress_unziped_profiles($server_cfg, $game_cfg, $time_slots);
        }
        // cleanup the lock
        drop_lock($game_lock_handle, $game_lock_file);
        zpm_postamble($game_name);
        //MODIFIED!!!!
        if ($dir_name_array != 0) {
            delete_ramdisk_data($game_name, $time_slots, $timestamp, $server_cfg, $game_cfg);
        }
    }
}
开发者ID:shourya07,项目名称:zperfmon,代码行数:92,代码来源:get_game_metrics.php

示例13: prettySatoshis

}
print "All time total payout: " . prettySatoshis($everpaid);
if ($donated > 0) {
    print "<BR><FONT SIZE=\"-1\">Total donated Eligius: " . prettySatoshis($donated) . " - <I>Thanks!</I></FONT>";
}
print "<BR><BR><HR>";
if ($savedbal) {
    print "<BR><B>Estimated Position in Payout Queue</B><BR>";
    if ($payoutqueue = apc_fetch('wizstats_payoutqueuetxt')) {
    } else {
        $payoutqueue = file_get_contents("/var/lib/eligius/{$serverid}/payout_queue.txt");
        apc_store('wizstats_payoutqueuetxt', $payoutqueue, 600);
    }
    print "<span style=\"font-size: 0.8em\">";
    if (strpos($payoutqueue, $givenuser) == false && substr($payoutqueue, 0, strlen($givenuser)) != $givenuser) {
        $options = get_options($link, $user_id);
        if (isset($options["Minimum_Payout_BTC"])) {
            $minpay = $options["Minimum_Payout_BTC"] * 100000000;
        } else {
            $minpay = 4194304;
        }
        if ($minpay < 1048576) {
            $minpay = 1048576;
        }
        if ($minpay > 2147483648) {
            $minpay = 2147483648;
        }
        $diff = $minpay - $savedbal;
        if ($diff < 0) {
            $diff = 0;
        }
开发者ID:prusso,项目名称:wizstats,代码行数:31,代码来源:userstats.php

示例14: get_options

<?php

$promoted = get_options('cop_options');
print_r($promoted);
echo 'kenny';
?>
<div class="promoted">
    <div class="item">
        <div class="wrapper">
            <img src="<?php 
echo get_template_directory_uri();
?>
/images/events_125.jpg">
            <h3><a href="#">Events Calendar</a></h3>
        </div>
    </div>
    <div class="item">
        <div class="wrapper">
            <img src="<?php 
echo get_template_directory_uri();
?>
/images/meetings_125.jpg">
            <h3><a href="#">City Meetings</a></h3>
        </div>
    </div>
    <div class="item">
        <div class="wrapper">
            <img src="<?php 
echo get_template_directory_uri();
?>
/images/trails_125.jpg">
开发者ID:CityOfPrescott,项目名称:tabula-rasa_city-of-prescott,代码行数:31,代码来源:promoted.php

示例15: main

function main($server_cfg)
{
    $options = get_options();
    if (isset($options['g']) && $options['g'] !== '') {
        $game_names = explode(",", $options['g']);
    } else {
        $game_names = $server_cfg['game_list'];
    }
    $time_slot = null;
    if (!empty($options['t'])) {
        $time_slot = $options['t'];
    }
    foreach ($game_names as $game_name) {
        // Top5 metrics file for this time slot
        $top5_file = sprintf($server_cfg['top5_file'], $game_name, (string) $time_slot);
        error_log("top5 file is {$top5_file}\n", 3, sprintf($server_cfg['log_file'], $game_name));
        if (file_exists($top5_file)) {
            $top5 = igbinary_unserialize(file_get_contents($top5_file));
            error_log(sprintf("top5 file exists: %d byte\n", filesize($top5_file), 3, sprintf($server_cfg['log_file'], $game_name)));
        } else {
            $top5 = array();
            error_log("No top5 file\n", 3, sprintf($server_cfg['log_file'], $game_name));
        }
        $output = move_slow_page($server_cfg, $game_name, $time_slot, $top5);
        error_log(sprintf("in main: top5 list has %d lines\n", count($top5)), 3, sprintf($server_cfg['log_file'], $game_name));
        // Dump updated top5 to file
        file_put_contents($top5_file, igbinary_serialize($top5));
        print json_encode($output);
    }
}
开发者ID:shourya07,项目名称:zperfmon,代码行数:30,代码来源:move_slowpages.php


注:本文中的get_options函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。