mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-27 13:06:04 +02:00
25 lines
554 B
PHP
25 lines
554 B
PHP
<?php
|
|
// Fake a current controller. Way harder than it should be
|
|
class FakeController extends Controller {
|
|
|
|
public function __construct() {
|
|
parent::__construct();
|
|
|
|
$session = Injector::inst()->create('Session', isset($_SESSION) ? $_SESSION : array());
|
|
$this->setSession($session);
|
|
|
|
$this->pushCurrent();
|
|
|
|
$this->request = new SS_HTTPRequest(
|
|
(isset($_SERVER['X-HTTP-Method-Override']))
|
|
? $_SERVER['X-HTTP-Method-Override']
|
|
: $_SERVER['REQUEST_METHOD'],
|
|
'/'
|
|
);
|
|
|
|
$this->response = new SS_HTTPResponse();
|
|
|
|
$this->init();
|
|
}
|
|
}
|