Closte.php
4 years ago
Cloudways.php
4 years ago
DreamHost.php
3 years ago
Flywheel.php
4 years ago
GoDaddyWPaaS.php
4 years ago
GridPane.php
4 years ago
Hosting.php
4 years ago
Kinsta.php
2 years ago
Pagely.php
2 years ago
PagelyCachePurge.php
4 years ago
Pantheon.php
2 years ago
Pressable.php
2 years ago
Raidboxes.php
2 years ago
RocketNet.php
3 years ago
Savvii.php
3 years ago
SiteGround.php
2 years ago
SpinupWp.php
2 years ago
Vimexx.php
3 years ago
WPEngine.php
2 years ago
WPX.php
3 years ago
WPmudev.php
2 years ago
RocketNet.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | namespace NitroPack\Integration\Hosting; |
| 4 | |
| 5 | class RocketNet extends Hosting { |
| 6 | const STAGE = "early"; |
| 7 | |
| 8 | public static function detect() { |
| 9 | return defined("ROCKET_SITE_ID") || strpos(gethostname(), "onrocket.com") !== false; |
| 10 | } |
| 11 | |
| 12 | public function init($stage) { |
| 13 | if ($this->getHosting() == "rocketnet") { |
| 14 | if (class_exists("CDN_Clear_Cache_Api")) { |
| 15 | add_action('nitropack_execute_purge_url', [$this, 'purgeUrl']); |
| 16 | } |
| 17 | |
| 18 | if (class_exists("CDN_Clear_Cache_Hooks")) { |
| 19 | add_action('nitropack_execute_purge_all', [$this, 'purgeAll']); |
| 20 | } |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | public function purgeUrl($url) { |
| 25 | $urlObj = new \NitroPack\Url\Url($url); |
| 26 | $entry = $urlObj->getPath(); |
| 27 | if ($urlObj->getQuery()) { |
| 28 | $entry .= "?" . $urlObj->getQuery(); |
| 29 | } |
| 30 | \CDN_Clear_Cache_Api::cache_api_call([$entry], 'purge'); |
| 31 | } |
| 32 | |
| 33 | public function purgeAll() { |
| 34 | \CDN_Clear_Cache_Hooks::purge_cache(); |
| 35 | } |
| 36 | } |
| 37 |