Skip to content
Permalink
Browse files

Remove getAjaxVersion().

It was very specific to prototype, which has a very low adoption rate
these days.

/**
 * testRequestClientTypes method
 *
 * @return void
 */
	public function testRequestClientTypes() {
		$this->RequestHandler->request->env('HTTP_X_PROTOTYPE_VERSION', '1.5');
		$this->assertEquals('1.5', $this->RequestHandler->getAjaxVersion());

		$this->RequestHandler->request->env('HTTP_X_REQUESTED_WITH', false);
		$this->RequestHandler->request->env('HTTP_X_PROTOTYPE_VERSION', false);
		$this->assertFalse($this->RequestHandler->getAjaxVersion());
	}
  • Loading branch information...
markstory committed Jul 26, 2014
1 parent 6b9c4b6 commit 7818b37ebd97fb2d6cf17e8c3013b562feb54e3c
@@ -355,17 +355,6 @@ public function isWap() {
return $this->prefers('wap');
}
/**
* Gets Prototype version if call is Ajax, otherwise empty string.
* The Prototype library sets a special "Prototype version" HTTP header.
*
* @return string|bool When Ajax the prototype version of component making the call otherwise false
*/
public function getAjaxVersion() {
$httpX = $this->request->env('HTTP_X_PROTOTYPE_VERSION');
return ($httpX === null) ? false : $httpX;
}
/**
* Determines which content types the client accepts. Acceptance is based on
* the file extension parsed by the Router (if present), and by the HTTP_ACCEPT
@@ -604,20 +604,6 @@ public function testRenderAsCalledTwice() {
$this->assertEquals('js', $this->Controller->layoutPath);
}
/**
* testRequestClientTypes method
*
* @return void
*/
public function testRequestClientTypes() {
$this->RequestHandler->request->env('HTTP_X_PROTOTYPE_VERSION', '1.5');
$this->assertEquals('1.5', $this->RequestHandler->getAjaxVersion());
$this->RequestHandler->request->env('HTTP_X_REQUESTED_WITH', false);
$this->RequestHandler->request->env('HTTP_X_PROTOTYPE_VERSION', false);
$this->assertFalse($this->RequestHandler->getAjaxVersion());
}
/**
* testRequestContentTypes method
*

0 comments on commit 7818b37

Please sign in to comment.
You can’t perform that action at this time.