本文整理汇总了PHP中Cookie::httponly方法的典型用法代码示例。如果您正苦于以下问题:PHP Cookie::httponly方法的具体用法?PHP Cookie::httponly怎么用?PHP Cookie::httponly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cookie
的用法示例。
在下文中一共展示了Cookie::httponly方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Application initialization
* - Loads the plugins
* - Sets the cookie configuration
*/
public static function init()
{
// Set defaule cache configuration
Cache::$default = Kohana::$config->load('site')->get('default_cache');
try {
$cache = Cache::instance()->get('dummy' . rand(0, 99));
} catch (Exception $e) {
// Use the dummy driver
Cache::$default = 'dummy';
}
// Load the plugins
Swiftriver_Plugins::load();
// Add the current default theme to the list of modules
$theme = Swiftriver::get_setting('site_theme');
if (isset($theme) and $theme != "default") {
Kohana::modules(array_merge(array('themes/' . $theme->value => THEMEPATH . $theme->value), Kohana::modules()));
}
// Clean up
unset($active_plugins, $theme);
// Load the cookie configuration
$cookie_config = Kohana::$config->load('cookie');
Cookie::$httponly = TRUE;
Cookie::$salt = $cookie_config->get('salt', Swiftriver::DEFAULT_COOKIE_SALT);
Cookie::$domain = $cookie_config->get('domain') or '';
Cookie::$secure = $cookie_config->get('secure') or FALSE;
Cookie::$expiration = $cookie_config->get('expiration') or 0;
// Set the default site locale
I18n::$lang = Swiftriver::get_setting('site_locale');
}
示例2: array
*/
Kohana::$log->attach(new Log_File(APPPATH . 'logs'));
/**
* Attach a file reader to config. Multiple readers are supported.
*/
Kohana::$config->attach(new Config_File());
/**
* Enable modules. Modules are referenced by a relative or absolute path.
*/
Kohana::modules(array('cache' => MODPATH . 'cache', 'database' => MODPATH . 'database', 'image' => MODPATH . 'image', 'orm' => MODPATH . 'orm', 'paypal' => MODPATH . 'paypal', 'kandler' => MODPATH . 'kandler', 'email' => MODPATH . 'email', 'pagination' => MODPATH . 'pagination', 'sitemap' => MODPATH . 'sitemap', 'amazon' => MODPATH . 'amazon'));
/**
* Cache
*/
Kohana::$caching = TRUE;
Cache::$default = 'apc';
/**
* Set the routes. Each route must have a minimum of a name, a URI and a set of
* defaults for the URI.
*/
// Default route
Route::set('default', '(<controller>(/<action>(/<id>)))')->defaults(array('controller' => 'ads', 'action' => 'home'));
// Error route
Route::set('error', 'error/<action>(/<message>)', array('action' => '[0-9]++', 'message' => '.+'))->defaults(array('controller' => 'error_handler'));
/**
* Cookie configuration settings
*/
Cookie::$salt = 'ASJ12094X:F?!*!*AD';
Cookie::$expiration = Date::MONTH;
Cookie::$httponly = TRUE;
Cookie::$secure = isset($_SERVER["HTTPS"]);
Cookie::$domain = '.gowork.at';
示例3: array
# copy config/init.php.default to config/init.php
Kohana::init(include APPPATH . 'config/init.php');
/**
* Attach the file write to logging. Multiple writers are supported.
*/
Kohana::$log->attach(new Log_File(APPPATH . 'logs'));
/**
* Attach a file reader to config. Multiple readers are supported.
*/
Kohana::$config->attach(new Config_File());
/**
* Cookie config.
*/
$cookie = Kohana::$config->load('cookie');
Cookie::$salt = $cookie->salt;
Cookie::$expiration = $cookie->expiration;
Cookie::$domain = $cookie->domain;
Cookie::$path = $cookie->path;
Cookie::$secure = $cookie->secure;
Cookie::$httponly = $cookie->httponly;
/**
* Enable modules. Modules are referenced by a relative or absolute path.
*/
Kohana::modules(array());
/**
* Set the routes. Each route must have a minimum of a name, a URI and a set of
* defaults for the URI.
*/
Route::set('api', '<directory>(/<controller>(/<action>(/<params>)))', array('params' => '.*', 'directory' => '(v1|v2)'))->defaults(array('controller' => 'defaults', 'action' => 'index', 'directory' => 'v1'));
Route::set('join', 'join')->defaults(array('controller' => 'auth', 'action' => 'join'));
Route::set('default', '(<controller>(/<action>(/<id>)))')->defaults(array('controller' => 'welcome', 'action' => 'index'));