File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ ini_set ('display_startup_errors ' , 1 );ini_set ('display_errors ' , 1 ); error_reporting (-1 );
4+
5+ $ file = dirname (__FILE__ ) . '/app/bootstrap.php ' ;
6+ $ file = str_replace ('/pub/ ' , '/ ' , $ file );
7+ require $ file ;
8+ $ bootstrap = \Magento \Framework \App \Bootstrap::create (BP , $ _SERVER );
9+
10+
11+ class MagentoCLI extends \Magento \Framework \App \Http
12+ implements \Magento \Framework \AppInterface {
13+
14+ public function launch ()
15+ {
16+ $ this ->_state ->setAreaCode ('frontend ' );
17+
18+ $ time_start = microtime (true );
19+
20+
21+ $ menu = $ this ->_objectManager ->create ('\Magento\Theme\Block\Html\Topmenu ' );
22+ $ menu ->setTemplate ('html/topmenu.phtml ' );
23+ $ html = $ menu ->toHtml ();
24+ echo $ html ;
25+
26+ $ time_end = microtime (true );
27+
28+ //dividing with 60 will give the execution time in minutes otherwise seconds
29+ $ execution_time = ($ time_end - $ time_start )/60 ;
30+
31+ echo 'Execution time ' . $ execution_time ;
32+ return $ this ->_response ;
33+ }
34+
35+ }
36+
37+ /** @var \Magento\Framework\App\Http $app */
38+ $ app = $ bootstrap ->createApplication ('MagentoCLI ' );
39+ $ bootstrap ->run ($ app );
You can’t perform that action at this time.
0 commit comments