Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
10 / 10
Info
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
10 / 10
 phpinfo
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
10 / 10
<?php
namespace Luxian\Controller;
use Luxian\Http\Response;
class Info extends ControllerBase
{
    public function phpinfo()
    {
        $system = $this->container->getSystemProxy();
        $system->ob_start();
        $system->phpinfo();
        $html = $system->ob_get_clean();
        if ($html === false) {
            $message = 'Failed to use output buffering for phpinfo().';
            throw new \RuntimeException($message);
        }
        $response = new Response();
        $response->setBody($html);
        return $response;
    }
}