Source of file DevCheckController.php

Size: 0,966 Bytes - Last Modified: 2017-09-25T23:18:50+00:00

/var/www/docs.ssmods.com/process/src/src/Controllers/DevCheckController.php

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
<?php

namespace SilverStripe\EnvironmentCheck\Controllers;

use SilverStripe\Control\Controller;
use SilverStripe\EnvironmentCheck\EnvironmentChecker;

/**
 * Class DevCheckController
 *
 * @package environmentcheck
 */
class DevCheckController extends Controller
{
    /**
     * @var array
     */
    private static $allowed_actions = [
        'index'
    ];

    /**
     * Permission code to check for access to this controller.
     *
     * @var string
     */
    private static $permission = 'ADMIN';

    /**
     * @param HTTPRequest $request
     *
     * @return EnvironmentChecker
     *
     * @throws HTTPResponse_Exception
     */
    public function index($request)
    {
        $suite = 'check';

        if ($name = $request->param('Suite')) {
            $suite = $name;
        }

        $checker = new EnvironmentChecker($suite, 'Environment status');
        $checker->init($this->config()->permission);

        return $checker;
    }
}