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

30
laravel/cache/memcached.php vendored Normal file
View File

@@ -0,0 +1,30 @@
<?php namespace Laravel\Cache;
use Laravel\Config;
use Laravel\Memcached as Mem;
class Memcached extends Driver {
public function has($key)
{
return ( ! is_null($this->get($key)));
}
public function get($key, $default = null)
{
$item = (($cache = Mem::instance()->get(Config::get('cache.key').$key)) !== false) ? $cache : null;
return $this->prepare($item, $default);
}
public function put($key, $value, $minutes)
{
Mem::instance()->set(Config::get('cache.key').$key, $value, 0, $minutes * 60);
}
public function forget($key)
{
Mem::instance()->delete(Config::get('cache.key').$key);
}
}