1
1
# Utilize modes and application initialization
2
2
3
3
## Identify the steps for application initialization.
4
- [ app/bootstrap.php] ( https://github.com/magento/magento2/blob/2.3-develop /app/bootstrap.php ) :
4
+ [ app/bootstrap.php] ( https://github.com/magento/magento2/blob/2.3/app/bootstrap.php ) :
5
5
6
6
- composer autoloader, functions, umask, timezone UTC, php precision
7
7
8
- [ \Magento\Framework\App\Bootstrap] ( https://github.com/magento/magento2/blob/2.3-develop /lib/internal/Magento/Framework/App/Bootstrap.php ) ::* create*
8
+ [ \Magento\Framework\App\Bootstrap] ( https://github.com/magento/magento2/blob/2.3/lib/internal/Magento/Framework/App/Bootstrap.php ) ::* create*
9
9
10
10
- configure autoloader - PSR-4 prepend generation\Magento
11
11
12
- [ \Magento\Framework\App\Bootstrap] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/App/Bootstrap.php ) ::* createApplication*
12
+ [ \Magento\Framework\App\Bootstrap] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/App/Bootstrap.php ) ::* createApplication*
13
13
14
14
- just call object manager->create
15
15
16
- [ \Magento\Framework\App\Bootstrap] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/App/Bootstrap.php ) ::* run*
16
+ [ \Magento\Framework\App\Bootstrap] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/App/Bootstrap.php ) ::* run*
17
17
18
18
- set error handler
19
19
- assert maintenance
27
27
28
28
### Application class
29
29
30
- [ bootstrap->createApplication()] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/App/Bootstrap.php#L230 )
30
+ [ bootstrap->createApplication()] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/App/Bootstrap.php#L230 )
31
31
32
- - [ \Magento\Framework\App\Http] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/App/Http.php ) - index.php, pub/index.php
32
+ - [ \Magento\Framework\App\Http] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/App/Http.php ) - index.php, pub/index.php
33
33
load config area by front name
34
34
front controller->dispatch
35
35
event ` controller_front_send_response_before `
36
36
37
- - [ \Magento\Framework\App\Cron] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/App/Cron.php ) - pub/cron.php
37
+ - [ \Magento\Framework\App\Cron] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/App/Cron.php ) - pub/cron.php
38
38
config area ` crontab `
39
39
load translations
40
40
dispatch event ` default `
41
41
42
- - [ \Magento\MediaStorage\App\Media] ( https://github.com/magento/magento2/blob/2.2-develop /app/code/Magento/MediaStorage/App/Media.php ) - pub/get.php
42
+ - [ \Magento\MediaStorage\App\Media] ( https://github.com/magento/magento2/blob/2.3 /app/code/Magento/MediaStorage/App/Media.php ) - pub/get.php
43
43
access /media/* when using DB image storage and physical file doesn't exist
44
44
45
- - [ \Magento\Framework\App\StaticResource] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/App/StaticResource.php ) - pub/static.php
45
+ - [ \Magento\Framework\App\StaticResource] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/App/StaticResource.php ) - pub/static.php
46
46
404 in production
47
47
/$area/$resource/$file/... params, load config by params
48
48
sends file in response
49
49
assetRepo->createAsset - \Magento\Framework\View\Asset\File
50
50
assetPublisher->publish - materialize (copy/symlink) file if doesn't exist
51
51
52
- - [ \Magento\Indexer\App\Indexer] ( https://github.com/magento/magento2/blob/2.2-develop /app/code/Magento/Indexer/App/Indexer.php ) - module-indexer, unused?
53
- - [ \Magento\Backend\App\UserConfig] ( https://github.com/magento/magento2/blob/2.2-develop /app/code/Magento/Backend/App/UserConfig.php ) - module-backend, unused?
52
+ - [ \Magento\Indexer\App\Indexer] ( https://github.com/magento/magento2/blob/2.3 /app/code/Magento/Indexer/App/Indexer.php ) - module-indexer, unused?
53
+ - [ \Magento\Backend\App\UserConfig] ( https://github.com/magento/magento2/blob/2.3 /app/code/Magento/Backend/App/UserConfig.php ) - module-backend, unused?
54
54
55
55
Notes:
56
56
61
61
62
62
### HTTP application
63
63
64
- [ \Magento\Framework\App\Http::launch] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/App/Http.php#L128 )
64
+ [ \Magento\Framework\App\Http::launch] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/App/Http.php#L128 )
65
65
1 . detect config area by front name
66
66
67
67
``` php
@@ -71,19 +71,19 @@ $this->_state->setAreaCode($areaCode);
71
71
$this->_objectManager->configure($this->_configLoader->load($areaCode));
72
72
```
73
73
74
- ` \Magento\Framework\App\AreaList ` - areas from argument di.xml ([ AreaList] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/App/AreaList.php ) )
74
+ ` \Magento\Framework\App\AreaList ` - areas from argument di.xml ([ AreaList] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/App/AreaList.php ) )
75
75
76
76
- frontend = [ frontname null, router "standard"] --- * default when nothing matched*
77
77
- adminhtml - [ frontNameResolver=..., router "admin"]
78
- [ \Magento\Backend\App\Area\FrontNameResolver::getFrontName(checkhost)] ( https://github.com/magento/magento2/blob/2.2-develop /app/code/Magento/Backend/App/Area/FrontNameResolver.php#L83 )
78
+ [ \Magento\Backend\App\Area\FrontNameResolver::getFrontName(checkhost)] ( https://github.com/magento/magento2/blob/2.3 /app/code/Magento/Backend/App/Area/FrontNameResolver.php#L83 )
79
79
system config ` admin/url/use_custom ` , ` admin/url/custom `
80
80
- crontab = null
81
81
- webapi_rest = [ frontName ` /rest ` ]
82
82
- webapi_soap = [ frontname ` /soap ` ]
83
83
84
- 1 . [ ObjectManagerInterface->configure()] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/ObjectManager/ObjectManager.php#L82 ) - selected area code
84
+ 1 . [ ObjectManagerInterface->configure()] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/ObjectManager/ObjectManager.php#L82 ) - selected area code
85
85
1 . result = FrontControllerInterface->dispatch()
86
- 1 . [ ResultInterface->renderResult()] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/Controller/AbstractResult.php#L122 ) into response object
86
+ 1 . [ ResultInterface->renderResult()] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/Controller/AbstractResult.php#L122 ) into response object
87
87
1 . event ` controller_front_send_response_before ` (request, response)
88
88
89
89
@@ -102,7 +102,7 @@ $this->_objectManager->configure($this->_configLoader->load($areaCode));
102
102
- "webapi_rest (frontName ` /rest ` ) - preference module-webapi/etc/webapi_rest/di.xml - * \Magento\Webapi\Controller\Rest*
103
103
- "webapi_soap" (frontname ` /soap ` ) - preference module-webapi/etc/webapi_soap/di.xml - * \Magento\Webapi\Controller\Soap*
104
104
105
- ### [ \Magento\Framework\App\FrontController] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/App/FrontController.php ) :
105
+ ### [ \Magento\Framework\App\FrontController] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/App/FrontController.php ) :
106
106
107
107
- routerList
108
108
- action = router[ ] .match
@@ -112,37 +112,37 @@ $this->_objectManager->configure($this->_configLoader->load($areaCode));
112
112
### Router match - action can be:
113
113
114
114
- generic \Magento\Framework\App\ActionInterface::execute - not used?
115
- - [ \Magento\Framework\App\Action\AbstractAction] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/App/Action/AbstractAction.php ) ::dispatch - context, request, response, result factory, result redirect factory
115
+ - [ \Magento\Framework\App\Action\AbstractAction] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/App/Action/AbstractAction.php ) ::dispatch - context, request, response, result factory, result redirect factory
116
116
117
117
### Dispatch/execute action - result can be:
118
118
119
- - [ \Magento\Framework\Controller\ResultInterface] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/Controller/ResultInterface.php ) - renderResult, setHttpResponseCode, setHeader
119
+ - [ \Magento\Framework\Controller\ResultInterface] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/Controller/ResultInterface.php ) - renderResult, setHttpResponseCode, setHeader
120
120
121
121
Implementations:
122
- - [ Result\Raw] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/Controller/Result/Raw.php ) -> Result\AbstractResult
123
- - [ Result\Json] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/Controller/Result/Json.php ) -> Result\AbstractResult
124
- - [ Result\Forward] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/Controller/Result/Forward.php ) -> Result\AbstractResult
125
- - [ \Magento\Framework\View\Result\Layout] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/View/Result/Layout.php ) -> Result\AbstractResult
126
- - [ \Magento\Framework\View\Result\Page] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/View/Result/Page.php ) -> \Magento\Framework\View\Result\Layout
127
- - [ Result\Redirect] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/Controller/Result/Redirect.php ) -> Result\AbstractResult
122
+ - [ Result\Raw] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/Controller/Result/Raw.php ) -> Result\AbstractResult
123
+ - [ Result\Json] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/Controller/Result/Json.php ) -> Result\AbstractResult
124
+ - [ Result\Forward] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/Controller/Result/Forward.php ) -> Result\AbstractResult
125
+ - [ \Magento\Framework\View\Result\Layout] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/View/Result/Layout.php ) -> Result\AbstractResult
126
+ - [ \Magento\Framework\View\Result\Page] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/View/Result/Page.php ) -> \Magento\Framework\View\Result\Layout
127
+ - [ Result\Redirect] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/Controller/Result/Redirect.php ) -> Result\AbstractResult
128
128
129
- - [ \Magento\Framework\App\ResponseInterface] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal//Magento/Framework/App/ResponseInterface.php ) - sendResponse
129
+ - [ \Magento\Framework\App\ResponseInterface] ( https://github.com/magento/magento2/blob/2.3 /lib/internal//Magento/Framework/App/ResponseInterface.php ) - sendResponse
130
130
131
131
Implementations:
132
- - [ Console\Response] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/App/Console/Response.php )
133
- - [ \Magento\MediaStorage\Model\File\Storage\FileInterface] ( https://github.com/magento/magento2/blob/2.2-develop /app/code/Magento/MediaStorage/Model/File/Storage/Response.php ) -> \Magento\Framework\App\Response\Http
134
- - [ \Magento\Framework\HTTP\PhpEnvironment\Response] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php ) -> \Zend\Http\PhpEnvironment\Response
135
- - [ \Magento\Framework\Webapi\Response] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/Webapi/Response.php ) -> \Magento\Framework\HTTP\PhpEnvironment\Response
136
- - [ \Magento\Framework\Webapi\Rest\Response] ( https://github.com/magento/magento2/blob/2.2-develop /lib/internal/Magento/Framework/Webapi/Rest/Response.php ) -> \Magento\Framework\Webapi\Response
132
+ - [ Console\Response] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/App/Console/Response.php )
133
+ - [ \Magento\MediaStorage\Model\File\Storage\FileInterface] ( https://github.com/magento/magento2/blob/2.3 /app/code/Magento/MediaStorage/Model/File/Storage/Response.php ) -> \Magento\Framework\App\Response\Http
134
+ - [ \Magento\Framework\HTTP\PhpEnvironment\Response] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php ) -> \Zend\Http\PhpEnvironment\Response
135
+ - [ \Magento\Framework\Webapi\Response] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/Webapi/Response.php ) -> \Magento\Framework\HTTP\PhpEnvironment\Response
136
+ - [ \Magento\Framework\Webapi\Rest\Response] ( https://github.com/magento/magento2/blob/2.3 /lib/internal/Magento/Framework/Webapi/Rest/Response.php ) -> \Magento\Framework\Webapi\Response
137
137
138
- ### [ \Magento\Webapi\Controller\Rest] ( https://github.com/magento/magento2/blob/2.2-develop /app/code/Magento/Webapi/Controller/Rest.php ) -> \Magento\Framework\App\FrontControllerInterface:
138
+ ### [ \Magento\Webapi\Controller\Rest] ( https://github.com/magento/magento2/blob/2.3 /app/code/Magento/Webapi/Controller/Rest.php ) -> \Magento\Framework\App\FrontControllerInterface:
139
139
140
- - preference for FrontController set in [ etc/webapi_rest/di.xml] ( https://github.com/magento/magento2/blob/2.2-develop /app/code/Magento/Webapi/etc/webapi_rest/di.xml#L32 )
140
+ - preference for FrontController set in [ etc/webapi_rest/di.xml] ( https://github.com/magento/magento2/blob/2.3 /app/code/Magento/Webapi/etc/webapi_rest/di.xml#L32 )
141
141
- process path [ /$store] /... - specific store, [ /all] /... - admin store (0), /... - default store
142
142
- a. process schema request /schema
143
143
- b. or process api request (resolve route, invoke route -> service class with params)
144
144
145
- ### [ \Magento\Webapi\Controller\Soap] ( https://github.com/magento/magento2/blob/2.2-develop /app/code/Magento/Webapi/Controller/Soap.php ) -> \Magento\Framework\App\FrontControllerInterface:
145
+ ### [ \Magento\Webapi\Controller\Soap] ( https://github.com/magento/magento2/blob/2.3 /app/code/Magento/Webapi/Controller/Soap.php ) -> \Magento\Framework\App\FrontControllerInterface:
146
146
147
147
- process path (same as REST)
148
148
- a. generate WSDL ?wsdl
0 commit comments