Skip to content

Commit

Permalink
Add config option to disable clear command
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryfire committed Jan 12, 2024
1 parent c420ccf commit fd46d78
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
21 changes: 21 additions & 0 deletions config/purify.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,25 @@
// 'cache' => \Stevebauman\Purify\Cache\FilesystemDefinitionCache::class,
// ],

/*
|--------------------------------------------------------------------------
| Disable 'purify:clear' command
|--------------------------------------------------------------------------
|
| Here you may enable or disable the 'purify:clear' command.
|
| If you have configured Purify to utilize the CacheDefinitionCache in the serializer
| option, this command issues a Cache::clear() on the cache driver you have configured
| it to use.
|
| If you have configured Purify to utilize the FilesystemDefinitionCache in the serializer
| option, this command will clear the directory that you have configured it to store in.
|
| You may wish to disable this command if you are not using a unique filesystem path or disk
| (via config/filesystems.php) or cache store (via config/cache.php) for Purify.
|
*/

'disable_clear_command' => false,

];
4 changes: 3 additions & 1 deletion src/PurifyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ public function register()
{
$this->mergeConfigFrom(__DIR__.'/../config/purify.php', 'purify');

$this->commands(ClearCommand::class);
if (! config('purify.disable_clear_command', false)) {
$this->commands(ClearCommand::class);
}

$this->app->singleton('purify', function ($app) {
if ($cache = config('purify.serializer.cache')) {
Expand Down

0 comments on commit fd46d78

Please sign in to comment.