bootstrap.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. return [
  3. // Route configuration
  4. 'route_path' => __DIR__ .'/app/route.php',
  5. // Application configuration file location can be modified freely
  6. // Key represents the name of the sub-application; sub-applications not listed cannot be accessed
  7. 'config' => [
  8. // Default configuration
  9. '' => require 'app/config.php',
  10. // If a sub-application does not mention a configuration, the content of the default configuration file will be used
  11. // 'admin'=> (require 'app/admin/config.php') + (require 'app/config.php'),
  12. // Or only use the default configuration
  13. // 'phone'=> require 'app/config.php',
  14. // Or do not use the default configuration, directly use your custom sub-application configuration, you can change the name freely
  15. // 'phone'=> require 'app/config_phone.php',
  16. // Or this way, each configuration item is introduced separately
  17. // 'admin'=> [
  18. // 'app_name' => 'admin',
  19. // 'request_middleware' => require 'app/admin/config_request_middleware.php',
  20. // 'middleware' => require 'app/admin/config_middleware.php',
  21. // 'database' => require 'app/admin/config_database.php',
  22. // 'cookie' => require 'app/admin/config_cookie.php',
  23. // 'database' => require 'app/admin/config_database.php',
  24. // ],
  25. ],
  26. // Create route manager
  27. 'Route' => \DI\create(\Cyber\Route::class),
  28. 'Middleware' => \DI\create(\Cyber\Middleware::class),
  29. // Create request object for handling HTTP requests
  30. 'Request' => \DI\create(\Cyber\Request::class),
  31. // Create response object for generating HTTP responses
  32. 'Response' => \DI\create(\Cyber\Response::class),
  33. ];