HEX
Server: Apache
System: Linux srv674466.hstgr.cloud 5.14.0-503.19.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jan 7 17:08:27 EST 2025 x86_64
User: rialindia (1055)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/rialindia/public_html/wp-content/plugins/nitropack/classes/Integration/Hosting/RocketNet.php
<?php

namespace NitroPack\Integration\Hosting;

class RocketNet extends Hosting {
    const STAGE = "early";

    public static function detect() {
        return defined("ROCKET_SITE_ID") || strpos(gethostname(), "onrocket.com") !== false;
    }

    public function init($stage) {
        if ($this->getHosting() == "rocketnet") {
            if (class_exists("CDN_Clear_Cache_Api")) {
                add_action('nitropack_execute_purge_url', [$this, 'purgeUrl']);
            }

            if (class_exists("CDN_Clear_Cache_Hooks")) {
                add_action('nitropack_execute_purge_all', [$this, 'purgeAll']);
            }
        }
    }

    public function purgeUrl($url) {
        $urlObj = new \NitroPack\Url\Url($url);
        $entry = $urlObj->getPath();
        if ($urlObj->getQuery()) {
            $entry .= "?" . $urlObj->getQuery();
        }
        \CDN_Clear_Cache_Api::cache_api_call([$entry], 'purge');
    }

    public function purgeAll() {
        \CDN_Clear_Cache_Hooks::purge_cache();
    }
}