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


PHP check_cache函数代码示例

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


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

示例1: tpl_function_qishi_get_salary_data_salary_pie

function tpl_function_qishi_get_salary_data_salary_pie($params, &$smarty)
{
    global $db, $_CFG;
    $arr = explode(',', $params['set']);
    foreach ($arr as $str) {
        $a = explode(':', $str);
        switch ($a[0]) {
            case "调用名称":
                $aset['alias'] = $a[1];
                break;
            case "列表名":
                $aset['listname'] = $a[1];
                break;
            case "地区":
                $aset['district'] = $a[1];
                break;
            case "职位":
                $aset['category'] = $a[1];
                break;
        }
    }
    $filename = urlencode($aset['district'] . '_' . $aset['category']) . '_salary_pie.cache';
    $result = check_cache($filename, 'salary', 7);
    if (!$result) {
        $result = dfopen("http://www.74cms.com/salary/get_salary_data_salary_pie.php?district=" . $aset['district'] . "&category=" . $aset['category'] . "&certification=" . $_SERVER['SERVER_NAME']);
        write_cache($filename, $result, 'salary');
    }
    $smarty->assign($aset['listname'], $result);
}
开发者ID:winiceo,项目名称:job,代码行数:29,代码来源:function.qishi_get_salary_data_salary_pie.php

示例2: get_request

$filters		= get_request("f", "");

if ($new_width == 0 && $new_height == 0) {
	$new_width = 100;
	$new_height = 100;
}

// set path to cache directory (default is ./cache)
// this can be changed to a different location
$cache_dir = './cache';

// get mime type of src
$mime_type = mime_type($src);

// check to see if this image is in the cache already
check_cache( $cache_dir, $mime_type );

// if not in cache then clear some space and generate a new file
cleanCache();

ini_set('memory_limit', "30M");

// make sure that the src is gif/jpg/png
if(!valid_src_mime_type($mime_type)) {
	displayError("Invalid src mime type: " .$mime_type);
}

// check to see if GD function exist
if(!function_exists('imagecreatetruecolor')) {
	displayError("GD Library Error: imagecreatetruecolor does not exist");
}
开发者ID:nebirhos,项目名称:cargopress,代码行数:31,代码来源:timthumb.php

