{"id":15975,"date":"2018-06-07T15:51:39","date_gmt":"2018-06-07T13:51:39","guid":{"rendered":"https:\/\/belvg.com\/blog\/?p=15975"},"modified":"2021-02-18T13:12:33","modified_gmt":"2021-02-18T11:12:33","slug":"utilizing-modes-and-application-initialization-in-magento-2","status":"publish","type":"post","link":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html","title":{"rendered":"Utilizing Modes and Application Initialization in Magento 2"},"content":{"rendered":"\n<p>Application initialization is done in 9 steps, each one is described below. We are also going to talk about 3 Magento 2 modes and help you learn&nbsp;their advantages and disadvantages.<\/p>\n<p><!--more--><\/p>\n<p><a href=\"#par_1\">Application initialization<\/a><br>\n<a href=\"#par_2\">Designing a customization<\/a><br>\n<a href=\"#par_3\">How to use Magento modes<\/a><br>\n<a href=\"#par_4\">Developer mode<\/a><br>\n<a href=\"#par_5\">Production mode<\/a><br>\n<a href=\"#par_6\">Default mode<\/a><br>\n<a href=\"#par_7\">Enabling\/disabling maintenance mode<\/a><br>\n<a href=\"#par_8\">Front controller responsibilities<\/a><\/p>\n<h2><a id=\"par_1\"><\/a><span style=\"color: #000000;\"><strong>Application initialization<\/strong><\/span><\/h2>\n<h3><span style=\"color: #000000;\"><strong>Step 1<\/strong><\/span><\/h3>\n<p>Request to <em>index.php<\/em> (entry point) in the root of the site or in <em>pub\/index.php<\/em>. When in developer mode, you should use <em>index.php<\/em> as the entry point in the root of the site, while for production mode, it is recommended to use <em>pub\/index.php<\/em>.<\/p>\n<h3><strong><span style=\"color: #000000;\">Step 2<\/span><\/strong><\/h3>\n<p>Connecting the file to <em>bootstrap.php<\/em>:<\/p>\n<pre class=\"lang:php decode:true \">try {\r\n&nbsp;&nbsp;&nbsp;require __DIR__ . '\/app\/bootstrap.php';\r\n} catch (\\Exception $e) {<\/pre>\n<p>in which <em>autoload.php<\/em> is loaded and connected:<\/p>\n<pre class=\"lang:php decode:true \">require_once __DIR__ . '\/autoload.php';<\/pre>\n<p>and the translation mechanism is implemented:<\/p>\n<pre class=\"lang:php decode:true\">require_once BP . '\/app\/functions.php';<\/pre>\n<h3><strong><span style=\"color: #000000;\">Step 3<\/span><\/strong><\/h3>\n<p>The autoloader can call the <em>create ()<\/em> method of the Bootstrap class:<\/p>\n<pre class=\"lang:php decode:true \">$bootstrap = \\Magento\\Framework\\App\\Bootstrap::create(BP, $_SERVER);<\/pre>\n<p>which returns a <em>Bootstrap<\/em> object, which in its turn contains the <em>ObjectManagerFactory<\/em> object:<\/p>\n<pre class=\"lang:php decode:true \">public static function create($rootDir, array $initParams, ObjectManagerFactory $factory = null)\r\n{\r\n&nbsp;&nbsp;&nbsp;self::populateAutoloader($rootDir, $initParams);\r\n&nbsp;&nbsp;&nbsp;if ($factory === null) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$factory = self::createObjectManagerFactory($rootDir, $initParams);\r\n&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;return new self($factory, $rootDir, $initParams);\r\n}<\/pre>\n<h3><span style=\"color: #000000;\"><strong>Step 4<\/strong><\/span><\/h3>\n<p>Next, the <em><span style=\"text-decoration: underline;\">createApplication()<\/span><\/em> method of the Bootstrap object is called:<\/p>\n<p><span style=\"font-weight: 400;\">$app <\/span><span style=\"font-weight: 400;\">= <\/span><span style=\"font-weight: 400;\">$bootstrap<\/span><span style=\"font-weight: 400;\">-&gt;<\/span><span style=\"font-weight: 400;\">createApplication<\/span><span style=\"font-weight: 400;\">(\\Magento\\Framework\\App\\Http::<\/span><i><span style=\"font-weight: 400;\">class<\/span><\/i><span style=\"font-weight: 400;\">)<\/span><span style=\"font-weight: 400;\">;<\/span><\/p>\n<p>This method creates an instance of the <em>Magento\\Framework\\App\\Http<\/em> class using the <em>objectManager<\/em> and returns to <em>index.php<\/em>.<\/p>\n<pre class=\"lang:php decode:true \">public function createApplication($type, $arguments = [])\r\n{\r\n&nbsp;&nbsp;&nbsp;try {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$application = $this-&gt;objectManager-&gt;create($type, $arguments);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!($application instanceof AppInterface)) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw new \\InvalidArgumentException(\"The provided class doesn't implement AppInterface: {$type}\");\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $application;\r\n&nbsp;&nbsp;&nbsp;} catch (\\Exception $e) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;terminate($e);\r\n&nbsp;&nbsp;&nbsp;}\r\n}<\/pre>\n<h3><strong><span style=\"color: #000000;\">Step 5<\/span><\/strong><\/h3>\n<p>Next, the <em>run ()<\/em> method of the <em>Bootstrap<\/em> object is called to start the application, which in its turn calls the <em>launch ()<\/em> method of the application object.<\/p>\n<p><span style=\"font-weight: 400;\">$bootstrap<\/span><span style=\"font-weight: 400;\">-&gt;<\/span><span style=\"font-weight: 400;\">run<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">$app<\/span><span style=\"font-weight: 400;\">)<\/span><span style=\"font-weight: 400;\">;<\/span><\/p>\n<pre class=\"lang:php decode:true \">public function createApplication($type, $arguments = [])\r\n{\r\n&nbsp;&nbsp;&nbsp;try {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$application = $this-&gt;objectManager-&gt;create($type, $arguments);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!($application instanceof AppInterface)) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw new \\InvalidArgumentException(\"The provided class doesn't implement AppInterface: {$type}\");\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $application;\r\n&nbsp;&nbsp;&nbsp;} catch (\\Exception $e) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;terminate($e);\r\n&nbsp;&nbsp;&nbsp;}\r\n}<\/pre>\n<h3><strong><span style=\"color: #000000;\">Step 6<\/span><\/strong><\/h3>\n<p>The http instance of the object performs initial routing &mdash; the scope from the URL is determined and set to <em>$this-&gt;_ state-&gt;setAreaCode($areaCode)<\/em>. After setting the scope, the required configuration for the given area is loaded.<\/p>\n<p>Next, an object of the <em>\\Magento\\Framework\\App\\FrontController<\/em> class is created and its <em>dispatch($this-&gt;_request)<\/em> method is called in which the request is passed.<\/p>\n<pre class=\"lang:php decode:true \">public function launch()\r\n{\r\n&nbsp;&nbsp;&nbsp;$areaCode = $this-&gt;_areaList-&gt;getCodeByFrontName($this-&gt;_request-&gt;getFrontName());\r\n&nbsp;&nbsp;&nbsp;$this-&gt;_state-&gt;setAreaCode($areaCode);\r\n&nbsp;&nbsp;&nbsp;$this-&gt;_objectManager-&gt;configure($this-&gt;_configLoader-&gt;load($areaCode));\r\n&nbsp;&nbsp;&nbsp;\/** @var \\Magento\\Framework\\App\\FrontControllerInterface $frontController *\/\r\n&nbsp;&nbsp;&nbsp;$frontController = $this-&gt;_objectManager-&gt;get(\\Magento\\Framework\\App\\FrontControllerInterface::class);\r\n&nbsp;&nbsp;&nbsp;$result = $frontController-&gt;dispatch($this-&gt;_request);\r\n&nbsp;&nbsp;&nbsp;\/\/ TODO: Temporary solution until all controllers return ResultInterface (MAGETWO-28359)\r\n&nbsp;&nbsp;&nbsp;if ($result instanceof ResultInterface) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;registry-&gt;register('use_page_cache_plugin', true, true);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result-&gt;renderResult($this-&gt;_response);\r\n&nbsp;&nbsp;&nbsp;} elseif ($result instanceof HttpInterface) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;_response = $result;\r\n&nbsp;&nbsp;&nbsp;} else {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw new \\InvalidArgumentException('Invalid return type');\r\n&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;\/\/ This event gives possibility to launch something before sending output (allow cookie setting)\r\n&nbsp;&nbsp;&nbsp;$eventParams = ['request' =&gt; $this-&gt;_request, 'response' =&gt; $this-&gt;_response];\r\n&nbsp;&nbsp;&nbsp;$this-&gt;_eventManager-&gt;dispatch('controller_front_send_response_before', $eventParams);\r\n&nbsp;&nbsp;&nbsp;return $this-&gt;_response;\r\n}<\/pre>\n<h3><span style=\"color: #000000;\"><strong>Step 7<\/strong><\/span><\/h3>\n<p>The <em>dispatch()<\/em> method of the <em>FrontController<\/em> class defines the current router and determines the current action controller. Then, the <em>dispatch()<\/em> method is called from the action controller.<\/p>\n<pre class=\"lang:php decode:true \">public function dispatch(RequestInterface $request)\r\n{\r\n&nbsp;&nbsp;&nbsp;\\Magento\\Framework\\Profiler::start('routers_match');\r\n&nbsp;&nbsp;&nbsp;$routingCycleCounter = 0;\r\n&nbsp;&nbsp;&nbsp;$result = null;\r\n&nbsp;&nbsp;&nbsp;while (!$request-&gt;isDispatched() &amp;&amp; $routingCycleCounter++ &lt; 100) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/** @var \\Magento\\Framework\\App\\RouterInterface $router *\/\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach ($this-&gt;_routerList as $router) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$actionInstance = $router-&gt;match($request);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($actionInstance) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$request-&gt;setDispatched(true);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;response-&gt;setNoCacheHeaders();\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($actionInstance instanceof \\Magento\\Framework\\App\\Action\\AbstractAction) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result = $actionInstance-&gt;dispatch($request);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result = $actionInstance-&gt;execute();\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} catch (\\Magento\\Framework\\Exception\\NotFoundException $e) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$request-&gt;initForward();\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$request-&gt;setActionName('noroute');\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$request-&gt;setDispatched(false);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;\\Magento\\Framework\\Profiler::stop('routers_match');\r\n&nbsp;&nbsp;&nbsp;if ($routingCycleCounter &gt; 100) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw new \\LogicException('Front controller reached 100 router match iterations');\r\n&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;return $result;\r\n}<\/pre>\n<h3><strong><span style=\"color: #000000;\">Step 8<\/span><\/strong><\/h3>\n<p>The <em>dispatch()<\/em> method is implemented in <em>Magento\\Framework\\App\\Action\\Action.php<\/em>.<\/p>\n<p>We are inherited from this class when creating our own controllers. Action controller method returns an object that implements <em>ResultInterface<\/em> through execution of the <em>execute()<\/em> method.<\/p>\n<pre class=\"lang:php decode:true\">public function dispatch(RequestInterface $request)\r\n{\r\n&nbsp;&nbsp;&nbsp;$this-&gt;_request = $request;\r\n&nbsp;&nbsp;&nbsp;$profilerKey = 'CONTROLLER_ACTION:' . $request-&gt;getFullActionName();\r\n&nbsp;&nbsp;&nbsp;$eventParameters = ['controller_action' =&gt; $this, 'request' =&gt; $request];\r\n&nbsp;&nbsp;&nbsp;$this-&gt;_eventManager-&gt;dispatch('controller_action_predispatch', $eventParameters);\r\n&nbsp;&nbsp;&nbsp;$this-&gt;_eventManager-&gt;dispatch('controller_action_predispatch_' . $request-&gt;getRouteName(), $eventParameters);\r\n&nbsp;&nbsp;&nbsp;$this-&gt;_eventManager-&gt;dispatch(\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'controller_action_predispatch_' . $request-&gt;getFullActionName(),\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$eventParameters\r\n&nbsp;&nbsp;&nbsp;);\r\n&nbsp;&nbsp;&nbsp;\\Magento\\Framework\\Profiler::start($profilerKey);\r\n&nbsp;&nbsp;&nbsp;$result = null;\r\n&nbsp;&nbsp;&nbsp;if ($request-&gt;isDispatched() &amp;&amp; !$this-&gt;_actionFlag-&gt;get('', self::FLAG_NO_DISPATCH)) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\Magento\\Framework\\Profiler::start('action_body');\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result = $this-&gt;execute();\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\Magento\\Framework\\Profiler::start('postdispatch');\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!$this-&gt;_actionFlag-&gt;get('', self::FLAG_NO_POST_DISPATCH)) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;_eventManager-&gt;dispatch(\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'controller_action_postdispatch_' . $request-&gt;getFullActionName(),\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$eventParameters\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;_eventManager-&gt;dispatch(\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'controller_action_postdispatch_' . $request-&gt;getRouteName(),\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$eventParameters\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;_eventManager-&gt;dispatch('controller_action_postdispatch', $eventParameters);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\Magento\\Framework\\Profiler::stop('postdispatch');\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\Magento\\Framework\\Profiler::stop('action_body');\r\n&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;\\Magento\\Framework\\Profiler::stop($profilerKey);\r\n&nbsp;&nbsp;&nbsp;return $result ?: $this-&gt;_response;\r\n}<\/pre>\n<h3><strong><span style=\"color: #000000;\">Step 9<\/span><\/strong><\/h3>\n<p><em>FrontController<\/em> returns <em>ResultInterface<\/em> into <em>Application Instance<\/em>, which displays response.<\/p>\n<pre class=\"lang:php decode:true \">public function launch()\r\n{\r\n&nbsp;&nbsp;&nbsp;$areaCode = $this-&gt;_areaList-&gt;getCodeByFrontName($this-&gt;_request-&gt;getFrontName());\r\n&nbsp;&nbsp;&nbsp;$this-&gt;_state-&gt;setAreaCode($areaCode);\r\n&nbsp;&nbsp;&nbsp;$this-&gt;_objectManager-&gt;configure($this-&gt;_configLoader-&gt;load($areaCode));\r\n&nbsp;&nbsp;&nbsp;\/** @var \\Magento\\Framework\\App\\FrontControllerInterface $frontController *\/\r\n&nbsp;&nbsp;&nbsp;$frontController = $this-&gt;_objectManager-&gt;get(\\Magento\\Framework\\App\\FrontControllerInterface::class);\r\n&nbsp;&nbsp;&nbsp;$result = $frontController-&gt;dispatch($this-&gt;_request);\r\n&nbsp;&nbsp;&nbsp;\/\/ TODO: Temporary solution until all controllers return ResultInterface (MAGETWO-28359)\r\n&nbsp;&nbsp;&nbsp;if ($result instanceof ResultInterface) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;registry-&gt;register('use_page_cache_plugin', true, true);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result-&gt;renderResult($this-&gt;_response);\r\n&nbsp;&nbsp;&nbsp;} elseif ($result instanceof HttpInterface) {<\/pre>\n<h2><a id=\"par_2\"><\/a><strong><span style=\"color: #000000;\">Designing a customization that acts on every request<\/span><\/strong><\/h2>\n<p>To obtain data from each request, you can create an <em>observer<\/em> for <em>controller_front_send_response_before event (Magento\\Framework\\App\\Http::launch())<\/em>.<\/p>\n<p>There is an implementation in <em>Magento\\Customer\\Observer\\Visitor\\SaveByRequestObserver.<\/em><\/p>\n<h2><a id=\"par_3\"><\/a><span style=\"color: #000000;\"><strong>How to use Magento modes<\/strong><\/span><\/h2>\n<p>Magento 2 can be launched in one of the three modes &mdash; developer, production and default. The main difference between the modes is in how Magento will get access to static files. Static files include css, javascript files and pictures.<\/p>\n<p>There is also a maintenance mode, but it serves to prevent access to the system.<\/p>\n<p>To view the current mode, use the CLI command <em>bin\/<\/em><em>magento<\/em><em>&nbsp;deploy:mode:show<\/em><em>.<\/em><\/p>\n<p>To switch between the modes use <em>bin\/magento<\/em><em>&nbsp;deploy:mode:set<\/em><em>.<\/em><\/p>\n<h2><strong><span style=\"color: #000000;\">The pros and cons of using developer mode\/production mode<\/span><\/strong><\/h2>\n<h3><a id=\"par_4\"><\/a><strong><span style=\"color: #000000;\">Developer mode<\/span><\/strong><\/h3>\n<p>In developer mode, static files are generated in each request. In <em>pub\/static<\/em> symlinks are installed on real files from modules and libraries.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/06\/image4.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-15976\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/06\/image4.png\" alt=\"image4\" width=\"767\" height=\"59\" title=\"Utilizing Modes and Application Initialization in Magento 2\"><\/a><\/p>\n<p>The advantage of this mechanism is that it immediately displays all the changes that you make. The disadvantage &mdash; decrease in performance due to the lack of static content caching.<\/p>\n<p>Uncaught exceptions are displayed. Additionally, you need to configure <em>app\/bootstrap.php.<\/em><\/p>\n<pre class=\"lang:php decode:true\">error_reporting(E_ALL);\r\nini_set('display_errors', 1);<\/pre>\n<p>Error logging in <em>var\/log\/exception.log.<\/em><\/p>\n<p>Developer mode is recommended for development and customization of modules or themes. Its main advantage is the display of errors in the browser and fast editing of static files, while the disadvantage is low performance.<\/p>\n<p>In Developer mode, static view files are generated each time they are requested. They are written to the <em>pub\/static<\/em> directory, but the cache is not used. This has a big performance impact, but any changes a developer makes to view files are immediately visible.<\/p>\n<p>Uncaught exceptions are displayed in the browser, instead of being logged. An exception is thrown whenever an event subscriber cannot be invoked.<\/p>\n<p>You should use the Developer mode while you are developing customizations or extensions.<\/p>\n<h3><a id=\"par_5\"><\/a><span style=\"color: #000000;\"><strong>Production mode<\/strong><\/span><\/h3>\n<p>Production mode is recommended for using on a production server. This is the most productive mode available.<\/p>\n<p>When switching to this mode, errors will not be displayed to a user but will be logged into files. (check out the article <a href=\"https:\/\/belvg.com\/blog\/developer-mode-and-debugging-in-magento-2.html\">Developer Mode and Debugging in Magento 2<\/a> for more information about debugging)<\/p>\n<p>In this module, static files will not be generated on the fly but will be deployed to the <em>pub\/static<\/em> directory using the command <em>&lt;your Magento install dir&gt;\/bin\/magento&nbsp;setup:static-content<\/em>:<em>deploy<\/em>. This mechanism allows you to significantly increase the performance, but it is required to redeploy static content after each change.<\/p>\n<h3><a id=\"par_6\"><\/a><strong><span style=\"color: #000000;\">Default mode<\/span><\/strong><\/h3>\n<p>Default mode is how the Magento software operates if no other mode is specified.<\/p>\n<p>This mode is set by default during the initial Magento installation.<\/p>\n<p>In this module, the errors are not displayed to users but are logged to <em>var\/log<\/em>. Files in <em>pub\/static<\/em> are generated on the fly, and then cached.<\/p>\n<p>Unlike the developer mode, the file changes are not displayed until the generated static view files (var\/view_preprocessed) are cleared.<\/p>\n<p>Default mode is not optimized to work in production as well as the production mode is, because the creation of files on the fly and their further caching is less productive than the preliminary creation using the command line tool.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/06\/image31.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-15977\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/06\/image31.png\" alt=\"image3\" width=\"657\" height=\"326\" title=\"Utilizing Modes and Application Initialization in Magento 2\"><\/a><\/p>\n<h2><a id=\"par_7\"><\/a><strong><span style=\"color: #000000;\">Enabling\/disabling maintenance mode<\/span><\/strong><\/h2>\n<p>bin\/magento maintenance:enable<\/p>\n<p>bin\/magento maintenance:disable<\/p>\n<h2><a id=\"par_8\"><\/a><strong><span style=\"color: #000000;\">Front controller responsibilities<\/span><\/strong><\/h2>\n<ul>\n<li>Gathering all routers (injected into the constructor using DI).<\/li>\n<li>Finding a matching controller\/router.<\/li>\n<li>Obtaining the generated HTML for the response object.<\/li>\n<\/ul>\n<p>Front controller is the first step (entry point) for processing the flow of requests. Basically, the front controller controls all the other controllers. In Magento 2 it collects routes, matches the controllers, and receives the HTML generated for the response object (converting the query to a result). It is not used in the API or console.<\/p>\n\n","protected":false},"excerpt":{"rendered":"Application initialization and 3 modes in Magento 2.","protected":false},"author":82,"featured_media":15980,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"footnotes":""},"categories":[474,389],"tags":[],"class_list":["post-15975","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-ecommerce","category-magento2-development","post_format-post-format-image"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"The 9 steps of the application initialization in Magento 2; 3 modes of Magento 2, the advantages and disadvantages of default, production and developer modes.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Andrey Litvin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/utilizing-modes-and-application-initialization-in-magento-2.html#article\",\"name\":\"Utilize modes and application initialization | BelVG Blog\",\"headline\":\"Utilizing Modes and Application Initialization in Magento 2\",\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/Utilizing-Modes-and-Application-Initialization-in-Magento-2.jpg\",\"width\":770,\"height\":433},\"datePublished\":\"2018-06-07T15:51:39+02:00\",\"dateModified\":\"2021-02-18T13:12:33+02:00\",\"inLanguage\":\"en-US\",\"commentCount\":1,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/utilizing-modes-and-application-initialization-in-magento-2.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/utilizing-modes-and-application-initialization-in-magento-2.html#webpage\"},\"articleSection\":\"ECOMMERCE, Magento 2 Development, Image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/utilizing-modes-and-application-initialization-in-magento-2.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"name\":\"Magento 2 Development\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"position\":2,\"name\":\"Magento 2 Development\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/utilizing-modes-and-application-initialization-in-magento-2.html#listItem\",\"name\":\"Utilizing Modes and Application Initialization in Magento 2\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/utilizing-modes-and-application-initialization-in-magento-2.html#listItem\",\"position\":3,\"name\":\"Utilizing Modes and Application Initialization in Magento 2\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"name\":\"Magento 2 Development\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin\",\"name\":\"Andrey Litvin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/utilizing-modes-and-application-initialization-in-magento-2.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e1a6e3c80cb940fddb65016d94b015cd951b4a8a9cd7227565131f28ea95c7a0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Andrey Litvin\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/utilizing-modes-and-application-initialization-in-magento-2.html#webpage\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/utilizing-modes-and-application-initialization-in-magento-2.html\",\"name\":\"Utilize modes and application initialization | BelVG Blog\",\"description\":\"The 9 steps of the application initialization in Magento 2; 3 modes of Magento 2, the advantages and disadvantages of default, production and developer modes.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/utilizing-modes-and-application-initialization-in-magento-2.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/Utilizing-Modes-and-Application-Initialization-in-Magento-2.jpg\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/utilizing-modes-and-application-initialization-in-magento-2.html\\\/#mainImage\",\"width\":770,\"height\":433},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/utilizing-modes-and-application-initialization-in-magento-2.html#mainImage\"},\"datePublished\":\"2018-06-07T15:51:39+02:00\",\"dateModified\":\"2021-02-18T13:12:33+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Utilize modes and application initialization | BelVG Blog","description":"The 9 steps of the application initialization in Magento 2; 3 modes of Magento 2, the advantages and disadvantages of default, production and developer modes.","canonical_url":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html#article","name":"Utilize modes and application initialization | BelVG Blog","headline":"Utilizing Modes and Application Initialization in Magento 2","author":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/06\/Utilizing-Modes-and-Application-Initialization-in-Magento-2.jpg","width":770,"height":433},"datePublished":"2018-06-07T15:51:39+02:00","dateModified":"2021-02-18T13:12:33+02:00","inLanguage":"en-US","commentCount":1,"mainEntityOfPage":{"@id":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html#webpage"},"isPartOf":{"@id":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html#webpage"},"articleSection":"ECOMMERCE, Magento 2 Development, Image"},{"@type":"BreadcrumbList","@id":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/belvg.com\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","name":"Magento 2 Development"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","position":2,"name":"Magento 2 Development","item":"https:\/\/belvg.com\/blog\/category\/magento2-development","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html#listItem","name":"Utilizing Modes and Application Initialization in Magento 2"},"previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html#listItem","position":3,"name":"Utilizing Modes and Application Initialization in Magento 2","previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","name":"Magento 2 Development"}}]},{"@type":"Organization","@id":"https:\/\/belvg.com\/blog\/#organization","name":"BelVG Blog","description":"Magento and Prestashop articles","url":"https:\/\/belvg.com\/blog\/"},{"@type":"Person","@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author","url":"https:\/\/belvg.com\/blog\/author\/andrey-litvin","name":"Andrey Litvin","image":{"@type":"ImageObject","@id":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/e1a6e3c80cb940fddb65016d94b015cd951b4a8a9cd7227565131f28ea95c7a0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Andrey Litvin"}},{"@type":"WebPage","@id":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html#webpage","url":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html","name":"Utilize modes and application initialization | BelVG Blog","description":"The 9 steps of the application initialization in Magento 2; 3 modes of Magento 2, the advantages and disadvantages of default, production and developer modes.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/belvg.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html#breadcrumblist"},"author":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"creator":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/06\/Utilizing-Modes-and-Application-Initialization-in-Magento-2.jpg","@id":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html\/#mainImage","width":770,"height":433},"primaryImageOfPage":{"@id":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html#mainImage"},"datePublished":"2018-06-07T15:51:39+02:00","dateModified":"2021-02-18T13:12:33+02:00"},{"@type":"WebSite","@id":"https:\/\/belvg.com\/blog\/#website","url":"https:\/\/belvg.com\/blog\/","name":"BelVG Blog","description":"Magento and Prestashop articles","inLanguage":"en-US","publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"15975","title":"Utilize modes and application initialization | #site_title","description":"The 9 steps of the application initialization in Magento 2; 3 modes of Magento 2, the advantages and disadvantages of default, production and developer modes.","keywords":null,"keyphrases":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-11-03 18:37:08","updated":"2026-11-03 18:37:08"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/category\/magento2-development\" title=\"Magento 2 Development\">Magento 2 Development<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tUtilizing Modes and Application Initialization in Magento 2\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/belvg.com\/blog\/"},{"label":"Magento 2 Development","link":"https:\/\/belvg.com\/blog\/category\/magento2-development"},{"label":"Utilizing Modes and Application Initialization in Magento 2","link":"https:\/\/belvg.com\/blog\/utilizing-modes-and-application-initialization-in-magento-2.html"}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/15975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/users\/82"}],"replies":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/comments?post=15975"}],"version-history":[{"count":7,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/15975\/revisions"}],"predecessor-version":[{"id":23395,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/15975\/revisions\/23395"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media\/15980"}],"wp:attachment":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media?parent=15975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/categories?post=15975"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/tags?post=15975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}