This repository has been archived by the owner on May 19, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change session management to use mysql, added simple benchmarking, ad…
…ded helper functions for benchmarking and page types
- Loading branch information
rwarasaurus
committed
Feb 14, 2012
1 parent
b3d6d5b
commit 8f9988a
Showing
6 changed files
with
155 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php defined('IN_CMS') or die('No direct access allowed.'); | ||
|
||
class Cookie { | ||
|
||
public static function has($key) { | ||
return isset($_COOKIE[$key]); | ||
} | ||
|
||
public static function get($key, $default = false) { | ||
if(static::has($key)) { | ||
return $_COOKIE[$key]; | ||
} | ||
|
||
return ($default instanceof \Closure) ? call_user_func($default) : $default; | ||
} | ||
|
||
public static function write($name, $data, $expire, $path, $domain) { | ||
if(headers_sent() === false) { | ||
setcookie($name, $data, $expire, $path, $domain, false); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters