first commit of 2.0

This commit is contained in:
Taylor Otwell
2011-08-18 19:56:29 -05:00
parent 119b356bde
commit 1e90e42404
79 changed files with 796 additions and 688 deletions

29
laravel/cache/apc.php vendored Normal file
View File

@@ -0,0 +1,29 @@
<?php namespace Laravel\Cache;
use Laravel\Config;
class APC extends Driver {
public function has($key)
{
return ( ! is_null($this->get($key)));
}
public function get($key, $default = null)
{
$item = ( ! is_null($cache = apc_fetch(Config::get('cache.key').$key))) ? $cache : null;
return $this->prepare($item, $default);
}
public function put($key, $value, $minutes)
{
apc_store(Config::get('cache.key').$key, $value, $minutes * 60);
}
public function forget($key)
{
apc_delete(Config::get('cache.key').$key);
}
}