2012-01-10 07:28:04 +01:00
|
|
|
<?php
|
|
|
|
|
2017-01-04 23:16:12 +01:00
|
|
|
namespace SilverStripe\EnvironmentCheck\Controllers;
|
|
|
|
|
|
|
|
use SilverStripe\Control\Controller;
|
|
|
|
use SilverStripe\EnvironmentCheck\EnvironmentChecker;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class DevCheckController
|
|
|
|
*
|
|
|
|
* @package environmentcheck
|
|
|
|
*/
|
2015-11-21 07:18:35 +01:00
|
|
|
class DevCheckController extends Controller
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2017-03-21 11:57:07 +01:00
|
|
|
public static $allowed_actions = [
|
2015-11-21 07:18:35 +01:00
|
|
|
'index'
|
2017-03-21 11:57:07 +01:00
|
|
|
];
|
2013-06-21 05:36:45 +02:00
|
|
|
|
2015-11-21 07:18:35 +01:00
|
|
|
/**
|
|
|
|
* Permission code to check for access to this controller.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private static $permission = 'ADMIN';
|
2015-04-09 01:39:34 +02:00
|
|
|
|
2015-11-21 07:18:35 +01:00
|
|
|
/**
|
2017-01-04 23:16:12 +01:00
|
|
|
* @param HTTPRequest $request
|
2015-11-21 07:18:35 +01:00
|
|
|
*
|
|
|
|
* @return EnvironmentChecker
|
|
|
|
*
|
2017-01-04 23:16:12 +01:00
|
|
|
* @throws HTTPResponse_Exception
|
2015-11-21 07:18:35 +01:00
|
|
|
*/
|
|
|
|
public function index($request)
|
|
|
|
{
|
|
|
|
$suite = 'check';
|
2015-09-10 23:13:48 +02:00
|
|
|
|
2015-11-21 07:18:35 +01:00
|
|
|
if ($name = $request->param('Suite')) {
|
|
|
|
$suite = $name;
|
|
|
|
}
|
2015-09-10 23:13:48 +02:00
|
|
|
|
2015-11-21 07:18:35 +01:00
|
|
|
$checker = new EnvironmentChecker($suite, 'Environment status');
|
|
|
|
$checker->init($this->config()->permission);
|
2015-09-10 23:13:48 +02:00
|
|
|
|
2015-11-21 07:18:35 +01:00
|
|
|
return $checker;
|
|
|
|
}
|
2012-01-10 07:28:04 +01:00
|
|
|
}
|