Browse Source

Update to 2.5

euromark 11 years ago
parent
commit
d6af215c82

+ 1 - 26
Controller/Component/CommonComponent.php

@@ -259,31 +259,6 @@ class CommonComponent extends Component {
 	}
 
 	/**
-	 * Used to get the value of a named param.
-	 * @deprecated - move to query strings instead
-	 *
-	 * @param mixed $var
-	 * @param mixed $default
-	 * @return mixed
-	 */
-	public function getNamedParam($var, $default = null) {
-		return (isset($this->Controller->request->params['named'][$var])) ? $this->Controller->request->params['named'][$var] : $default;
-	}
-
-	/**
-	 * Used to get the value of a get query.
-	 * @deprecated - use request->query() instead
-	 *
-	 * @param mixed $var
-	 * @param mixed $default
-	 * @return mixed
-	 */
-	public function getQueryParam($var, $default = null) {
-		trigger_error('deprecated - use $this->request->query()');
-		return (isset($this->Controller->request->query[$var])) ? $this->Controller->request->query[$var] : $default;
-	}
-
-	/**
 	 * Returns defaultUrlParams including configured prefixes.
 	 *
 	 * @return array Url params
@@ -594,7 +569,7 @@ class CommonComponent extends Component {
 	 * @return void
 	 */
 	public function monitorCookieProblems() {
-		$ip = $this->RequestHandler->getClientIP();
+		$ip = $this->request->clientIp();
 		$host = gethostbyaddr($ip);
 		$sessionId = session_id();
 		if (empty($sessionId)) {

+ 1 - 1
Controller/Component/MobileComponent.php

@@ -149,7 +149,7 @@ class MobileComponent extends Component {
 		*      (int) 0 => '/var/www/maps-cakephp2/app/View/'
 		* )
 		*/
-		$mobileViewFile = $viewDir[0] . $this->viewPath . DS . 'Mobile' . DS . $this->params['action'] . '.ctp';
+		$mobileViewFile = $viewDir[0] . $this->viewPath . DS . 'Mobile' . DS . $this->request->params['action'] . '.ctp';
 
 		//Debugger::log($this->viewPath);
 		// use this to log the output to

+ 1 - 1
Controller/QloginController.php

@@ -102,7 +102,7 @@ class QloginController extends ToolsAppController {
 	 * @return void
 	 */
 	public function admin_reset() {
-		$this->request->onlyAllow('post', 'delete');
+		$this->request->allowMethod(array('post', 'delete'));
 		$this->Token = ClassRegistry::init('Tools.Token');
 		$this->Token->deleteAll(array('type' => 'qlogin'));
 		$this->Common->flashMessage(__('Success'), 'success');

+ 2 - 2
Test/Case/Controller/Component/CommonComponentTest.php

@@ -93,10 +93,10 @@ class CommonComponentTest extends CakeTestCase {
 	 * @return void
 	 */
 	public function testGetParams() {
-		$is = $this->Controller->Common->getNamedParam('x');
+		$is = $this->Controller->Common->getPassedParam('x');
 		$this->assertNull($is);
 
-		$is = $this->Controller->Common->getNamedParam('x', 'y');
+		$is = $this->Controller->Common->getPassedParam('x', 'y');
 		$this->assertSame('y', $is);
 	}