-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored CloudflareCache class, added a new console command to purg… (
#2) * Refactored CloudflareCache class, added a new console command to purge everything, and updated configuration keys for the Cloudflare API. * Fix styling * Refactor config file to use more descriptive variable names and add comments for clarity. --------- Co-authored-by: thejmitchener <thejmitchener@users.noreply.github.com>
- Loading branch information
1 parent
c7287eb
commit f7c7721
Showing
6 changed files
with
60 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Fuelviews\CloudflareCache\Commands; | ||
|
||
use Fuelviews\CloudflareCache\Facades\CloudflareCache; | ||
use Illuminate\Console\Command; | ||
|
||
class CloudflareCacheClearCommand extends Command | ||
{ | ||
protected $signature = 'cloudflare-cache:clear'; | ||
|
||
protected $description = 'Cloudflare purge everything'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* This method handles the logic after the command is called. It decides | ||
* whether to include an index in the sitemap based on configuration settings. | ||
* Depending on those settings, it may generate individual sitemaps for pages | ||
* and posts and then either create a sitemap index to include them or | ||
* directly generate a single sitemap. | ||
*/ | ||
public function handle(): bool | ||
{ | ||
CloudflareCache::purgeEverything(); | ||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters