| Server IP : 172.67.134.116 / Your IP : 216.73.217.83 Web Server : Apache System : Linux server.rehabsharif.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64 User : nobi37te ( 1003) PHP Version : 8.2.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/nobi37te/public_html/wp-content/plugins/nitropack/classes/Integration/Hosting/ |
Upload File : |
<?php
/**
* Raidboxes Class
*
* @package nitropack
*/
namespace NitroPack\Integration\Hosting;
use \NitroPack\SDK\Filesystem;
/**
* Raidboxes Class
*/
class Raidboxes extends Hosting {
const STAGE = "very_early";
private $nginx_cache_path = ABSPATH . 'wp-content/nginx_cache';
private $wordpress_gt_cache_path = ABSPATH . 'wp-content/gt-cache';
/**
* Detect if Raidboxes is active
*
* @return bool
*/
public static function detect() {
return substr(gethostname(), 0, 4) == "box-" && Filesystem::fileExists(nitropack_trailingslashit(ABSPATH) . 'rb-plugins');
}
/**
* Initialize Raidboxes
*
* @param $stage
* @return void
*/
public function init($stage) {
if (self::detect()) {
add_action('nitropack_execute_purge_url', [$this, 'purgeCache']);
add_action('nitropack_execute_purge_all', [$this, 'purgeCache']);
}
}
private function purgeCacheDirectory($directory) {
try {
Filesystem::deleteDir($directory);
} catch (\Exception $e) {
// TODO: Log this
return false;
}
}
public function purgeCache() {
$this->purgeCacheDirectory($this->nginx_cache_path);
$this->purgeCacheDirectory($this->wordpress_gt_cache_path);
}
}