Browse Source

Garbage fix
query update

chris 12 years ago
parent
commit
b47d79aafd

+ 1 - 1
Config/sql/token.sql

@@ -1,7 +1,7 @@
 -- tokens
 CREATE TABLE IF NOT EXISTS `{prefix}tokens` (
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `user_id` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
+  `user_id` int(10) COLLATE utf8_unicode_ci DEFAULT NULL,
   `type` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT 'e.g.:activate,reactivate',
   `key` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
   `content` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT 'can transport some information',

+ 2 - 2
Console/Command/CopyShell.php

@@ -100,7 +100,7 @@ class CopyShell extends AppShell {
 		$this->tmpFolder = TMP . 'cache' . DS . 'copy' . DS;
 
 		/*
-		TODO - garbige clean up of log file
+		TODO - garbage clean up of log file
 		if (file_exists($this->tmpFolder.'log.txt') && (int)round(filesize($this->tmpFolder.'log.txt')/1024) > 2000) { # > 2 MB
 			unlink($this->tmpFolder.'log.txt');
 		}
@@ -587,7 +587,7 @@ class CopyShell extends AppShell {
 
 	/**
 	 * Makes sure type matches config name (app = only app configs, no cake or vendor or custom configs!)
-	 * 
+	 *
 	 * @return string type on success, otherwise boolean false
 	 */
 	protected function typeMatchesConfigName($name, $type) {

+ 1 - 1
Model/MyModel.php

@@ -1298,7 +1298,7 @@ class MyModel extends Model {
 
 	/**
 	 * NOW: can be set to work offline only (if server is down etc)
-	 * Checks if a email is not from a garbige hoster
+	 * Checks if a email is not from a garbage hoster
 	 *
 	 * @param string email (necessary)
 	 * @return boolean true if valid, else false

+ 1 - 1
Model/Qurl.php

@@ -171,7 +171,7 @@ class Qurl extends ToolsAppModel {
 	 *
 	 * @return boolean success
 	 */
-	public function garbigeCollector() {
+	public function garbageCollector() {
 		$conditions = array(
 			$this->alias . '.created <' => date(FORMAT_DB_DATETIME, time() - $this->validity),
 		);

+ 1 - 1
Model/Token.php

@@ -161,7 +161,7 @@ class Token extends ToolsAppModel {
 	 *
 	 * @return boolean success
 	 */
-	public function garbigeCollector() {
+	public function garbageCollector() {
 		$conditions = array(
 			$this->alias . '.created <' => date(FORMAT_DB_DATETIME, time() - $this->validity),
 		);

+ 2 - 2
Test/Case/Model/CodeKeyTest.php

@@ -44,7 +44,7 @@ class CodeKeyTest extends MyCakeTestCase {
 		$this->assertFalse($res);
 	}
 
-	public function testGarbigeCollector() {
+	public function testGarbageCollector() {
 		$data = array(
 			'created' => date(FORMAT_DB_DATETIME, time() - 3 * MONTH),
 			'type' => 'y',
@@ -53,7 +53,7 @@ class CodeKeyTest extends MyCakeTestCase {
 		$this->CodeKey->create();
 		$this->CodeKey->save($data, false);
 		$count = $this->CodeKey->find('count');
-		$this->CodeKey->garbigeCollector();
+		$this->CodeKey->garbageCollector();
 		$count2 = $this->CodeKey->find('count');
 		$this->assertTrue($count > $count2);
 	}

+ 2 - 2
Test/Case/Model/TokenTest.php

@@ -44,7 +44,7 @@ class TokenTest extends MyCakeTestCase {
 		$this->assertFalse($res);
 	}
 
-	public function testGarbigeCollector() {
+	public function testGarbageCollector() {
 		$data = array(
 			'created' => date(FORMAT_DB_DATETIME, time() - 3 * MONTH),
 			'type' => 'y',
@@ -53,7 +53,7 @@ class TokenTest extends MyCakeTestCase {
 		$this->Token->create();
 		$this->Token->save($data, false);
 		$count = $this->Token->find('count');
-		$this->Token->garbigeCollector();
+		$this->Token->garbageCollector();
 		$count2 = $this->Token->find('count');
 		$this->assertTrue($count > $count2);
 	}

+ 4 - 4
Test/Case/View/Helper/GravatarHelperTest.php

@@ -5,7 +5,7 @@ if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
 }
 
 define('VALID_TEST_EMAIL', 'graham@grahamweldon.com'); # for testing normal behavior
-define('GARBIGE_TEST_EMAIL', 'test@test.de'); # for testing default image behavior
+define('GARBAGE_TEST_EMAIL', 'test@test.de'); # for testing default image behavior
 
 App::uses('HtmlHelper', 'View/Helper');
 App::uses('GravatarHelper', 'Tools.View/Helper');
@@ -55,7 +55,7 @@ class GravatarHelperTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testImages() {
-		$is = $this->Gravatar->image(GARBIGE_TEST_EMAIL);
+		$is = $this->Gravatar->image(GARBAGE_TEST_EMAIL);
 		$this->out($is);
 		$this->assertTrue(!empty($is));
 
@@ -87,11 +87,11 @@ class GravatarHelperTest extends MyCakeTestCase {
 		$this->out($is);
 		$this->assertTrue(!empty($is));
 
-		$is = $this->Gravatar->image(GARBIGE_TEST_EMAIL, array('default' => 'none'));
+		$is = $this->Gravatar->image(GARBAGE_TEST_EMAIL, array('default' => 'none'));
 		$this->out($is);
 		$this->assertTrue(!empty($is));
 
-		$is = $this->Gravatar->image(GARBIGE_TEST_EMAIL, array('default' => 'http://2.gravatar.com/avatar/8379aabc84ecee06f48d8ca48e09eef4?d=identicon'));
+		$is = $this->Gravatar->image(GARBAGE_TEST_EMAIL, array('default' => 'http://2.gravatar.com/avatar/8379aabc84ecee06f48d8ca48e09eef4?d=identicon'));
 		$this->out($is);
 		$this->assertTrue(!empty($is));
 	}