本文整理汇总了PHP中Registry::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Registry::__construct方法的具体用法?PHP Registry::__construct怎么用?PHP Registry::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registry
的用法示例。
在下文中一共展示了Registry::__construct方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
// must come before registry construction
session_start();
session_regenerate_id();
// initialize registry
parent::__construct($_SESSION);
// session exists
if ($this['generated']) {
// session expired (x minutes) - start from scratch
if (time() - $this['generated'] > 30 * 60) {
unset($this['username']);
unset($this['password']);
$this['status'] = 2;
}
} else {
// if no session is found
if ($this['status'] === false) {
$this['status'] = 6;
}
}
$this['status_old'] = $this['status'];
// reset session timeout
$this['generated'] = time();
}
示例2: __construct
public function __construct($settings)
{
// construct registry
parent::__construct($settings);
// create the default theme
$this->Theme = new Theme($settings['theme_name']);
}
示例3: __construct
public function __construct()
{
// initialize registry
parent::__construct();
// start with guest access
$this['group'] = new Group();
$this['authorized'] = false;
}
示例4: __construct
public function __construct()
{
if (get_magic_quotes_gpc()) {
$_REQUEST = array_map("stripslashes_deep", $_REQUEST);
}
// initialize registry
parent::__construct($_REQUEST);
}
示例5: __construct
public function __construct($ajax = false)
{
if ($ajax) {
$this->path = urldecode($_SERVER['REQUEST_URI']);
$this->registerServer();
} else {
parent::__construct();
}
}
示例6: __construct
/**
* Create a new configuration repository.
*
* @param object $loader
* @param string $client
* @return void
*/
public function __construct($client, $loader = null)
{
if (!$loader) {
$loader = new \Hubzero\Config\FileLoader(PATH_APP . DS . 'config');
}
$this->loader = $loader;
$this->client = $client;
$items = $this->load($this->client);
parent::__construct($items);
}
示例7: __construct
/**
* constructor : reads the config file an set up the variables
*
* @param string $file file name
* @param string $enviroment name of enviroment to read variables
*
* @return void
*/
protected function __construct($basePath = null)
{
session_cache_expire(3600);
if (!session_id()) {
session_start();
}
if (isset($_SESSION['timeout_idle']) && $_SESSION['timeout_idle'] < time()) {
session_destroy();
session_regenerate_id();
}
$_SESSION['timeout_idle'] = time() + session_cache_expire();
parent::__construct($basePath);
}
示例8: __construct
public function __construct($lang)
{
//if(is_string($lang))
//{
// $sl_path = G::$Engine->Site->Path . "/modules/" . $module . "/lang/" . G::$Engine->Site['language'] . "/" . $file;
// $en_path = G::$Engine->Site->Path . "/modules/" . $module . "/lang/" . "en" . "/" . $file;
//
// $lang = file_exists($sl_path) ? G::$Engine->LoadFile($sl_path) : file_exists($en_path) ? $this->Lang->Add($en_path) : 0;
//}
if (is_string($lang)) {
// initialize registry
parent::__construct();
$this->Filename = $lang;
} else {
if (is_array($lang)) {
// initialize registry
parent::__construct($lang);
} else {
throw new Exception("Attempted to load bad language file", 69);
}
}
}
示例9: __construct
public function __construct($settings)
{
//--------------------------------
// Initialize settings
//--------------------------------
//$settings['requesturl'] = (!empty($_SERVER['HTTPS'])) ? "https://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] : "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$settings['requesturl'] = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$settings['title'] = array($settings['title']);
//--------------------------------
// Initialize header settings
//--------------------------------
$settings['headers'] = array();
$settings['headers']['Expires'] = "Sun, 19 nov 1978 05:00:00 GMT";
$settings['headers']['Last-Modified'] = gmdate("D, d M Y H:i:s") . " GMT";
$settings['headers']['Cache-Control'] = "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
$settings['headers']['Pragma'] = "no-cache";
//--------------------------------
// Save settings
//--------------------------------
// construct registry
parent::__construct($settings);
}
示例10: __construct
public function __construct()
{
// initialize registry
parent::__construct();
}
示例11: __construct
public function __construct($title)
{
// construct registry
parent::__construct();
$this->Title = $title;
}