summaryrefslogtreecommitdiff
path: root/system/helpers/expires.php
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-01-09 23:02:55 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-01-09 23:02:55 +0000
commit0a67b836a9b5021c91b9c327d3693991c3248dfc (patch)
tree91f49ca62a9ffd586e01bde700068f87e884181a /system/helpers/expires.php
parent232c0b7fd0df7f84543bc29380a0734ef1e84a02 (diff)
parentbd9f945e3f2de4ea2402bd3941dba69c79ddc5a4 (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'system/helpers/expires.php')
-rw-r--r--system/helpers/expires.php27
1 files changed, 13 insertions, 14 deletions
diff --git a/system/helpers/expires.php b/system/helpers/expires.php
index 5f599e13..d510ba7c 100644
--- a/system/helpers/expires.php
+++ b/system/helpers/expires.php
@@ -2,9 +2,7 @@
/**
* Controls headers that effect client caching of pages
*
- * $Id: expires.php 4679 2009-11-10 01:45:52Z isaiah $
- *
- * @package Core
+ * @package Kohana
* @author Kohana Team
* @copyright (c) 2007-2009 Kohana Team
* @license http://kohanaphp.com/license
@@ -15,18 +13,19 @@ class expires_Core {
* Sets the amount of time before content expires
*
* @param integer Seconds before the content expires
- * @return integer Timestamp when the content expires
+ * @param integer Last modified timestamp in seconds(optional)
+ * @return integer Timestamp when the content expires
*/
public static function set($seconds = 60, $last_modified=null)
{
$now = time();
$expires = $now + $seconds;
- if (empty($last_modified))
- {
- $last_modified = $now;
- }
+ if (empty($last_modified))
+ {
+ $last_modified = $now;
+ }
- header('Last-Modified: '.gmdate('D, d M Y H:i:s T', $last_modified));
+ header('Last-Modified: '.gmdate('D, d M Y H:i:s T', $last_modified));
// HTTP 1.0
header('Expires: '.gmdate('D, d M Y H:i:s T', $expires));
@@ -70,7 +69,7 @@ class expires_Core {
* @uses expires::get()
*
* @param integer Maximum age of the content in seconds
- * @param integer Last modified timestamp in seconds
+ * @param integer Last modified timestamp in seconds(optional)
* @return integer|boolean Timestamp of the If-Modified-Since header or FALSE when header is lacking or malformed
*/
public static function check($seconds = 60, $modified=null)
@@ -79,10 +78,10 @@ class expires_Core {
{
$now = time();
- if (empty($modified))
- {
- $modified = $now;
- }
+ if (empty($last_modified))
+ {
+ $last_modified = $now;
+ }
if ($modified <= $last_modified)
{