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


PHP functions::headers_no_cache方法代码示例

本文整理汇总了PHP中functions::headers_no_cache方法的典型用法代码示例。如果您正苦于以下问题:PHP functions::headers_no_cache方法的具体用法?PHP functions::headers_no_cache怎么用?PHP functions::headers_no_cache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在functions的用法示例。


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

示例1: define

<?php

/**
 * Entry point for editor interface
 *
 * @package    TwoFace
 * @author     Golovkin Vladimir <r00t@skillz.ru> http://www.skillz.ru
 * @copyright  SurSoft (C) 2008
 * @version    $Id: index.php,v 1.2.6.1 2008/10/24 13:19:05 j4ck Exp $
 */
define('IN_MAIN', 'I think so');
define('IN_EDITOR', 'Hell year');
require '../modules/core/loader.php';
// disable cache
functions::headers_no_cache();
if (!core::lib('auth')->logged_in() || 'admin' != core::lib('auth')->get_user()->get_level()) {
    // disable auth
    functions::redirect('/');
    exit;
}
$module = core::get_params()->module;
if (!empty($module) && 'core' != $module) {
    try {
        if ($mod = core::module($module)) {
            $mod->on_editor();
        }
    } catch (modules_exception $e) {
        // module not found
        core::get_instance()->error404('Module not found');
    }
} else {
开发者ID:rustyJ4ck,项目名称:moswarBot,代码行数:31,代码来源:index.php

示例2: cp

 /**
  * CP Entry
  * /users/cp/../
  * @param array
  *   $r->option_params' => array(0=>,1=>)
  * @throws router_exception
  * @throws controller_exception
  */
 function cp($r)
 {
     // disable cache
     functions::headers_no_cache();
     // force login screen
     if (!$this->_auth->logged_in()) {
         /*
         $this->renderer->set_message($this->get_context()->T('Please login'));
         */
         $this->renderer->set_return('redirect', $_SERVER['REQUEST_URI']);
         $this->set_template('users/login');
         return;
     }
     $this->_cp_user = $this->get_context()->get_current_user();
     $this->set_section_name('cp');
     $this->set_action_name('cp');
     $this->set_template('users/cp');
     if (empty($this->req->option) && ($default_opt = $this->get_context()->get_default_cp_option())) {
         $this->req->option = $default_opt;
     }
     if (!empty($this->req->option)) {
         $cmd = 'cp_' . $this->req->option;
         if (!is_callable(array($this, $cmd))) {
             throw new router_exception('Bad action', router_exception::NOT_FOUND);
         }
         // call cp method
         call_user_func(array($this, $cmd));
         $this->get_context()->set_cp_data('option', $this->req->option);
     }
 }
开发者ID:egregor-dev,项目名称:SatCMS,代码行数:38,代码来源:controller.php

示例3: check_last_modified

 /**
  * Check last modified time and
  * do some action
  */
 function check_last_modified()
 {
     $user = $this->lib('auth')->get_user();
     $disable = $this->cfg('disable_last_modify', false);
     if (!$disable && $user->is_anonymous()) {
         if ($time = $this->last_modified()) {
             $last_modified = date('r', $time);
             @header('Last-Modified: ' . $last_modified);
             @header('Cache-Control: max-age=3600, must-revalidate');
         }
     } else {
         // dont cache user
         functions::headers_no_cache();
     }
 }
开发者ID:egregor-dev,项目名称:SatCMS,代码行数:19,代码来源:core.php

示例4: cp

 /**
  * CP Entry
  * /users/cp/../
  * @throws router_exception
  * @throws controller_exception
  */
 function cp($r)
 {
     // disable cache
     functions::headers_no_cache();
     /*
         $r->option_params' => 
             array
               0 => 
               1 => 
     */
     if (!core::lib('auth')->logged_in()) {
         throw new controller_exception('User not logged in!');
     }
     $this->_cp_user = $this->get_context()->get_current_user();
     $this->set_section_name('cp');
     $this->set_action_name('cp');
     $this->set_template('user_cp');
     if (!empty($this->req->option)) {
         $cmd = 'cp_' . @$this->req->option;
         if (!method_exists($this, $cmd)) {
             throw new router_exception('Bad action', router_exception::NOT_FOUND);
         }
         // user cp links rendered in module::render()
         // call cp method
         call_user_func(array($this, $cmd));
         /*
         try {
             call_user_func(array($this, $cmd));
         }
         catch (system_exception $e) {
             $this->get_context()->get_core()->set_message('error_not_implemented');
             $this->get_context()->get_core()->set_message_data(false, true);                
         }
         */
         $this->get_context()->set_cp_data('option', $this->req->option);
     }
 }
开发者ID:rustyJ4ck,项目名称:moswarBot,代码行数:43,代码来源:controller.php


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