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


PHP common::config_item方法代码示例

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


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

示例1: _set_routing

 private function _set_routing()
 {
     if (common::config_item('enable_query_strings') === TRUE and isset($_GET[config_item('controller_trigger')])) {
         $this->query_string = TRUE;
         $this->set_directory(trim($this->uri->_filter_uri($_GET[config_item('directory_trigger')])));
         $this->set_class(trim($this->uri->_filter_uri($_GET[config_item('controller_trigger')])));
         if (isset($_GET[config_item('function_trigger')])) {
             $this->set_method(trim($this->uri->_filter_uri($_GET[config_item('function_trigger')])));
         }
         return;
     }
     $this->default_controller = (!isset($this->routes['default_controller']) or $this->routes['default_controller'] == '') ? FALSE : strtolower($this->routes['default_controller']);
     $this->uri->_fetch_uri_string();
     if ($this->uri->uri_string == '') {
         if ($this->default_controller === FALSE) {
             throw new Exception("Unable to determine what should be displayed. A default route has not been specified in the routing file.");
         }
         $segments = $this->_validate_request(explode('/', $this->default_controller));
         $this->set_class($segments[1]);
         $this->set_method($this->routes['index_method']);
         // index
         $this->uri->rsegments = $segments;
         $this->uri->_reindex_segments();
         //log_message('debug', "No URI present. Default controller set.");
         return;
     }
     unset($this->routes['default_controller']);
     $this->uri->_remove_url_suffix();
     $this->uri->_explode_segments();
     $this->_parse_routes();
     $this->uri->_reindex_segments();
 }
开发者ID:anugrahbsoe,项目名称:Becak-HMVC-Framework,代码行数:32,代码来源:router_library.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     loader::sys_helper('view');
     loader::sys_helper('head_tag');
     $this->base = common::config_item('base_url');
     $this->base_url = common::config_item('base_url') . common::config_item('index_page');
     $this->base_img = common::config_item('source_url') . 'images/';
     $this->meta = meta('Content-type', 'text/html; charset=utf-8', 'equiv');
     $this->meta .= meta('author', 'Eko Heri Susanto');
 }
开发者ID:anugrahbsoe,项目名称:Becak-HMVC-Framework,代码行数:11,代码来源:global_controller.php

示例3: _remove_url_suffix

 public function _remove_url_suffix()
 {
     if (common::config_item('url_suffix') != "") {
         $this->uri_string = preg_replace("|" . preg_quote(config_item('url_suffix')) . "\$|", "", $this->uri_string);
     }
 }
开发者ID:anugrahbsoe,项目名称:Becak-HMVC-Framework,代码行数:6,代码来源:uri_library.php

示例4: date_default_timezone_set

//panggil class inti (core)
require SYS . 'constant' . DS . 'file.php';
require SYS . 'core' . DS . 'common.php';
require SYS . 'error' . DS . 'errors.php';
require SYS . 'libraries' . DS . 'benchmark_library.php';
$benchmark = common::register('Benchmark');
$benchmark->mark('total_execution_time_start');
require SYS . 'core' . DS . 'loader.php';
require SYS . 'core' . DS . 'base.php';
require SYS . 'core' . DS . 'controller.php';
require SYS . 'core' . DS . 'model.php';
require SYS . 'libraries' . DS . 'router_library.php';
require SYS . 'libraries' . DS . 'uri_library.php';
require SYS . 'libraries' . DS . 'output_library.php';
require SYS . 'libraries' . DS . 'config_library.php';
date_default_timezone_set(common::config_item('timezone_set'));
$uri = common::register('Uri');
$router = common::register('Router');
$output = common::register('Output');
if ($output->_display_cache($uri) == TRUE) {
    exit;
}
$GLOBALS['d'] = $router->fetch_directory();
// Get requested directory
$GLOBALS['c'] = $router->fetch_class();
// Get requested controller
$GLOBALS['m'] = $router->fetch_method();
// Get requested method
//panggil default controller pada directory application/controller
if (!file_exists(DIR . $GLOBALS['d'] . DS . 'controllers' . DS . $GLOBALS['c'] . PHP_EXT)) {
    if ($router->query_string) {
开发者ID:anugrahbsoe,项目名称:Becak-HMVC-Framework,代码行数:31,代码来源:bootstrap.php

示例5: _display_cache

 public function _display_cache(&$URI)
 {
     //$cache_path = (common::config_item('cache_path', 'cache') == '') ? APP.'system'.DS.'cache'.DS : common::config_item('cache_path', 'cache');
     $cache_path = APP . 'cache' . DS;
     // Build the file path.  The file name is an MD5 hash of the full URI
     $uri = common::config_item('base_url') . common::config_item('index_page') . $URI->uri_string;
     $filepath = $cache_path . md5($uri);
     if (!@file_exists($filepath)) {
         return FALSE;
     }
     if (!($fp = @fopen($filepath, "r"))) {
         return FALSE;
     }
     flock($fp, LOCK_SH);
     $cache = '';
     if (filesize($filepath) > 0) {
         $cache = fread($fp, filesize($filepath));
     }
     flock($fp, LOCK_UN);
     fclose($fp);
     // Strip out the embedded timestamp
     if (!preg_match("/(\\d+TS--->)/", $cache, $match)) {
         return FALSE;
     }
     // Has the file expired? If so we'll delete it.
     if (time() >= trim(str_replace('TS--->', '', $match['1']))) {
         if (common::is_really_writable($cache_path)) {
             @unlink($filepath);
             //log_message('debug', "Cache file has expired. File deleted");
             return FALSE;
         }
     }
     // Display the cache
     $this->_display(str_replace($match['0'], '', $cache));
     return TRUE;
 }
开发者ID:anugrahbsoe,项目名称:Becak-HMVC-Framework,代码行数:36,代码来源:output_library.php


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