File tree 4 files changed +18
-5
lines changed
4 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -37,16 +37,26 @@ protected function configure()
37
37
}
38
38
39
39
/**
40
- * {@inheritDoc}
40
+ * Loads aspect kernel.
41
+ *
42
+ * Aspect kernel is loaded by executing loader and fetching singleton instance.
43
+ * If your application environment initializes aspect kernel differently, you may
44
+ * modify this metod to get aspect kernel suitable to your needs.
45
+ *
46
+ * @param InputInterface $input
47
+ * @param OutputInterface $output
41
48
*/
42
- protected function execute (InputInterface $ input , OutputInterface $ output )
49
+ protected function loadAspectKernel (InputInterface $ input , OutputInterface $ output )
43
50
{
44
51
$ loader = $ input ->getArgument ('loader ' );
45
52
$ path = stream_resolve_include_path ($ loader );
46
53
if (!is_readable ($ path )) {
47
54
throw new \InvalidArgumentException ("Invalid loader path: {$ loader }" );
48
55
}
56
+
57
+ ob_start ();
49
58
include_once $ path ;
59
+ ob_clean ();
50
60
51
61
if (!class_exists (AspectKernel::class, false )) {
52
62
$ message = "Kernel was not initialized yet, please configure it in the {$ path }" ;
Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ protected function configure()
45
45
*/
46
46
protected function execute (InputInterface $ input , OutputInterface $ output )
47
47
{
48
- parent ::execute ($ input , $ output );
48
+ $ this ->loadAspectKernel ($ input , $ output );
49
+
49
50
$ options = $ this ->aspectKernel ->getOptions ();
50
51
51
52
if (empty ($ options ['cacheDir ' ])) {
Original file line number Diff line number Diff line change @@ -49,7 +49,8 @@ protected function configure()
49
49
*/
50
50
protected function execute (InputInterface $ input , OutputInterface $ output )
51
51
{
52
- parent ::execute ($ input , $ output );
52
+ $ this ->loadAspectKernel ($ input , $ output );
53
+
53
54
$ io = new SymfonyStyle ($ input , $ output );
54
55
$ io ->title ('Advisor debug information ' );
55
56
Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ protected function configure()
46
46
*/
47
47
protected function execute (InputInterface $ input , OutputInterface $ output )
48
48
{
49
- parent ::execute ($ input , $ output );
49
+ $ this ->loadAspectKernel ($ input , $ output );
50
+
50
51
$ io = new SymfonyStyle ($ input , $ output );
51
52
52
53
$ container = $ this ->aspectKernel ->getContainer ();
You can’t perform that action at this time.
0 commit comments