CodeIgniter 4.5の処理の流れ
CodeIgniter 4.5の処理の流れをまとめました。
CodeIgniter 4.5 Process Flow
public/index.php
check PHP version
define constant FCPATH
set current directory
instantiate Config\Paths
- Config\Paths
- $systemDirectory
- $appDirectory
- $writableDirectory
- $testsDirectory
- $viewDirectory
load system/Boot.php
- Boot
- define path constants
- APPPATH
- ROOTPATH
- SYSTEMPATH
- WRITEPATH
- TESTPATH
- load constants
- load Config/Constants.php
- check missing required PHP extensions
- load dot env
- instantiate DotEnv
- load .env file
- instantiate DotEnv
- define Environment
- load Environment bootstrap
- load common functions
- load Common.php
- load Autoloader
- Services::autoloader()
- instantiate Autoloader
- initialize()
- load Composer autoloader
- register()
- load Services
- Services::autoloader()
- set Exception handler
- Services::exceptions()
- instantiate FileLocator
- initialize()
- set Exception/Error handler
- Services::exceptions()
- initialize Kint
- autoload helpers
- load URL helper
- initialize CodeIgniter
- Services::codeigniter()
- instantiate Config\App
- instantiate CodeIgniter
- initialize()
- set default locale (Locale::setDefault())
- set default timezone
- setContext()
- Services::codeigniter()
- run CodeIgniter
- run()
- getRequestObject()
- Services::createRequest()
- Services::incomingrequest()
- Services::uri()
- Services::siteurifactory()
- instantiate SiteURIFactory
- SiteURIFactory::createFromGlobals()
- detectRoutePath()
- update superglobals
- update $_SERVER
- update $_GET
- update superglobals
- instantiate SiteURI
- detectRoutePath()
- Services::siteurifactory()
- instantiate UserAgent
- instantiate Request
- IncomingRequest::__construct()
- detectLocale()
- if $negotiateLocale is true
- get lang from content negotiation
- setLocale()
- set locale in Request
- set default locale (Locale::setDefault())
- if $negotiateLocale is true
- detectLocale()
- IncomingRequest::__construct()
- Services::uri()
- Services::incomingrequest()
- spoof request method
- Services::createRequest()
- getResponseObject()
- instantiate Response
- Event pre_system
- instantiate Filters
- run Required before Filters
- force secure access
- check Page Cache
- handleRequest()
- tryToRouteIt()
- instantiate Routes
- instantiate Router
- get Controller and method name
- get locale from route
- if route contains locale
- Request::setLocale()
- set locale in Request
- set default locale (Locale::setDefault())
- Request::setLocale()
- if route contains locale
- get Route Filters Info
- enable Controller Filters
- run before Filters
- run Controller
- run Closure controller
- or
- instantiate Controller
- Event post_controller_constructor
- run Controller method
- gather output
- run after Filters
- return Response object
- tryToRouteIt()
- run Required after Filters
- Event post_system
- sendResponse()
- getRequestObject()
- run()
- define path constants