File tree 1 file changed +23
-1
lines changed
app/code/Magento/CatalogImportExport/Model/Export
1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -768,6 +768,17 @@ protected function paginateCollection($page, $pageSize)
768
768
*/
769
769
public function export ()
770
770
{
771
+ $ shouldProfile = false ;
772
+ if (extension_loaded ('xhprof ' )) {
773
+ $ xhprofRoot = "/lukerodgers.co.uk/builds/xhprof " ;
774
+ if (is_dir ($ xhprofRoot )) {
775
+ $ shouldProfile = true ;
776
+ require_once $ xhprofRoot . "/xhprof_lib/utils/xhprof_lib.php " ;
777
+ require_once $ xhprofRoot . "/xhprof_lib/utils/xhprof_runs.php " ;
778
+ xhprof_enable ();
779
+ }
780
+ }
781
+
771
782
//Execution time may be very long
772
783
set_time_limit (0 );
773
784
@@ -794,7 +805,18 @@ public function export()
794
805
break ;
795
806
}
796
807
}
797
- return $ writer ->getContents ();
808
+
809
+ $ contents = $ writer ->getContents ();
810
+ if ($ shouldProfile ) {
811
+ $ uri = date ("y-m-d-h-i-s " )."- " .$ _SERVER ['SERVER_ADDR ' ]."- " .$ _SERVER ['REQUEST_URI ' ];
812
+ $ uri = preg_replace ('#[^0-9a-z]+#i ' , '- ' , $ uri );
813
+ $ uri = strtolower ($ uri );
814
+ $ uri = trim ($ uri , '- ' );
815
+ $ xhprof_data = xhprof_disable ();
816
+ $ xhprof_runs = new \XHProfRuns_Default ();
817
+ $ xhprof_runs ->save_run ($ xhprof_data , $ uri );
818
+ }
819
+ return $ contents ;
798
820
}
799
821
800
822
/**
You can’t perform that action at this time.
0 commit comments