silverstripe-environmentcheck/code/DevCheckController.php

38 lines
640 B
PHP
Raw Normal View History

<?php
class DevCheckController extends Controller {
2015-09-10 23:13:48 +02:00
/**
* @var array
*/
2013-06-21 05:36:45 +02:00
public static $allowed_actions = array(
'index'
);
/**
2015-09-10 23:13:48 +02:00
* Permission code to check for access to this controller.
*
* @var string
*/
private static $permission = 'ADMIN';
2015-09-10 23:13:48 +02:00
/**
* @param SS_HTTPRequest $request
*
* @return EnvironmentChecker
*
* @throws SS_HTTPResponse_Exception
*/
function index($request) {
2015-09-10 23:13:48 +02:00
$suite = 'check';
if ($name = $request->param('Suite')) {
$suite = $name;
}
$checker = new EnvironmentChecker($suite, 'Environment status');
$checker->init($this->config()->permission);
return $checker;
}
}