mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
41 lines
950 B
PHP
41 lines
950 B
PHP
<?php
|
|
|
|
namespace SilverStripe\Dev;
|
|
|
|
use SilverStripe\Control\Controller;
|
|
use SilverStripe\Control\Director;
|
|
use SilverStripe\ORM\DatabaseAdmin;
|
|
|
|
class DevBuildController extends Controller
|
|
{
|
|
|
|
private static $url_handlers = [
|
|
'' => 'build'
|
|
];
|
|
|
|
private static $allowed_actions = [
|
|
'build'
|
|
];
|
|
|
|
public function build($request)
|
|
{
|
|
if (Director::is_cli()) {
|
|
$da = DatabaseAdmin::create();
|
|
return $da->handleRequest($request);
|
|
} 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);
|
|
|
|
echo "</div>";
|
|
echo $renderer->renderFooter();
|
|
|
|
return $response;
|
|
}
|
|
}
|
|
}
|