silverstripe-framework/Dev/DevBuildController.php
Damian Mooyman 8dd644d25d
API Namespace all classes
Namespace all templates
Move difflib and BBCodeParser2 to thirdparty
Remove deprecated API marked for removal in 4.0
2016-09-08 10:23:17 +12:00

40 lines
837 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 = 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;
}
}
}