silverstripe /
silverstripe-environmentcheck
| 1 | <?php |
||
| 2 | |||
| 3 | namespace SilverStripe\EnvironmentCheck\Controllers; |
||
| 4 | |||
| 5 | use SilverStripe\Control\Controller; |
||
| 6 | use SilverStripe\Control\HTTPRequest; |
||
| 7 | use SilverStripe\Control\HTTPResponse_Exception; |
||
| 8 | use SilverStripe\EnvironmentCheck\EnvironmentChecker; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * Class DevCheckController |
||
| 12 | * |
||
| 13 | * @package environmentcheck |
||
| 14 | */ |
||
| 15 | class DevCheckController extends Controller |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var array |
||
| 19 | */ |
||
| 20 | private static $allowed_actions = [ |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 21 | 'index' |
||
| 22 | ]; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Permission code to check for access to this controller. |
||
| 26 | * |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | private static $permission = 'ADMIN'; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param HTTPRequest $request |
||
| 33 | * |
||
| 34 | * @return EnvironmentChecker |
||
| 35 | * |
||
| 36 | * @throws HTTPResponse_Exception |
||
| 37 | */ |
||
| 38 | public function index($request) |
||
| 39 | { |
||
| 40 | $suite = 'check'; |
||
| 41 | |||
| 42 | if ($name = $request->param('Suite')) { |
||
| 43 | $suite = $name; |
||
| 44 | } |
||
| 45 | |||
| 46 | $checker = new EnvironmentChecker($suite, 'Environment status'); |
||
| 47 | $checker->setRequest($request); |
||
| 48 | $checker->init($this->config()->permission); |
||
| 49 | |||
| 50 | return $checker; |
||
| 51 | } |
||
| 52 | } |
||
| 53 |