暫無描述

index.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. declare(strict_types=1);
  3. use Phalcon\Di\FactoryDefault;
  4. error_reporting(E_ALL);
  5. define('BASE_PATH', dirname(__DIR__));
  6. define('APP_PATH', BASE_PATH . '/app');
  7. try {
  8. /**
  9. * The FactoryDefault Dependency Injector automatically registers
  10. * the services that provide a full stack framework.
  11. */
  12. $di = new FactoryDefault();
  13. /**
  14. * Read services
  15. */
  16. include APP_PATH . '/config/services.php';
  17. /**
  18. * Handle routes
  19. */
  20. include APP_PATH . '/config/router.php';
  21. /**
  22. * Get config service for use in inline setup below
  23. */
  24. $config = $di->getConfig();
  25. /**
  26. * Include Autoloader
  27. */
  28. include APP_PATH . '/config/loader.php';
  29. /**
  30. * Handle the request
  31. */
  32. $application = new \Phalcon\Mvc\Application($di);
  33. //$request = new \Phalcon\Http\Request();
  34. //$application->handle($request->getURI())->send();
  35. $application->handle($_SERVER['REQUEST_URI'])->send();
  36. } catch (\Exception $e) {
  37. echo $e->getMessage() . '<br>';
  38. echo '<pre>' . $e->getTraceAsString() . '</pre>';
  39. }