From b7b835bf098e72eec24df22bb723581934156d9e Mon Sep 17 00:00:00 2001 From: Feek Date: Sun, 19 Apr 2020 17:40:41 -0700 Subject: [PATCH] fix: unregister meta command custom autoloader when it is no longer needed. closes #915 --- src/Console/MetaCommand.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Console/MetaCommand.php b/src/Console/MetaCommand.php index 21bc343..071f613 100644 --- a/src/Console/MetaCommand.php +++ b/src/Console/MetaCommand.php @@ -103,6 +103,8 @@ class MetaCommand extends Command } } + $this->unregisterClassAutoloadExceptions(); + $content = $this->view->make('meta', [ 'bindings' => $bindings, 'methods' => $this->methods, @@ -159,4 +161,14 @@ class MetaCommand extends Command array('filename', 'F', InputOption::VALUE_OPTIONAL, 'The path to the meta file', $filename), ); } + + /** + * Remove our custom autoloader that we pushed onto the autoload stack + */ + private function unregisterClassAutoloadExceptions() + { + $autoloadFunctions = spl_autoload_functions(); + $ourAutoloader = array_pop($autoloadFunctions); + spl_autoload_unregister($ourAutoloader); + } }