2016-01-06 00:34:58 +01:00
|
|
|
<?php
|
2014-08-06 06:29:52 +02:00
|
|
|
|
2016-08-19 00:51:35 +02:00
|
|
|
namespace SilverStripe\Dev;
|
|
|
|
|
|
|
|
use SilverStripe\Control\Controller;
|
|
|
|
use SilverStripe\Control\Director;
|
2016-06-15 06:03:16 +02:00
|
|
|
use SilverStripe\ORM\DatabaseAdmin;
|
|
|
|
|
2016-11-29 00:31:16 +01:00
|
|
|
class DevBuildController extends Controller
|
|
|
|
{
|
|
|
|
|
|
|
|
private static $url_handlers = array(
|
|
|
|
'' => 'build'
|
|
|
|
);
|
|
|
|
|
|
|
|
private static $allowed_actions = array(
|
|
|
|
'build'
|
|
|
|
);
|
|
|
|
|
|
|
|
public function build($request)
|
|
|
|
{
|
|
|
|
if (Director::is_cli()) {
|
|
|
|
$da = DatabaseAdmin::create();
|
|
|
|
return $da->handleRequest($request, $this->model);
|
|
|
|
} else {
|
|
|
|
$renderer = DebugView::create();
|
|
|
|
echo $renderer->renderHeader();
|
|
|
|
echo $renderer->renderInfo("Environment Builder", Director::absoluteBaseURL());
|
|
|
|
echo "<div class=\"build\">";
|
|
|
|
|
|
|
|
$da = DatabaseAdmin::create();
|
|
|
|
$response = $da->handleRequest($request, $this->model);
|
|
|
|
|
|
|
|
echo "</div>";
|
|
|
|
echo $renderer->renderFooter();
|
|
|
|
|
|
|
|
return $response;
|
|
|
|
}
|
|
|
|
}
|
2014-08-06 06:29:52 +02:00
|
|
|
}
|