- 76 if($this->method($this->args)) {
- 77 $this->found = true;
- 78 break;
- 79 }
- 80 }
- 81
- 82 if (!$this->found) {
- 83 $pipeline = $this->_pipeline();
- 84 if (!$pipeline) {
- 85 $this->_checkErrors();
- 86 }
- 87 }
- 88 }
- 89
- 90 /**
- 91 * Pipeline logic
- 92 *
- 93 * @return void
- 94 */
- 95 private function _pipeline()
- 96 {
- 35 *
- 36 * @param $name
- 37 * @param $args
- 38 *
- 39 * @return static::resolve(static::class)
- 40 */
- 41 public static function __callStatic(string $name, mixed $args)
- 42 {
- 43 $c = static::resolve(static::class);
- 44 return $c->$name(...$args);
- 45 }
- 46 }
- 77 }
- 78
- 79 /**
- 80 * Handle the request
- 81 *
- 82 * @return void
- 83 */
- 84 public function handle()
- 85 {
- 86 return Route::bind();
- 87 }
- 88
- 89 /**
- 90 * Start the application
- 91 *
- 92 * @return void
- 93 */
- 94 private function start()
- 95 {
- 96 // start the session
- 97 if (!session_id()) session_start();
- 44 define('BP', $this->basePath);
- 45
- 46 // Connection::bootstrap(include "$this->basePath/config/database.php");
- 47 $this->start();
- 48
- 49 // error reporting
- 50 $this->errorReporting();
- 51
- 52 // handle Request
- 53 $this->handle();
- 54
- 55 }
- 56
- 57 /**
- 58 * Error reporting
- 59 *
- 60 * @return void
- 61 */
- 62 public function errorReporting()
- 63 {
- 64 // if debug AND not production
- 10 class Application extends \Frameki\Application
- 11 {
- 12 public $basePath = null;
- 13
- 14 /**
- 15 * @inheritdoc
- 16 */
- 17 public function __construct()
- 18 {
- 19 parent::__construct(dirname(__DIR__));
- 20
- 21 static::bootstrap();
- 22 }
- 23
- 24 /**
- 25 * Bootstrap the application
- 26 *
- 27 * @return void
- 28 */
- 29 public static function bootstrap()
- 30 {
- 11 * Inject autloader
- 12 */
- 13 require __DIR__.'/../vendor/autoload.php';
- 14
- 15 /**
- 16 * Run bootstrap app
- 17 */
- 18 require_once __DIR__.'/../bootstrap/app.php';
- 19
- 20 $app = new Application;