Browse Source

use memcached instead of memcache.

Taylor Otwell 12 years ago
parent
commit
8c4170491e
2 changed files with 8 additions and 8 deletions
  1. 5 5
      laravel/cache/drivers/memcached.php
  2. 3 3
      laravel/memcached.php

+ 5 - 5
laravel/cache/drivers/memcached.php

@@ -1,11 +1,11 @@
-<?php namespace Laravel\Cache\Drivers; use Memcache;
+<?php namespace Laravel\Cache\Drivers;
 
 class Memcached extends Driver {
 
 	/**
 	 * The Memcache instance.
 	 *
-	 * @var Memcache
+	 * @var Memcached
 	 */
 	protected $memcache;
 
@@ -19,10 +19,10 @@ class Memcached extends Driver {
 	/**
 	 * Create a new Memcached cache driver instance.
 	 *
-	 * @param  Memcache  $memcache
+	 * @param  Memcached  $memcache
 	 * @return void
 	 */
-	public function __construct(Memcache $memcache, $key)
+	public function __construct(\Memcached $memcache, $key)
 	{
 		$this->key = $key;
 		$this->memcache = $memcache;
@@ -68,7 +68,7 @@ class Memcached extends Driver {
 	 */
 	public function put($key, $value, $minutes)
 	{
-		$this->memcache->set($this->key.$key, $value, 0, $minutes * 60);
+		$this->memcache->set($this->key.$key, $value, $minutes * 60);
 	}
 
 	/**

+ 3 - 3
laravel/memcached.php

@@ -5,7 +5,7 @@ class Memcached {
 	/**
 	 * The Memcached connection instance.
 	 *
-	 * @var Memcache
+	 * @var Memcached
 	 */
 	protected static $connection;
 
@@ -40,11 +40,11 @@ class Memcached {
 	 */
 	protected static function connect($servers)
 	{
-		$memcache = new \Memcache;
+		$memcache = new \Memcached;
 
 		foreach ($servers as $server)
 		{
-			$memcache->addServer($server['host'], $server['port'], true, $server['weight']);
+			$memcache->addServer($server['host'], $server['port'], $server['weight']);
 		}
 
 		if ($memcache->getVersion() === false)