Skip to content

Check if the cache files are really removed #51920

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/Illuminate/Foundation/Console/ConfigClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,16 @@ public function __construct(Filesystem $files)
*/
public function handle()
{
$this->files->delete($this->laravel->getCachedConfigPath());
$cachedConfigPath = $this->laravel->getCachedConfigPath();

$this->components->info('Configuration cache cleared successfully.');
if ($this->files->exists($cachedConfigPath)) {
if ($this->files->delete($cachedConfigPath)) {
$this->components->info('Configuration cache cleared successfully.');
} else {
$this->components->error('Failed to clear configuration cache.');
}
} else {
$this->components->info('Configuration cache is not present.');
}
}
}
12 changes: 10 additions & 2 deletions src/Illuminate/Foundation/Console/EventClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,16 @@ public function __construct(Filesystem $files)
*/
public function handle()
{
$this->files->delete($this->laravel->getCachedEventsPath());
$cachedEventsPath = $this->laravel->getCachedEventsPath();

$this->components->info('Cached events cleared successfully.');
if ($this->files->exists($cachedEventsPath)) {
if ($this->files->delete($cachedEventsPath)) {
$this->components->info('Cached events cleared successfully.');
} else {
$this->components->error('Failed to clear events cache.');
}
} else {
$this->components->info('Events cache is not present.');
}
}
}
12 changes: 10 additions & 2 deletions src/Illuminate/Foundation/Console/RouteClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,16 @@ public function __construct(Filesystem $files)
*/
public function handle()
{
$this->files->delete($this->laravel->getCachedRoutesPath());
$cachedRoutesPath = $this->laravel->getCachedRoutesPath();

$this->components->info('Route cache cleared successfully.');
if ($this->files->exists($cachedRoutesPath)) {
if ($this->files->delete($cachedRoutesPath)) {
$this->components->info('Route cache cleared successfully.');
} else {
$this->components->error('Failed to clear route cache.');
}
} else {
$this->components->info('Route cache is not present.');
}
}
}