ソースを参照

remove untested and troublesome method

euromark 12 年 前
コミット
c396c50e0e

+ 1 - 1
Controller/Component/CommonComponent.php

@@ -587,7 +587,7 @@ class CommonComponent extends Component {
 		if (!$ref) {
 		if (!$ref) {
 			return false;
 			return false;
 		}
 		}
-		$base = FULL_BASE_URL . $this->Controller->webroot;
+		$base = Configure::read('App.fullBaseUrl') . $this->Controller->webroot;
 		if (strpos($ref, $base) === 0) {
 		if (strpos($ref, $base) === 0) {
 			return false;
 			return false;
 		}
 		}

+ 0 - 22
Model/MyModel.php

@@ -206,28 +206,6 @@ class MyModel extends Model {
 	}
 	}
 
 
 	/**
 	/**
-	 * Catch database errors before it's too late
-	 * //TODO: testing
-	 */
-	public function onError() {
-		$err = $this->lastError();
-		if (!empty($err)) {
-			$this->log($err, 'sql_error');
-		} else {
-			$this->log('unknown error', 'sql_error');
-		}
-		if (!empty($this->data)) {
-			$data = $this->data;
-		} elseif ($this->id) {
-			$data = 'id ' . $this->id;
-		} else {
-			$data = 'no data';
-		}
-		$data .= ' (' . env('REDIRECT_URL') . ')';
-		$this->log($data, 'sql_error');
-	}
-
-	/**
 	 * @return string Error message with error number
 	 * @return string Error message with error number
 	 */
 	 */
 	public function lastError() {
 	public function lastError() {

+ 3 - 3
Test/Case/View/Helper/CommonHelperTest.php

@@ -12,9 +12,9 @@ class CommonHelperTest extends MyCakeTestCase {
 
 
 	public function setUp() {
 	public function setUp() {
 		parent::setUp();
 		parent::setUp();
-  	if (!Configure::read('App.fullBaseUrl')) {
-  		Configure::write('App.fullBaseUrl', 'http://localhost');
-  	}
+		if (!Configure::read('App.fullBaseUrl')) {
+			Configure::write('App.fullBaseUrl', 'http://localhost');
+		}
 
 
 		$this->Common = new CommonHelper(new View(null));
 		$this->Common = new CommonHelper(new View(null));
 	}
 	}