-
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing a provider breaks Acorn until removing the packages cache #270
Comments
Can we get this fixed ASAP please. I'm pretty sure |
Hej @yCodeTech, please feel free to open a PR on this, so one can review it. |
@dsturm I'm not skilled in this type of development, so I can not fix it and submit a pr. |
did some digging and laravels default method is not invoking a new Process of the command via cli. Its removing the cache files in the same instance. While acorn is initiating new Process of wp acorn cli command. It fails returning exit code 1. Since the Provider may have been removed when executing. acorn/src/Roots/Acorn/ComposerScripts.php Line 21 in b020038
acorn/src/Roots/Acorn/Console/Console.php Lines 9 to 17 in b020038
acorn/src/Roots/Acorn/Console/Console.php Lines 99 to 110 in b020038
Possible solution. Reuse laravels method and make sure getCachedConfigPath() resolves to getCachedServicesPath() resolves to getCachedPackagesPath() resolves to instead of /src/Roots/Acorn/ComposerScripts.php <?php
namespace Roots\Acorn;
use Illuminate\Foundation\ComposerScripts as FoundationComposerScripts;
class ComposerScripts extends FoundationComposerScripts
{
/**
* Clear the cached Laravel bootstrapping files.
*
* @return void
*/
protected static function clearCompiled()
{
$laravel = new \Roots\Acorn\Application(getcwd(), ['bootstrap' => getcwd() .'/storage/framework']);
if (is_file($configPath = $laravel->getCachedConfigPath())) {
@unlink($configPath);
}
if (is_file($servicesPath = $laravel->getCachedServicesPath())) {
@unlink($servicesPath);
}
if (is_file($packagesPath = $laravel->getCachedPackagesPath())) {
@unlink($packagesPath);
}
}
} |
Adding and then removing a service provider breaks Acorn until the packages cache is removed:
composer require spatie/laravel-ignition
wp acorn package:discover
composer remove spatie/laravel-ignition
Error:
Workaround:
rm cache/acorn/framework/cache/packages.php
wp acorn optimize
The text was updated successfully, but these errors were encountered: