From 3f2bdb769572298484522044a472277b8123d948 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 18 Apr 2012 20:43:25 -0500 Subject: [PATCH] only write file caches if minutes is greater than zero. --- laravel/cache/drivers/file.php | 2 ++ laravel/documentation/changes.md | 1 + 2 files changed, 3 insertions(+) diff --git a/laravel/cache/drivers/file.php b/laravel/cache/drivers/file.php index 1d7e69a1..c37520ea 100644 --- a/laravel/cache/drivers/file.php +++ b/laravel/cache/drivers/file.php @@ -67,6 +67,8 @@ protected function retrieve($key) */ public function put($key, $value, $minutes) { + if ($minutes <= 0) return; + $value = $this->expiration($minutes).serialize($value); file_put_contents($this->path.$key, $value, LOCK_EX); diff --git a/laravel/documentation/changes.md b/laravel/documentation/changes.md index 5f35fcbd..6e4c7b7a 100644 --- a/laravel/documentation/changes.md +++ b/laravel/documentation/changes.md @@ -48,6 +48,7 @@ ## Laravel 3.2 - Made the `get_timestamp` Eloquent method static. - `Request::secure` now takes `application.ssl` configuration option into consideration. - Simplified the `paths.php` file. +- Only write file caches if number of minutes is greater than zero. ## Upgrading From 3.1