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


PHP SC::set方法代码示例

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


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

示例1: outputHeaders

 public function outputHeaders($ext, $full_path)
 {
     SC::set('header_suppress_cache_control', 1);
     $cache_duration = 86400 * 7;
     // 7 days
     $last_mod_duration = 86400 * 2;
     // 2 days
     $last_mod_date = date('r', SC::get('board_config.time_now') - $last_mod_duration);
     $to_cache_date = date('r', SC::get('board_config.time_now') + $cache_duration);
     header("Expires: {$to_cache_date}");
     header("Last-Modified: {$last_mod_date}");
     header("Cache-Control: max-age={$cache_duration}");
     // make an etag based on the full path
     // header('Etag: ' .'"'. crc32($full_path) . '"');
     if ($ext == ".js") {
         header("Content-type: text/javascript");
     }
     if ($ext == ".css") {
         header("Content-type: text/css");
     }
 }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:21,代码来源:minscript.request.php

示例2: data

 /**
  * Data function returns a container object, where all internal
  * data is stored.
  * @return Container
  * @access private
  */
 private function data()
 {
     static $data;
     if (isset($data)) {
         return $data;
     }
     $data = new Container();
     $params = array("cache" => SC::get('board_config.always_cache_bust') ? SC::get('board_config.time_now') . '_' . mt_rand(1, 999999) : SC::get('board_config.cache_bust'), 'yui_version' => '2.6.0');
     $data->set("settings", $params);
     // Until all content is in grids, we need this var
     // REMOVE ONCE EVERY SINGLE PAGE ON THE SITE IS IN GRIDS
     $data->set('enable_nongrid', TRUE);
     if (isset($_GET['login_success']) && SC::get('userdata.user_id') < 1 && empty($_COOKIE)) {
         SC::set('board_config.sys_message', 'Gaia Online requires browser cookies. Please enable cookies in your browser and try again. Mmmm cookies.');
     }
     $data->set('ext_script_js', array());
     $data->set('script_js', array());
     $data->set('script_css', array());
     $data->set('script_css_ie', array());
     return $data;
 }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:27,代码来源:layoutmanager.php

示例3: dispatch

 /**
  * Perform the desired action.
  * @param string    The name of the action.
  * @return void
  * @access public
  */
 public function dispatch($request_name = NULL)
 {
     while (true) {
         try {
             $request = $this->instantiate($request_name, 'request', 'request');
             SC::set('CIRCUIT_REQUEST_NAME', $request_name);
         } catch (Exception $e) {
             $request = $this->instantiate(CIRCUIT_APP_404, 'request');
         }
         try {
             if (method_exists($request, 'load')) {
                 $request->load($this->observer);
             }
             if (method_exists($request, 'forward') && ($request_name = $request->forward($this->observer))) {
                 continue;
             }
             $action_name = method_exists($request, 'selectAction') ? $request->selectAction($this->observer) : $request_name;
         } catch (Exception $e) {
             $this->handleException($e);
             return $this->instantiate('Default.MessageDie', 'view')->execute($this);
         }
         break;
     }
     $action_result = null;
     if ($action_name) {
         try {
             $action = $this->instantiate($action_name, 'action');
             $action_result = $action->execute($this);
         } catch (Exception $e) {
             $action_result = $this->handleException($e);
         }
     }
     $this->clearExceptionListeners();
     $selectView = 'selectView_' . str_replace('.', '_', $action_name);
     $view_name = method_exists($request, $selectView) ? $request->{$selectView}($action_result) : (method_exists($request, 'selectView') ? $request->selectView($action_result) : $request_name);
     try {
         $view = $this->instantiate($view_name, 'view');
     } catch (Exception $e) {
         $view = $this->instantiate(CIRCUIT_APP_404, 'view');
     }
     $view->execute($this);
 }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:48,代码来源:circuit.inc.php


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