示例3: __destruct

 /**
  * Destructor
  * Here we'll write out the internal file path caches to an external cache of some sort.
  */
 public function __destruct()
 {
     // Bug 28309 - Set the current directory to one which we expect it to be (i.e. the root directory of the install
     set_include_path(realpath(dirname(__FILE__) . '/../..') . PATH_SEPARATOR . get_include_path());
     chdir(realpath(dirname(__FILE__) . '/../..'));
     // Bug 30807/30808 - Re-setup the external cache since the object isn't there when calling this method.
     $GLOBALS['external_cache_checked'] = false;
     check_cache();
     // clear out the cache on destroy if we are asked to
     if ($this->_clearCacheOnDestroy) {
         if (is_file($GLOBALS['sugar_config']['cache_dir'] . $this->getFilePath() . '/pathCache.php')) {
             unlink($GLOBALS['sugar_config']['cache_dir'] . $this->getFilePath() . '/pathCache.php');
         }
         if ($GLOBALS['external_cache_enabled'] && $GLOBALS['external_cache_type'] != 'base-in-memory') {
             sugar_cache_clear('theme_' . $this->dirName . '_jsCache');
             sugar_cache_clear('theme_' . $this->dirName . '_cssCache');
             sugar_cache_clear('theme_' . $this->dirName . '_imageCache');
             sugar_cache_clear('theme_' . $this->dirName . '_templateCache');
         }
     } elseif (!inDeveloperMode()) {
         // push our cache into the sugar cache
         if ($GLOBALS['external_cache_enabled'] && $GLOBALS['external_cache_type'] != 'base-in-memory') {
             // only update the caches if they have been changed in this request
             if (count($this->_jsCache) != $this->_initialCacheSize['jsCache']) {
                 sugar_cache_put('theme_' . $this->dirName . '_jsCache', $this->_jsCache);
             }
             if (count($this->_cssCache) != $this->_initialCacheSize['cssCache']) {
                 sugar_cache_put('theme_' . $this->dirName . '_cssCache', $this->_cssCache);
             }
             if (count($this->_imageCache) != $this->_initialCacheSize['imageCache']) {
                 sugar_cache_put('theme_' . $this->dirName . '_imageCache', $this->_imageCache);
             }
             if (count($this->_templateCache) != $this->_initialCacheSize['templateCache']) {
                 sugar_cache_put('theme_' . $this->dirName . '_templateCache', $this->_templateCache);
             }
         } elseif (count($this->_jsCache) != $this->_initialCacheSize['jsCache'] || count($this->_cssCache) != $this->_initialCacheSize['cssCache'] || count($this->_imageCache) != $this->_initialCacheSize['imageCache'] || count($this->_templateCache) != $this->_initialCacheSize['templateCache']) {
             sugar_file_put_contents(create_cache_directory($this->getFilePath() . '/pathCache.php'), serialize(array('jsCache' => $this->_jsCache, 'cssCache' => $this->_cssCache, 'imageCache' => $this->_imageCache, 'templateCache' => $this->_templateCache)));
         }
     } elseif ($GLOBALS['external_cache_enabled']) {
         sugar_cache_clear('theme_' . $this->dirName . '_jsCache');
         sugar_cache_clear('theme_' . $this->dirName . '_cssCache');
         sugar_cache_clear('theme_' . $this->dirName . '_imageCache');
         sugar_cache_clear('theme_' . $this->dirName . '_templateCache');
     }
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:49,代码来源:SugarTheme.php

示例4: COUNT

     }
     //独立ip数据单独统计
     $arr['yesterday'][4] = $db->get_total("SELECT COUNT(distinct ip) AS num FROM " . table('company_praise') . " WHERE company_id={$company_profile['id']} AND addtime={$yesterday} ");
     $arr['week'][4] = $db->get_total("SELECT COUNT(distinct ip) AS num FROM " . table('company_praise') . " WHERE company_id={$company_profile['id']} AND addtime={$week} ");
     $arr['last_week'][4] = $db->get_total("SELECT COUNT(distinct ip) AS num FROM " . table('company_praise') . " WHERE company_id={$company_profile['id']} AND addtime>={$last_week_day_begin} AND addtime<={$last_week_day_end} ");
     $arr['month'][4] = $db->get_total("SELECT COUNT(distinct ip) AS num FROM " . table('company_praise') . " WHERE company_id={$company_profile['id']} AND addtime={$month_day} ");
     $arr['last_month'][4] = $db->get_total("SELECT COUNT(distinct ip) AS num FROM " . table('company_praise') . " WHERE company_id={$company_profile['id']} AND addtime>={$month_day_begin} AND addtime<={$month_day_end} ");
     $arr['total'][4] = $db->get_total("SELECT COUNT(distinct ip) AS num FROM " . table('company_praise') . " WHERE company_id={$company_profile['id']} ");
     write_cache('u' . $_SESSION['uid'] . '_wzp_tabledata.cache', json_encode($arr), 'wzp');
 }
 /**
  * 图表统计start
  **/
 $filter = intval($_GET['settr']) > 0 ? intval($_GET['settr']) : 7;
 $check_categories_cache = check_cache('u' . $_SESSION['uid'] . '_wzp_categories_' . $filter . '.cache', 'wzp');
 $check_dataset_cache = check_cache('u' . $_SESSION['uid'] . '_wzp_dataset_' . $filter . '.cache', 'wzp');
 if ($check_categories_cache && $check_dataset_cache) {
     $categories = $check_categories_cache;
     $dataset = $check_dataset_cache;
 } else {
     for ($i = $filter; $i > 0; $i--) {
         $labelArr[] = strtotime(date('Y-m-d', time() - $i * 86400));
     }
     $line_data = $db->getall("select * from " . table('company_praise') . " where  company_id = {$company_profile['id']} AND  addtime>" . strtotime(date('Y-m-d', time() - $filter * 86400)) . " order by addtime asc");
     foreach ($line_data as $key => $value) {
         $line[$value['click_type']][$value['addtime']] += 1;
     }
     $item = 0;
     foreach ($labelArr as $key => $value) {
         $label[$item]['label'] = date('m-d', $value);
         $lineData[0][$item]['value'] = intval($line[1][$value]);
开发者ID:winiceo,项目名称:fenzhan,代码行数:31,代码来源:company_jobs.php

示例5: display_message

function display_message($msg)
{
    global $contents;
    $contents .= $msg;
    echo $msg;
}
function check_cache()
{
    if (file_exists('postinstall_results.res')) {
        if (time() - filemtime('postinstall_results.res') < 120) {
            echo file_get_contents('postinstall_results.res');
            exit;
        }
    }
}
check_cache();
$contents = '';
//Check username and private key
display_message("Checking username and private key... ");
if (empty($openinviter_settings['username']) or empty($openinviter_settings['private_key'])) {
    display_message("Username or private key missing.Get your own at <a href='http://openinviter.com/register.php'>OpenInviter</a><br>\n");
    exit;
} else {
    display_message("*OK*<br>\n");
}
//Check PHP version
display_message("Checking PHP version... ");
if (version_compare(PHP_VERSION, '5.0.0', '<')) {
    display_message("*NOT OK* - OpenInviter requires PHP5, your server has PHP " . PHP_VERSION . " installed");
    exit;
} else {
开发者ID:stripthis,项目名称:donate,代码行数:31,代码来源:postinstall_old.php

示例6: intval

$template->assign_vars(array('L_PNPHPBB2_OPTIONS' => $lang['pnphpbb2_options'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_FIRST_POST' => $lang['First_Post'], 'L_LAST_POST' => $lang['Last_Post'], 'L_CONFIGURATION_TITLE' => $lang['pnphpbb2_settings'], 'L_CONFIGURATION_EXPLAIN' => $lang['pnphpbb2_settings_explain'], 'L_PNPHPBB2_LOGO_ON' => "<b>" . $lang['pnphpbb2_logo_on'] . "</b>", 'L_PNPHPBB2_LOGO_ON_EXPLAIN' => $lang['pnphpbb2_logo_on_explain'], 'L_PNPHPBB2_QUICKREPLY' => "<b>" . $lang['pnphpbb2_quickreply'] . "</b>", 'L_PNPHPBB2_QUICKREPLY_EXPLAIN' => $lang['pnphpbb2_quickreply_explain'], 'L_PNPHPBB2_QUICKREPLY_ADV' => $lang['Advanced_mode'], 'L_PNPHPBB2_SHORTURLS' => "<b>" . $lang['pnphpbb2_shorturls'] . "</b>", 'L_PNPHPBB2_SHORTURLS_EXPLAIN' => $lang['pnphpbb2_shorturls_explain'], 'L_PNPHPBB2_POST_CONFIRM' => "<b>" . $lang['pnphpbb2_post_confirm'] . "</b>", 'L_PNPHPBB2_POST_CONFIRM_EXPLAIN' => $lang['pnphpbb2_post_confirm_explain'], 'L_PNPHPBB2_POST_ORDER' => "<b>" . $lang['pnphpbb2_post_order'] . "</b>", 'L_PNPHPBB2_POST_ORDER_EXPLAIN' => $lang['pnphpbb2_post_order_explain'], 'L_PNPHPBB2_ALLOW_FULL_PAGE' => "<b>" . $lang['pnphpbb2_allow_full_page'] . "</b>", 'L_PNPHPBB2_ALLOW_FULL_PAGE_EXPLAIN' => $lang['pnphpbb2_allow_full_page_explain'], 'L_PNPHPBB2_FULL_PAGE' => "<b>" . $lang['pnphpbb2_full_page'] . "</b>", 'L_PNPHPBB2_FULL_PAGE_EXPLAIN' => $lang['pnphpbb2_full_page_explain'], 'L_PNPHPBB2_PN_PM' => "<b>" . $lang['pnphpbb2_pn_pm'] . "</b>", 'L_PNPHPBB2_PN_PM_EXPLAIN' => $lang['pnphpbb2_pn_pm_explain'], 'L_PNPHPBB2_PN_LINK' => "<b>" . $lang['pnphpbb2_pn_link'] . "</b>", 'L_PNPHPBB2_PN_LINK_EXPLAIN' => $lang['pnphpbb2_pn_link_explain'], 'L_PNPHPBB2_PN_TEXT' => "<b>" . $lang['pnphpbb2_pn_text'] . "</b>", 'L_PNPHPBB2_PN_TEXT_EXPLAIN' => $lang['pnphpbb2_pn_text_explain'], 'L_PNPHPBB2_TEMPLATE_COMPILER' => "<b>" . $lang['pnphpbb2_template_compiler'] . "</b>", 'L_PNPHPBB2_TEMPLATE_COMPILER_EXPLAIN' => $lang['pnphpbb2_template_compiler_explain'], 'L_PNPHPBB2_MEMBERS_ONLINE' => "<b>" . $lang['pnphpbb2_members_online'] . "</b>", 'L_PNPHPBB2_MEMBERS_ONLINE_EXPLAIN' => $lang['pnphpbb2_members_online_explain'], 'L_PNPHPBB2_MEMBERS_ONLINE_ANNON' => "<b>" . $lang['pnphpbb2_members_online_annon'] . "</b>", 'L_PNPHPBB2_MEMBERS_ONLINE_ANNON_EXPLAIN' => $lang['pnphpbb2_members_online_annon_explain'], 'L_PNPHPBB2_ALLOW_SUB_CHANGE' => "<b>" . $lang['pnphpbb2_allow_sub_change'] . "</b>", 'L_PNPHPBB2_ALLOW_SUB_CHANGE_EXPLAIN' => $lang['pnphpbb2_allow_sub_change_explain'], 'PNPHPBB2_LOGO_ON' => intval($board_config['pnphpbb2_logo_on']), 'PNPHPBB2_MEMBERS_ONLINE' => intval($board_config['pnphpbb2_members_online']), 'PNPHPBB2_QUICKREPLY' => intval($board_config['pnphpbb2_quickreply']), 'PNPHPBB2_SHORTURLS' => intval($board_config['pnphpbb2_shorturls']), 'PNPHPBB2_POST_CONFIRM' => intval($board_config['pnphpbb2_post_confirm']), 'PNPHPBB2_POST_ORDER' => intval($board_config['pnphpbb2_post_order']), 'PNPHPBB2_FULL_PAGE' => intval($board_config['pnphpbb2_full_page']), 'PNPHPBB2_ALLOW_FULL_PAGE' => intval($board_config['pnphpbb2_allow_full_page']), 'PNPHPBB2_PN_PM' => intval($board_config['pnphpbb2_pn_pm']), 'PNPHPBB2_PN_LINK' => htmlspecialchars($board_config['pnphpbb2_pn_link']), 'PNPHPBB2_PN_TEXT' => htmlspecialchars($board_config['pnphpbb2_pn_text']), 'PNPHPBB2_TEMPLATE_COMPILER' => intval($board_config['pnphpbb2_template_compiler']), 'PNPHPBB2_MEMBERS_ONLINE' => intval($board_config['pnphpbb2_members_online']), 'PNPHPBB2_MEMBERS_ONLINE_ANNON' => intval($board_config['pnphpbb2_members_online_annon']), 'PNPHPBB2_ALLOW_SUB_CHANGE' => intval($board_config['pnphpbb2_allow_sub_change']), 'S_PNPHPBB2_LOGO_ON_YES' => $board_config['pnphpbb2_logo_on'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_LOGO_ON_NO' => !$board_config['pnphpbb2_logo_on'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_QUICKREPLY_YES' => $board_config['pnphpbb2_quickreply'] == 1 ? "checked=\"checked\"" : "", 'S_PNPHPBB2_QUICKREPLY_NO' => $board_config['pnphpbb2_quickreply'] == 0 ? "checked=\"checked\"" : "", 'S_PNPHPBB2_QUICKREPLY_ADV' => $board_config['pnphpbb2_quickreply'] == 2 ? "checked=\"checked\"" : "", 'S_PNPHPBB2_SHORTURLS_YES' => $board_config['pnphpbb2_shorturls'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_SHORTURLS_NO' => !$board_config['pnphpbb2_shorturls'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_POST_ORDER_NEWEST' => $board_config['pnphpbb2_post_order'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_POST_ORDER_OLDEST' => !$board_config['pnphpbb2_post_order'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_POST_CONFIRM_YES' => $board_config['pnphpbb2_post_confirm'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_POST_CONFIRM_NO' => !$board_config['pnphpbb2_post_confirm'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_ALLOW_FULL_PAGE_YES' => $board_config['pnphpbb2_allow_full_page'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_ALLOW_FULL_PAGE_NO' => !$board_config['pnphpbb2_allow_full_page'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_FULL_PAGE_YES' => $board_config['pnphpbb2_full_page'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_FULL_PAGE_NO' => !$board_config['pnphpbb2_full_page'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_PN_PM_YES' => $board_config['pnphpbb2_pn_pm'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_PN_PM_NO' => !$board_config['pnphpbb2_pn_pm'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_PN_LINK' => htmlspecialchars($board_config['pnphpbb2_pn_link']), 'S_PNPHPBB2_PN_TEXT' => htmlspecialchars($board_config['pnphpbb2_pn_text']), 'S_PNPHPBB2_TEMPLATE_COMPILER_YES' => $board_config['pnphpbb2_template_compiler'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_TEMPLATE_COMPILER_NO' => !$board_config['pnphpbb2_template_compiler'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_MEMBERS_ONLINE_YES' => $board_config['pnphpbb2_members_online'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_MEMBERS_ONLINE_NO' => !$board_config['pnphpbb2_members_online'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_MEMBERS_ONLINE_ANNON_YES' => $board_config['pnphpbb2_members_online_annon'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_MEMBERS_ONLINE_ANNON_NO' => !$board_config['pnphpbb2_members_online_annon'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_ALLOW_SUB_CHANGE_YES' => $board_config['pnphpbb2_allow_sub_change'] ? "checked=\"checked\"" : "", 'S_PNPHPBB2_ALLOW_SUB_CHANGE_NO' => !$board_config['pnphpbb2_allow_sub_change'] ? "checked=\"checked\"" : "", 'L_THEME_MATCHING' => '<b>' . $lang['theme_matching'] . '</b>', 'L_THEME_MATCHING_EXPLAIN' => $lang['theme_matching_explain'], 'THEME_MATCHING' => intval($board_config['theme_matching']), 'S_THEME_MATCHING_YES' => $board_config['theme_matching'] ? "checked=\"checked\"" : "", 'S_THEME_MATCHING_NO' => !$board_config['theme_matching'] ? "checked=\"checked\"" : "", 'L_EDIT_TIME' => '<b>' . $lang['edit_time'] . '</b>', 'L_EDIT_TIME_EXPLAIN' => $lang['edit_time_explain'], 'EDIT_TIME' => intval($board_config['edit_time']), "L_PNPHPBB2_ANNOUNCEMENT_SETTINGS" => $lang['announce_settings'], "L_PNPHPBB2_ENABLE_ACCOUNCE" => "<b>" . $lang['enable_announce'] . "</b>", "L_PNPHPBB2_ENABLE_ACCOUNCE_EXPLAIN" => $lang['enable_announce_explain'], "PNPHPBB2_ENABLE_ACCOUNCE" => intval($board_config['pnphpbb2_enable_announce']), "PNPHPBB2_ENABLE_ACCOUNCE_YES" => $board_config['pnphpbb2_enable_announce'] ? "checked=\"checked\"" : "", "PNPHPBB2_ENABLE_ACCOUNCE_NO" => !$board_config['pnphpbb2_enable_announce'] ? "checked=\"checked\"" : "", "L_PNPHPBB2_ANNOUNCEMENT_DURATION" => "<b>" . $lang['announcement_duration'] . "</b>", "L_PNPHPBB2_ANNOUNCEMENT_DURATION_EXPLAIN" => $lang['announcement_duration_explain'], "PNPHPBB2_ANNOUNCEMENT_DURATION" => intval($board_config['pnphpbb2_announcement_duration']), "L_PNPHPBB2_SPLIT_GLOBAL_ANNOUNCE" => "<b>" . $lang['split_global_announce'] . "</b>", "PNPHPBB2_SPLIT_GLOBAL_ANNOUNCE" => intval($board_config['pnphpbb2_split_global_announce']), "PNPHPBB2_SPLIT_GLOBAL_ANNOUNCE_YES" => $board_config['pnphpbb2_split_global_announce'] ? "checked=\"checked\"" : "", "PNPHPBB2_SPLIT_GLOBAL_ANNOUNCE_NO" => !$board_config['pnphpbb2_split_global_announce'] ? "checked=\"checked\"" : "", "L_PNPHPBB2_SPLIT_ANNOUNCE" => "<b>" . $lang['split_announce'] . "</b>", "PNPHPBB2_SPLIT_ANNOUNCE" => intval($board_config['pnphpbb2_split_announce']), "PNPHPBB2_SPLIT_ANNOUNCE_YES" => $board_config['pnphpbb2_split_announce'] ? "checked=\"checked\"" : "", "PNPHPBB2_SPLIT_ANNOUNCE_NO" => !$board_config['pnphpbb2_split_announce'] ? "checked=\"checked\"" : "", "L_PNPHPBB2_SPLIT_STICKY" => "<b>" . $lang['split_sticky'] . "</b>", "PNPHPBB2_SPLIT_STICKY" => intval($board_config['pnphpbb2_split_sticky']), "PNPHPBB2_SPLIT_STICKY_YES" => $board_config['pnphpbb2_split_sticky'] ? "checked=\"checked\"" : "", "PNPHPBB2_SPLIT_STICKY_NO" => !$board_config['pnphpbb2_split_sticky'] ? "checked=\"checked\"" : "", "L_PNPHPBB2_SUB_FORUM" => "<b>" . $lang['Use_sub_forum'] . "</b>", "L_PNPHPBB2_SUB_FORUM_EXPLAIN" => $lang['Use_sub_forum_explain'], "PNPHPBB2_SUB_FORUM_YES" => $board_config['pnphpbb2_sub_forum'] ? "checked=\"checked\"" : "", "PNPHPBB2_SUB_FORUM_NO" => !$board_config['pnphpbb2_sub_forum'] ? "checked=\"checked\"" : "", "PNPHPBB2_SUB_FORUM" => intval($board_config['pnphpbb2_sub_forum']), "L_PNPHPBB2_HIERARCHY_SETTINGS" => $lang['Hierarchy_setting'], 'S_MODE_ACTION' => append_sid('admin_pnphpbb2.' . $phpEx)));
if ($board_config['pnphpbb2_template_compiler'] == 1) {
    // test cache
    $filename = $template->make_filename('_xs_test.tpl');
    $filename2 = $template->make_filename_cache($filename);
    $str = '';
    if (!check_cache($filename2)) {
        $template->assign_block_vars('switch_xs_warning', array());
    }
    @unlink($filename2);
    $debug1 = $str;
    // test cache
    $filename3 = $template->make_filename('admin/_admin_xs_test.tpl');
    $filename4 = $template->make_filename_cache($filename3);
    $str = '';
    check_cache($filename4);
    @unlink($filename4);
    $debug2 = $str;
    // add realpath
    if (@function_exists('realpath') && @realpath($phpbb_root_path . 'includes/template.' . $phpEx)) {
        $str = @realpath($filename);
        if ($str && $str !== $filename) {
            $filename = $filename . '<br />(' . $str . ')';
        }
        $str = @realpath($filename2);
        if ($str && $str !== $filename2) {
            $filename2 = $filename2 . '<br />(' . $str . ')';
        }
        $str = @realpath($filename3);
        if ($str && $str !== $filename3) {
            $filename3 = $filename3 . '<br />(' . $str . ')';
开发者ID:nmpetkov,项目名称:ZphpBB2,代码行数:31,代码来源:admin_pnphpbb2.php

示例7: ss_get_by_ssh

function ss_get_by_ssh($options)
{
    global $debug, $cache_dir, $poll_time;
    # Build and test the type-specific function names.
    $caching_func = "{$options['type']}_cachefile";
    $cmdline_func = "{$options['type']}_cmdline";
    $parsing_func = "{$options['type']}_parse";
    $getting_func = "{$options['type']}_get";
    debug("Functions: '{$caching_func}', '{$cmdline_func}', '{$parsing_func}'");
    if (!function_exists($cmdline_func)) {
        die("The parsing function '{$cmdline_func}' does not exist");
    }
    if (!function_exists($parsing_func)) {
        die("The parsing function '{$parsing_func}' does not exist");
    }
    # Check the cache.
    $fp = null;
    if (!isset($options['file']) && $cache_dir && !isset($options['nocache']) && function_exists($caching_func)) {
        $cache_file = call_user_func($caching_func, $options);
        $cache_res = check_cache($cache_dir, $poll_time, $cache_file, $options);
        if ($cache_res[1]) {
            debug("The cache is usable.");
            return extract_desired($options, $cache_res[1]);
        } elseif ($cache_res[0]) {
            $fp = $cache_res[0];
            debug("Got a filehandle to the cache file");
        }
    }
    if (!$fp) {
        debug("Caching is disabled.");
    }
    # There might be a custom function that overrides the SSH fetch.
    if (!isset($options['file']) && function_exists($getting_func)) {
        debug("{$getting_func}() is defined, will call it");
        $output = call_user_func($getting_func, $options);
    } else {
        # Get the command-line to fetch the data, then fetch and parse the data.
        debug("No getting_func(), will use normal code path");
        $cmd = call_user_func($cmdline_func, $options);
        debug($cmd);
        $output = get_command_result($cmd, $options);
    }
    debug($output);
    $result = call_user_func($parsing_func, $options, $output);
    # Define the variables to output.  I use shortened variable names so maybe
    # it'll all fit in 1024 bytes for Cactid and Spine's benefit.  This list must
    # come right after the word MAGIC_VARS_DEFINITIONS.  The Perl script parses
    # it and uses it as a Perl variable.
    $keys = array('Requests' => 'a0', 'Bytes_sent' => 'a1', 'Idle_workers' => 'a2', 'Busy_workers' => 'a3', 'CPU_Load' => 'a4', 'Waiting_for_connection' => 'a5', 'Starting_up' => 'a6', 'Reading_request' => 'a7', 'Sending_reply' => 'a8', 'Keepalive' => 'a9', 'DNS_lookup' => 'aa', 'Closing_connection' => 'ab', 'Logging' => 'ac', 'Gracefully_finishing' => 'ad', 'Idle_cleanup' => 'ae', 'Open_slot' => 'af', 'STAT_CPU_user' => 'ag', 'STAT_CPU_nice' => 'ah', 'STAT_CPU_system' => 'ai', 'STAT_CPU_idle' => 'aj', 'STAT_CPU_iowait' => 'ak', 'STAT_CPU_irq' => 'al', 'STAT_CPU_softirq' => 'am', 'STAT_CPU_steal' => 'an', 'STAT_CPU_guest' => 'ao', 'STAT_interrupts' => 'ap', 'STAT_context_switches' => 'aq', 'STAT_forks' => 'ar', 'STAT_loadavg' => 'as', 'STAT_numusers' => 'at', 'STAT_memcached' => 'au', 'STAT_membuffer' => 'av', 'STAT_memshared' => 'aw', 'STAT_memfree' => 'ax', 'STAT_memused' => 'ay', 'NGINX_active_connections' => 'az', 'NGINX_server_accepts' => 'b0', 'NGINX_server_handled' => 'b1', 'NGINX_server_requests' => 'b2', 'NGINX_reading' => 'b3', 'NGINX_writing' => 'b4', 'NGINX_waiting' => 'b5', 'MEMC_rusage_user' => 'b6', 'MEMC_rusage_system' => 'b7', 'MEMC_curr_items' => 'b8', 'MEMC_total_items' => 'b9', 'MEMC_bytes' => 'ba', 'MEMC_curr_connections' => 'bb', 'MEMC_total_connections' => 'bc', 'MEMC_cmd_get' => 'bd', 'MEMC_cmd_set' => 'be', 'MEMC_get_misses' => 'bf', 'MEMC_evictions' => 'bg', 'MEMC_bytes_read' => 'bh', 'MEMC_bytes_written' => 'bi', 'DISK_reads' => 'bj', 'DISK_reads_merged' => 'bk', 'DISK_sectors_read' => 'bl', 'DISK_time_spent_reading' => 'bm', 'DISK_writes' => 'bn', 'DISK_writes_merged' => 'bo', 'DISK_sectors_written' => 'bp', 'DISK_time_spent_writing' => 'bq', 'DISK_io_ops_in_progress' => 'br', 'DISK_io_time' => 'bs', 'DISK_io_time_weighted' => 'bt', 'OPVZ_kmemsize_held' => 'bu', 'OPVZ_kmemsize_failcnt' => 'bv', 'OPVZ_lockedpages_held' => 'bw', 'OPVZ_lockedpages_failcnt' => 'bx', 'OPVZ_privvmpages_held' => 'by', 'OPVZ_privvmpages_failcnt' => 'bz', 'OPVZ_shmpages_held' => 'c0', 'OPVZ_shmpages_failcnt' => 'c1', 'OPVZ_numproc_held' => 'c2', 'OPVZ_numproc_failcnt' => 'c3', 'OPVZ_physpages_held' => 'c4', 'OPVZ_physpages_failcnt' => 'c5', 'OPVZ_vmguarpages_held' => 'c6', 'OPVZ_vmguarpages_failcnt' => 'c7', 'OPVZ_oomguarpages_held' => 'c8', 'OPVZ_oomguarpages_failcnt' => 'c9', 'OPVZ_numtcpsock_held' => 'ca', 'OPVZ_numtcpsock_failcnt' => 'cb', 'OPVZ_numflock_held' => 'cc', 'OPVZ_numflock_failcnt' => 'cd', 'OPVZ_numpty_held' => 'ce', 'OPVZ_numpty_failcnt' => 'cf', 'OPVZ_numsiginfo_held' => 'cg', 'OPVZ_numsiginfo_failcnt' => 'ch', 'OPVZ_tcpsndbuf_held' => 'ci', 'OPVZ_tcpsndbuf_failcnt' => 'cj', 'OPVZ_tcprcvbuf_held' => 'ck', 'OPVZ_tcprcvbuf_failcnt' => 'cl', 'OPVZ_othersockbuf_held' => 'cm', 'OPVZ_othersockbuf_failcnt' => 'cn', 'OPVZ_dgramrcvbuf_held' => 'co', 'OPVZ_dgramrcvbuf_failcnt' => 'cp', 'OPVZ_numothersock_held' => 'cq', 'OPVZ_numothersock_failcnt' => 'cr', 'OPVZ_dcachesize_held' => 'cs', 'OPVZ_dcachesize_failcnt' => 'ct', 'OPVZ_numfile_held' => 'cu', 'OPVZ_numfile_failcnt' => 'cv', 'OPVZ_numiptent_held' => 'cw', 'OPVZ_numiptent_failcnt' => 'cx', 'REDIS_connected_clients' => 'cy', 'REDIS_connected_slaves' => 'cz', 'REDIS_used_memory' => 'd0', 'REDIS_changes_since_last_save' => 'd1', 'REDIS_total_connections_received' => 'd2', 'REDIS_total_commands_processed' => 'd3', 'JMX_heap_memory_used' => 'd4', 'JMX_heap_memory_committed' => 'd5', 'JMX_heap_memory_max' => 'd6', 'JMX_non_heap_memory_used' => 'd7', 'JMX_non_heap_memory_committed' => 'd8', 'JMX_non_heap_memory_max' => 'd9', 'JMX_open_file_descriptors' => 'da', 'JMX_max_file_descriptors' => 'db', 'MONGODB_connected_clients' => 'dc', 'MONGODB_used_resident_memory' => 'dd', 'MONGODB_used_mapped_memory' => 'de', 'MONGODB_used_virtual_memory' => 'df', 'MONGODB_index_accesses' => 'dg', 'MONGODB_index_hits' => 'dh', 'MONGODB_index_misses' => 'di', 'MONGODB_index_resets' => 'dj', 'MONGODB_back_flushes' => 'dk', 'MONGODB_back_total_ms' => 'dl', 'MONGODB_back_average_ms' => 'dm', 'MONGODB_back_last_ms' => 'dn', 'MONGODB_op_inserts' => 'do', 'MONGODB_op_queries' => 'dp', 'MONGODB_op_updates' => 'dq', 'MONGODB_op_deletes' => 'dr', 'MONGODB_op_getmores' => 'ds', 'MONGODB_op_commands' => 'dt', 'MONGODB_slave_lag' => 'du');
    # Prepare and return the output.  The output we have right now is the whole
    # info, and we need that -- to write it to the cache file -- but what we
    # return should be only the desired items.
    $output = array();
    foreach ($keys as $key => $short) {
        # If the value isn't defined, return -1 which is lower than (most graphs')
        # minimum value of 0, so it'll be regarded as a missing value.
        $val = isset($result[$key]) ? $result[$key] : -1;
        $output[] = "{$short}:{$val}";
    }
    $result = implode(' ', $output);
    if ($fp) {
        if (fwrite($fp, $result) === FALSE) {
            die("Cannot write to '{$cache_file}'");
        }
        fclose($fp);
    }
    return extract_desired($options, $result);
}
开发者ID:kurtiss,项目名称:cacti-mongo,代码行数:68,代码来源:ss_get_by_ssh.php

示例8: dirname

 * Xunsearch PHP-SDK 运行条件检测
 *
 * @author hightman
 * @link http://www.xunsearch.com/
 * @copyright Copyright &copy; 2011 HangZhou YunSheng Network Technology Co., Ltd.
 * @license http://www.xunsearch.com/license/
 * @version $Id$
 */
require_once dirname(__FILE__) . '/../lib/XS.php';
require dirname(__FILE__) . '/XSUtil.class.php';
// magick output charset
XSUtil::parseOpt(array('c', 'charset'));
$charset = XSUtil::getOpt('c', 'charset');
XSUtil::setCharset($charset);
// result number record
$result = array('PHP 版本' => array('type' => (version_compare(PHP_VERSION, '5.2.0', '>=') ? '' : 'ERROR:') . PHP_VERSION, 'used' => 'XS(core)', 'note' => 'PHP 5.2.0 或更高版本是必须的。'), 'SPL 扩展' => array('type' => extension_loaded('spl') ? 'OK' : 'ERROR', 'used' => 'XS(core)', 'note' => 'SPL 扩展用于自动加载和对象戏法'), 'PCRE 扩展' => array('type' => extension_loaded('pcre') ? 'OK' : 'ERROR', 'used' => 'XSDocument, XSSearch', 'note' => '用于字符串切割、判断'), '编码转换' => array('type' => check_conv(), 'used' => 'XSDocument, XSSearch', 'note' => '用于支持非 UTF-8 字符集'), '缓存模块' => array('type' => check_cache(), 'used' => 'XS', 'note' => '用于缓存项目配置文件的解析结果'), 'JSON 扩展' => array('type' => extension_loaded('json') ? 'OK' : 'WARNING', 'used' => 'util.Quest, util.Indexer', 'note' => '用于读取或输出 JSON 格式的数据'), 'XML 扩展' => array('type' => extension_loaded('xml') ? 'OK' : 'WARNING', 'used' => 'util.Indexer', 'note' => '用于读取导入 XML 格式的数据'), 'MySQL 扩展' => array('type' => check_mysql(), 'used' => 'util.Indexer', 'note' => '用于读取导入 MySQL 的数据库'), 'SQLite 扩展' => array('type' => check_sqlite(), 'used' => 'util.Indexer', 'note' => '用于读取导入 SQLite 的数据库'));
// output
?>
Xunsearch PHP-SDK 运行需求检查
==============================

检查内容
--------

本程序用于确认您的服务器配置是否能满足运行 Xunsearch PHP-SDK 的要求。
它将检查服务器所运行的 PHP 版本,查看是否安装了合适的PHP扩展模块,以及
确认 php.ini 文件是否正确设置。

<?php 
out_line();
out_line('项目', '结果', '用于', '备注');
开发者ID:Maplecms,项目名称:shopnc-yhmall,代码行数:31,代码来源:RequiredCheck.php

示例9: sugar_cache_clear

/**
 * Clear a key from the cache.  This is used to invalidate a single key.
 *
 * @param String $key -- Key from global namespace
 */
function sugar_cache_clear($key)
{
    if ($GLOBALS['external_cache_checked'] == false) {
        check_cache();
    }
    $GLOBALS['external_cache_object']->__unset($key);
}
开发者ID:klr2003,项目名称:sourceread,代码行数:12,代码来源:external_cache.php

示例10: dirname

/*
Rough take on Twitter oEmbed for VeloRooms
by L'arri : voici.l.arriviste@gmail.com
27 October 2014

Packaged and modified by SMFHacks.com -vbgamer45
*/
// I used SMF items where possible for database interactions and required includes.
global $ssi_guest_access;
$ssi_guest_access = 1;
require dirname(__FILE__) . '/SSI.php';
global $smcFunc;
$_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_NUMBER_INT);
$qv = $_GET['id'];
if (!empty($qv)) {
    check_cache($qv);
} else {
    echo '{"html":"<p style=\\"color: #666; border: 1px dotted #666; padding: 5px; width: 490px;\\">' . $txt['autotwitter_blankid'] . '</p>"}';
}
function check_cache($tweet)
{
    global $smcFunc;
    if (!is_numeric($tweet)) {
        return;
    }
    $request = $smcFunc['db_query']('', 'SELECT 
		html from 
	{db_prefix}tweet_cache 
	where tweetid = {raw:tweet}', array('tweet' => $tweet));
    if ($smcFunc['db_num_rows']($request) == 0) {
        add_cache($tweet);
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:31,代码来源:tweet-cache.php

示例11: elephante

function elephante($tumblr_url, $cachefile="cache/mytumblr.json"){
  $cache = check_cache($cachefile);
  if($cache){
    $newtumblr = get_tumblr($tumblr_url,"", $cache["modtime"]);
    
    
    if($newtumblr["status"] == 200){
      // a new tumblr file was loaded, now update cache time
      $cache["modtime"] = $newtumblr["modtime"];
      
      $firstpostid = $cache["posts"][0]["id"];
      for(
        $i=0; $i < count($newtumblr["tumblr"]["posts"]) &&
          $newtumblr["tumblr"]["posts"][$i]["id"] !== $firstpostid;
          $i += 1){
        
        $thispost = $newtumblr["tumblr"]["posts"][$i];
        
        if($thispost["id"] > $firstpostid){ // add this post
          $cache["posts"] = array_merge(array($thispost), $cache["posts"]);
        }
        if($thispost["id"] < $firstpostid){
          // this new post is older than our first saved post
          // weird state problem, so maybe should force recrawl?
        }
      }
      
      // do low-key consistency check here and then save or recrawl
      if($newtumblr["tumblr"]["posts-total"] == count($cache["posts"])){
        file_put_contents($cachefile, json_encode($cache));
      }else{
        crawl_tumblr($tumblr_url, $cachefile);
      }
    }else if($newtumblr["status"] == 304){
      // nothing's changed
    }else{
      // uh oh (likely api/tumblr fail), return cache
    }
  }else{
    // the cache is borked, try crawling?
    // also, this assumes that cachefile is writable, but doesn't
    // give an error if it's not :(
    // TODO break nicely, maybe add a post that says "it's broken!"
    crawl_tumblr($tumblr_url, $cachefile);
    return check_cache($cachefile);
  }
  return $cache;
}
开发者ID:nsfmc,项目名称:elephante,代码行数:48,代码来源:index.php

示例12: sugar_clean_opcodes

/**
 * Reset opcode cache if present
 */
function sugar_clean_opcodes()
{
    if ($GLOBALS['external_cache_checked'] == false) {
        check_cache();
    }
    if ($GLOBALS['external_cache_object']) {
        $GLOBALS['external_cache_object']->clean_opcodes();
    }
}
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:12,代码来源:external_cache.php

示例13: unserialize

    $sample_map = unserialize(sample_map);
    foreach ($sample_map as $mapkey => $mapvalue) {
        if (startswith($filename, $mapkey)) {
            return_cached($mapvalue, "samples");
        }
    }
}
if (!isset($_REQUEST['uri'])) {
    die("No URI Specified!");
}
$uri = $_REQUEST['uri'];
if (empty($uri)) {
    die("No URI Specified!");
}
check_samples($uri);
check_cache($uri);
$custom_headers = [];
$req = curl_init($uri);
if (isset($_SERVER['HTTP_ACCEPT'])) {
    $custom_headers[] = "Accept: " . $_SERVER['HTTP_ACCEPT'];
} else {
    die('Cannot process the Accept headers!');
}
if (isset($_SERVER['HTTP_USER_AGENT'])) {
    $custom_headers[] = "User-Agent: " . $_SERVER['HTTP_USER_AGENT'];
}
curl_setopt($req, CURLOPT_HTTPHEADER, $custom_headers);
curl_setopt($req, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($req, CURLOPT_VERBOSE, 1);
curl_setopt($req, CURLOPT_HEADER, 1);
curl_setopt($req, CURLOPT_FOLLOWLOCATION, true);
开发者ID:nicholascar,项目名称:rdfjs_tools,代码行数:31,代码来源:proxy.php

示例14: check_cache

    $cache = check_cache('eep', $hash);
    if (is_null($cache)) {
        // no cache
        $file = generate_eep_file($matrix_rows, $matrix_cols, $matrix_size, $max_layers, $max_fns, $keymaps, $fn_actions, $eep_size, $eep_start, $additional);
        write_cache('eep', $hash, $file);
    } else {
        // has cache
        $file = $cache;
    }
}
// make c file
if ($filetype == 'c') {
    $filename = 'keymap.c';
    $hash = sha1(serialize(array('matrix_rows' => $matrix_rows, 'matrix_cols' => $matrix_cols, 'max_layers' => $max_layers, 'max_fns' => $max_fns, 'keymaps' => $keymaps, 'fn_actions' => $fn_actions)));
    // check cache
    $cache = check_cache('c', $hash);
    if (is_null($cache)) {
        // no cache
        $file = generate_c_file($matrix_rows, $matrix_cols, $max_layers, $max_fns, $keymaps, $fn_actions);
        write_cache('c', $hash, $file);
    } else {
        // has cache
        $file = $cache;
    }
    // prepend header
    $header = generate_c_header();
    $file = $header . $file;
}
// download
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $filename . '"');
开发者ID:zhangzzl,项目名称:tkg,代码行数:31,代码来源:download.php

示例15: parse_ini_file

// make sure this is writeable for www server
$config['cache']['request_file'] = 'dashboard.raw.xml';
$config['cache']['output_file'] = 'dashboard.rss.xml';
$config['feed']['img_size'] = 5;
// 0-5 (0 is original or large, 5 is small)
//$config['feed']['post_format'] = '[%1$s] %4$s (%2$s) - %3$s'; // [type] longname (shortname) - entry
$config['feed']['post_format'] = '%3$s (%2$s) - %4$s [%1$s]';
// longname (shortname) - entry [type]
/** read config ... if available */
if (file_exists('config.ini')) {
    $config = parse_ini_file('config.ini', TRUE);
}
// set GMT/UTC required for proper cache dates & feed validation
date_default_timezone_set('GMT');
// and away we go ...
if ($config['cache']['request'] && check_cache()) {
    $result = file_get_contents($config['cache']['dir'] . DIRECTORY_SEPARATOR . $config['cache']['request_file']);
    $posts = read_xml($result);
    output_rss($posts);
} else {
    fetch_tumblr_dashboard_xml($config['tumblr']['email'], $config['tumblr']['password']);
}
/** Functions
 ------------------------------------- */
/**
 * Tumbler Dashboard API Read
 *
 * @param string $email tumblr account email address
 * @param string $password tumblr account password
 * @return void
 */
开发者ID:pjkix,项目名称:tumblr-dashboard-rss,代码行数:31,代码来源:tumblr-dashboard-rss.php


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