<?php error_reporting(E_ALL); ini_set('display_errors', 1); require_once __DIR__ . '/../vendor/autoloader.php'; use Sophwork\core\Sophwork; use Sophwork\app\app\SophworkApp; $autoloader->config = '/var/www/blueShell/src'; $app = new SophworkApp(['baseUrl' => '/blueShell/web']); $app->get('/', ['BlueShell\\Shell' => 'shell']); $app->run();
use Sophwork\app\app\SophworkApp; use Sophwork\modules\handlers\errors\errorHandler\ErrorHandler; use Sophwork\modules\handlers\requests\Requests; use Sophwork\modules\handlers\responses\Responses; // Set up the source path for the autoloader $autoloader->sources = __DIR__ . '/../src/'; /* * Create a new applicaion with the Sophwork class * It will create 3 new class : * - appController class * - appModel class * - appView class * * Set up app parameters here or in the config file */ $app = new SophworkApp(['template' => __DIR__ . '/../template/']); /** * Sophwork provide in its module a simple error handle * to display error more readable */ // Force the application to display errors $app->debug = true; // Inject the ErrorHandler in the app $app->inject(new ErrorHandler()); /** * Declare your own error handler and customise your message to the user * * NOTE : this only work if your injet the Sophwork errorHandler in your app ! */ $app->errors(function ($e, $errorCode) { echo '<h1>Custom Error !</h1>';