Browse Source

cleaning up code and comments.

Taylor Otwell 12 years ago
parent
commit
825e8b2d49

+ 5 - 7
laravel/session/drivers/cookie.php

@@ -1,6 +1,4 @@
-<?php namespace Laravel\Session\Drivers;
-
-use Laravel\Crypter;
+<?php namespace Laravel\Session\Drivers; use Laravel\Crypter, Laravel\Cookie as C;
 
 
 class Cookie extends Driver {
 class Cookie extends Driver {
 
 
@@ -21,9 +19,9 @@ class Cookie extends Driver {
 	 */
 	 */
 	public function load($id)
 	public function load($id)
 	{
 	{
-		if (\Laravel\Cookie::has(Cookie::payload))
+		if (C::has(Cookie::payload))
 		{
 		{
-			return unserialize(Crypter::decrypt(\Laravel\Cookie::get(Cookie::payload)));
+			return unserialize(Crypter::decrypt(C::get(Cookie::payload)));
 		}
 		}
 	}
 	}
 
 
@@ -41,7 +39,7 @@ class Cookie extends Driver {
 
 
 		$payload = Crypter::encrypt(serialize($session));
 		$payload = Crypter::encrypt(serialize($session));
 
 
-		\Laravel\Cookie::put(Cookie::payload, $payload, $lifetime, $path, $domain);
+		C::put(Cookie::payload, $payload, $lifetime, $path, $domain);
 	}
 	}
 
 
 	/**
 	/**
@@ -52,7 +50,7 @@ class Cookie extends Driver {
 	 */
 	 */
 	public function delete($id)
 	public function delete($id)
 	{
 	{
-		\Laravel\Cookie::forget(Cookie::payload);
+		C::forget(Cookie::payload);
 	}
 	}
 
 
 }
 }

+ 1 - 1
laravel/session/drivers/driver.php

@@ -31,7 +31,7 @@ abstract class Driver {
 	abstract public function delete($id);
 	abstract public function delete($id);
 
 
 	/**
 	/**
-	 * Insert a fresh session and return the payload array.
+	 * Create a fresh session array with a unique ID.
 	 *
 	 *
 	 * @return array
 	 * @return array
 	 */
 	 */

+ 2 - 3
laravel/session/payload.php

@@ -298,10 +298,9 @@ class Payload {
 		// session on the user's subsequent requests to the application.
 		// session on the user's subsequent requests to the application.
 		$this->cookie($config);
 		$this->cookie($config);
 
 
-		// Some session drivers implement the Sweeper interface, meaning that
+		// Some session drivers implement the Sweeper interface meaning that
 		// they must clean up expired sessions manually. If the driver is a
 		// they must clean up expired sessions manually. If the driver is a
-		// sweeper, we need to determine if garbage collection should be
-		// run for the request.
+		// sweeper, we'll calculate if we need to run garbage collection.
 		$sweepage = $config['sweepage'];
 		$sweepage = $config['sweepage'];
 
 
 		if ($this->driver instanceof Sweeper and (mt_rand(1, $sweepage[1]) <= $sweepage[0]))
 		if ($this->driver instanceof Sweeper and (mt_rand(1, $sweepage[1]) <= $sweepage[0]))