fix: unregister meta command custom autoloader when it is no longer needed. closes #915

This commit is contained in:
Feek
2020-04-19 18:05:23 -07:00
parent b0481aef33
commit b7b835bf09
+12
View File
@@ -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);
}
}