本文整理汇总了PHP中config::get_module方法的典型用法代码示例。如果您正苦于以下问题:PHP config::get_module方法的具体用法?PHP config::get_module怎么用?PHP config::get_module使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config
的用法示例。
在下文中一共展示了config::get_module方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send_response
protected static function send_response($is_pps_mode, $content_type, $content, $gzippable = true)
{
header('Content-Type: ' . $content_type);
if (config::get_kern('send_x_powered_by', true)) {
header('X-Powered-By: swap-' . version);
}
if ($is_pps_mode) {
if (config::get_module('view.cache_pps_in_client', false)) {
header('Cache-Control: max-age=2592000');
} else {
header('Cache-Control: max-age=0');
}
}
if (self::$log_execute_time) {
$execute_time = microtime(true) - self::$begin_microtime;
header('X-Execute-Time: ' . substr($execute_time * 1000, 0, 5) . ' ms');
}
if ($gzippable && extension_loaded('zlib') && !ini_get('zlib.output_compression')) {
ob_start('ob_gzhandler');
} else {
ob_start();
}
echo $content;
ob_end_flush();
if (self::$is_debug) {
debug::save_required_files();
}
}
示例2: render_pjs_for
protected static function render_pjs_for(target $target)
{
parent::use_viewlet('pjs');
ob_start();
self::do_render_in(view_dir, 'pjs', $target);
$pjs = ob_get_clean();
if (config::get_module('view.minify_pps', false)) {
$pjs = self::minify_pjs($pjs);
}
return $pjs;
}
示例3: __init__
public static function __init__()
{
// @todo: lazy initialization?
self::$prefix = visitor::get_prefix();
self::$static_domain = config::get_kern('static_domain', '');
self::$upload_domain = config::get_kern('upload_domain', '');
self::$version_key = config::get_kern('version_key', self::default_version_key);
self::$version = config::get_kern('version', self::default_version);
self::$base_is_https = config::get_base('url.is_https', false);
self::$base_domains = config::get_base('url.domains', []);
foreach (self::$base_domains as $domain) {
# base 模块的 module_name 统一为 'base'
self::$domain_modules[$domain] = 'base';
}
self::$base_enable_rewrite = config::get_base('url.enable_rewrite', false);
self::$base_csrf_key = config::get_base('url.csrf_key', self::default_csrf_key);
self::$base_target_key = config::get_base('url.target_key', self::default_target_key);
self::$base_routes = config::get_base('url.routes', []);
self::$base_flipped_routes = array_flip(self::$base_routes);
foreach (config::get_module_names() as $module_name) {
config::set_module_name($module_name);
self::$module_is_https[$module_name] = config::get_module('url.is_https', false);
$domains = config::get_module('url.domains', []);
self::$module_domains[$module_name] = $domains;
foreach ($domains as $domain) {
self::$domain_modules[$domain] = $module_name;
}
self::$module_enable_rewrites[$module_name] = config::get_module('url.enable_rewrite', false);
self::$module_csrf_keys[$module_name] = config::get_module('url.csrf_key', self::default_csrf_key);
self::$module_target_keys[$module_name] = config::get_module('url.target_key', self::default_target_key);
self::$module_routes[$module_name] = config::get_module('url.routes', []);
self::$module_flipped_routes[$module_name] = array_flip(self::$module_routes[$module_name]);
}
# 实际是哪个 module_name 需要解析
config::set_module_name(null);
}
示例4: set_target
public static function set_target(target $target)
{
self::$configs = config::get_module('visitor', ['cookie_domain' => '', 'roles' => []]);
self::$request['gets'] = array_merge(self::$request['gets'], $target->get_params());
self::$request['target'] = $target;
}
示例5: csrf
public static function csrf($csrf_role)
{
if (visitor::has_role($csrf_role)) {
$csrf_key = config::get_module('url.csrf_key', router::default_csrf_key);
$role_secret = null;
if (visitor::p_has($csrf_key)) {
$role_secret = visitor::p_str($csrf_key);
} else {
if (visitor::g_has($csrf_key)) {
$role_secret = visitor::g_str($csrf_key);
}
}
if ($role_secret !== visitor::get_role_secret($csrf_role)) {
throw new visitor_except('csrf attack', 403);
}
}
}
示例6: __init__
public static function __init__()
{
self::$role_configs = config::get_module('visitor.roles', []);
}