ID] = array( 'isDev' => XPROBER_IS_DEV, 'version' => ConfigApi::$APP_VERSION, 'appName' => ConfigApi::$APP_NAME, 'appUrl' => ConfigApi::$APP_URL, 'appConfigUrls' => ConfigApi::$APP_CONFIG_URLS, 'appConfigUrlDev' => ConfigApi::$APP_CONFIG_URL_DEV, 'authorUrl' => ConfigApi::$AUTHOR_URL, 'authorName' => ConfigApi::$AUTHOR_NAME, 'authorization' => isset($_SERVER['HTTP_AUTHORIZATION']) ? $_SERVER['HTTP_AUTHORIZATION'] : '', ); return $conf; }); } } namespace InnStudio\Prober\Components\Bootstrap; use InnStudio\Prober\Components\Config\ConfigApi; use InnStudio\Prober\Components\Events\EventsApi; final class Render { public function __construct() { $appName = ConfigApi::$APP_NAME; $version = ConfigApi::$APP_VERSION; $scriptConf = json_encode(EventsApi::emit('conf', array())); $styleUrl = \defined('XPROBER_IS_DEV') && XPROBER_IS_DEV ? 'app.css' : "?action=style&v={$version}"; $scriptUrl = \defined('XPROBER_IS_DEV') && XPROBER_IS_DEV ? 'app.js' : "?action=script&v={$version}"; echo << {$appName} v{$version}
⏳ Loading...
HTML; } } namespace InnStudio\Prober\Components\Config; class ConfigApi { public static $APP_VERSION = '8.20'; public static $APP_NAME = 'X Prober'; public static $APP_URL = 'https://github.com/kmvan/x-prober'; public static $APP_CONFIG_URLS = array('https://raw.githubusercontent.com/kmvan/x-prober/master/AppConfig.json', 'https://api.inn-studio.com/download/?id=xprober-config'); public static $APP_CONFIG_URL_DEV = 'http://localhost:8000/AppConfig.json'; public static $APP_TEMPERATURE_SENSOR_URL = 'http://127.0.0.1'; public static $APP_TEMPERATURE_SENSOR_PORTS = array(2048, 4096); public static $AUTHOR_URL = 'https://inn-studio.com/prober'; public static $UPDATE_PHP_URLS = array('https://raw.githubusercontent.com/kmvan/x-prober/master/dist/prober.php', 'https://api.inn-studio.com/download/?id=xprober'); public static $AUTHOR_NAME = 'INN STUDIO'; public static $LATEST_PHP_STABLE_VERSION = '8'; public static $LATEST_NGINX_STABLE_VERSION = '1.22.0'; } namespace InnStudio\Prober\Components\Database; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Xconfig\XconfigApi; use PDO; use SQLite3; final class Conf extends DatabaseConstants { public function __construct() { EventsApi::on('conf', function (array $conf) { if (XconfigApi::isDisabled($this->ID)) { return $conf; } $sqlite3Version = class_exists('SQLite3') ? SQLite3::version() : false; $conf[$this->ID] = array( 'sqlite3' => $sqlite3Version ? $sqlite3Version['versionString'] : false, 'sqliteLibversion' => \function_exists('sqlite_libversion') ? sqlite_libversion() : false, 'mysqliClientVersion' => \function_exists('mysqli_get_client_version') ? mysqli_get_client_version() : false, 'mongo' => class_exists('Mongo'), 'mongoDb' => class_exists('MongoDB'), 'postgreSql' => \function_exists('pg_connect'), 'paradox' => \function_exists('px_new'), 'msSql' => \function_exists('sqlsrv_server_info'), 'pdo' => class_exists('PDO') ? implode(',', PDO::getAvailableDrivers()) : false, ); return $conf; }); } } namespace InnStudio\Prober\Components\Database; final class Database { public function __construct() { new Conf(); } } namespace InnStudio\Prober\Components\Database; class DatabaseConstants { protected $ID = 'database'; } namespace InnStudio\Prober\Components\DiskUsage; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Utils\UtilsDisk; use InnStudio\Prober\Components\Xconfig\XconfigApi; final class Conf extends DiskUsageConstants { public function __construct() { EventsApi::on('conf', function (array $conf) { if (XconfigApi::isDisabled($this->ID)) { return $conf; } $conf[$this->ID] = array( 'items' => UtilsDisk::getItems(), ); return $conf; }); } } namespace InnStudio\Prober\Components\DiskUsage; final class DiskUsage { public function __construct() { new Conf(); new Fetch(); } } namespace InnStudio\Prober\Components\DiskUsage; class DiskUsageConstants { protected $ID = 'diskUsage'; } namespace InnStudio\Prober\Components\DiskUsage; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Utils\UtilsDisk; use InnStudio\Prober\Components\Xconfig\XconfigApi; final class Fetch extends DiskUsageConstants { public function __construct() { EventsApi::on('fetch', array($this, 'filter')); EventsApi::on('nodes', array($this, 'filter')); } public function filter(array $items) { if (XconfigApi::isDisabled($this->ID)) { return $items; } $items[$this->ID] = array( 'diskUsage' => UtilsDisk::getItems(), ); return $items; } } namespace InnStudio\Prober\Components\Events; final class EventsApi { private static $events = array(); private static $PRIORITY_ID = 'priority'; private static $CALLBACK_ID = 'callback'; public static function on($name, $callback, $priority = 10) { if ( ! isset(self::$events[$name])) { self::$events[$name] = array(); } self::$events[$name][] = array( self::$PRIORITY_ID => $priority, self::$CALLBACK_ID => $callback, ); } public static function emit() { $args = \func_get_args(); $name = $args[0]; $return = isset($args[1]) ? $args[1] : null; unset($args[0], $args[1]); $events = isset(self::$events[$name]) ? self::$events[$name] : false; if ( ! $events) { return $return; } $sortArr = array(); foreach ($events as $k => $filter) { $sortArr[$k] = $filter[self::$PRIORITY_ID]; } array_multisort($sortArr, $events); foreach ($events as $filter) { $return = \call_user_func_array($filter[self::$CALLBACK_ID], array($return, $args)); } return $return; } } namespace InnStudio\Prober\Components\Fetch; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Rest\RestResponse; final class Fetch { public function __construct() { EventsApi::on('init', function ($action) { if ('fetch' === $action) { EventsApi::emit('fetchBefore'); $response = new RestResponse(EventsApi::emit('fetch', array())); $response->json()->end(); } return $action; }, 100); } } namespace InnStudio\Prober\Components\Footer; use InnStudio\Prober\Components\Events\EventsApi; final class Footer { private $ID = 'footer'; public function __construct() { EventsApi::on('conf', function (array $conf) { $conf[$this->ID] = array( 'memUsage' => memory_get_usage(), 'time' => microtime(true) - (\defined('XPROBER_TIMER') ? XPROBER_TIMER : 0), ); return $conf; }, \PHP_INT_MAX); } } namespace InnStudio\Prober\Components\MyInfo; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Rest\RestResponse; use InnStudio\Prober\Components\Rest\StatusCode; use InnStudio\Prober\Components\Utils\UtilsLocation; use InnStudio\Prober\Components\Xconfig\XconfigApi; final class ClientLocationIpv4 extends MyInfoConstants { public function __construct() { EventsApi::on('init', function ($action) { if ('clientLocationIpv4' !== $action) { return $action; } if (XconfigApi::isDisabled($this->ID)) { return $action; } $response = new RestResponse(); $ip = filter_input(\INPUT_GET, 'ip', \FILTER_VALIDATE_IP, array( 'flags' => \FILTER_FLAG_IPV4, )); if ( ! $ip) { $response->setStatus(StatusCode::$BAD_REQUEST)->json()->end(); } $response->setData(UtilsLocation::getLocation($ip))->json()->end(); }); } } namespace InnStudio\Prober\Components\MyInfo; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Utils\UtilsClientIp; use InnStudio\Prober\Components\Xconfig\XconfigApi; final class Conf extends MyInfoConstants { public function __construct() { EventsApi::on('conf', function (array $conf) { if (XconfigApi::isDisabled($this->ID)) { return $conf; } $ip = UtilsClientIp::getV4(); $ipv4 = filter_var($ip, \FILTER_VALIDATE_IP, array( 'flags' => \FILTER_FLAG_IPV4, )) ?: ''; $ipv6 = filter_var($ip, \FILTER_VALIDATE_IP, array( 'flags' => \FILTER_FLAG_IPV6, )) ?: ''; $conf[$this->ID] = array( 'phpLanguage' => isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : '-', 'ipv4' => $ipv4, 'ipv6' => $ipv6, ); return $conf; }); } } namespace InnStudio\Prober\Components\MyInfo; final class MyInfo { public function __construct() { new Conf(); new ClientLocationIpv4(); } } namespace InnStudio\Prober\Components\MyInfo; class MyInfoConstants { protected $ID = 'myInfo'; } namespace InnStudio\Prober\Components\NetworkStats; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Utils\UtilsApi; use InnStudio\Prober\Components\Utils\UtilsNetwork; use InnStudio\Prober\Components\Xconfig\XconfigApi; final class Conf extends NetworkStatsConstants { public function __construct() { UtilsApi::isWin() || EventsApi::on('conf', function (array $conf) { if (XconfigApi::isDisabled($this->ID)) { return $conf; } $conf[$this->ID] = array( 'networks' => UtilsNetwork::getStats(), 'timestamp' => time(), ); return $conf; }); } } namespace InnStudio\Prober\Components\NetworkStats; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Utils\UtilsApi; use InnStudio\Prober\Components\Utils\UtilsNetwork; use InnStudio\Prober\Components\Xconfig\XconfigApi; final class Fetch extends NetworkStatsConstants { public function __construct() { if ( ! UtilsApi::isWin()) { EventsApi::on('fetch', array($this, 'filter')); EventsApi::on('nodes', array($this, 'filter')); } } public function filter(array $items) { if (XconfigApi::isDisabled($this->ID)) { return $items; } $items[$this->ID] = array( 'networks' => UtilsNetwork::getStats(), 'timestamp' => time(), ); return $items; } } namespace InnStudio\Prober\Components\NetworkStats; final class NetworkStats { public function __construct() { new Conf(); new Fetch(); } } namespace InnStudio\Prober\Components\NetworkStats; class NetworkStatsConstants { protected $ID = 'networkStats'; } namespace InnStudio\Prober\Components\Nodes; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Xconfig\XconfigApi; final class Conf extends NodesApi { public function __construct() { EventsApi::on('conf', function (array $conf) { if (XconfigApi::isDisabled($this->ID)) { return $conf; } $conf[$this->ID] = array( 'items' => $this->getNodes(), ); return $conf; }); } } namespace InnStudio\Prober\Components\Nodes; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Rest\RestResponse; use InnStudio\Prober\Components\Rest\StatusCode; final class Fetch extends NodesApi { public function __construct() { EventsApi::on('init', function ($action) { switch ($action) { case 'nodes': EventsApi::emit('fetchNodesBefore'); $response = new RestResponse(EventsApi::emit('nodes', array())); $response->json()->end(); case 'node': EventsApi::emit('fetchNodeBefore'); $nodeId = filter_input(\INPUT_GET, 'nodeId', \FILTER_DEFAULT); $response = new RestResponse(); if ( ! $nodeId) { $response->setStatus(StatusCode::$BAD_REQUEST)->json()->end(); } $data = $this->getNodeData($nodeId); if ( ! $data) { $response->setStatus(StatusCode::$NO_CONTENT)->json()->end(); } $response->setData($data)->json()->end(); } return $action; }, 100); } private function getNodeData($nodeId) { foreach ($this->getNodes() as $item) { if ( ! isset($item['id']) || ! isset($item['url']) || $item['id'] !== $nodeId) { continue; } return $this->getRemoteContent("{$item['url']}?action=fetch"); } } private function getRemoteContent($url) { $content = ''; if (\function_exists('curl_init')) { $ch = curl_init(); curl_setopt_array($ch, array( \CURLOPT_URL => $url, \CURLOPT_RETURNTRANSFER => true, )); $content = curl_exec($ch); curl_close($ch); return json_decode($content, true) ?: null; } return json_decode(file_get_contents($url), true) ?: null; } } namespace InnStudio\Prober\Components\Nodes; final class Nodes { public function __construct() { new Conf(); new Fetch(); } } namespace InnStudio\Prober\Components\Nodes; use InnStudio\Prober\Components\Xconfig\XconfigApi; class NodesApi { public $ID = 'nodes'; public function getNodes() { $items = XconfigApi::getNodes(); if ( ! $items || ! \is_array($items)) { return array(); } return array_filter(array_map(function ($item) { if (2 !== \count($item)) { return; } return array( 'id' => $item[0], 'url' => $item[1], ); }, $items)); } } namespace InnStudio\Prober\Components\PhpExtensions; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Xconfig\XconfigApi; final class Conf extends PhpExtensionsConstants { public function __construct() { EventsApi::on('conf', function (array $conf) { if (XconfigApi::isDisabled($this->ID)) { return $conf; } $jitEnabled = false; if (\function_exists('opcache_get_status')) { $status = opcache_get_status(); if (isset($status['jit']['enabled']) && true === $status['jit']['enabled']) { $jitEnabled = true; } } $conf[$this->ID] = array( 'redis' => \extension_loaded('redis') && class_exists('Redis'), 'sqlite3' => \extension_loaded('sqlite3') && class_exists('Sqlite3'), 'memcache' => \extension_loaded('memcache') && class_exists('Memcache'), 'memcached' => \extension_loaded('memcached') && class_exists('Memcached'), 'opcache' => \function_exists('opcache_get_status'), 'opcacheEnabled' => $this->isOpcEnabled(), 'opcacheJitEnabled' => $jitEnabled, 'swoole' => \extension_loaded('swoole') && \function_exists('swoole_version'), 'imagick' => \extension_loaded('imagick') && class_exists('Imagick'), 'gmagick' => \extension_loaded('gmagick'), 'exif' => \extension_loaded('exif') && \function_exists('exif_imagetype'), 'fileinfo' => \extension_loaded('fileinfo'), 'simplexml' => \extension_loaded('simplexml'), 'sockets' => \extension_loaded('sockets') && \function_exists('socket_accept'), 'mysqli' => \extension_loaded('mysqli') && class_exists('mysqli'), 'zip' => \extension_loaded('zip') && class_exists('ZipArchive'), 'mbstring' => \extension_loaded('mbstring') && \function_exists('mb_substr'), 'phalcon' => \extension_loaded('phalcon'), 'xdebug' => \extension_loaded('xdebug'), 'zendOptimizer' => \function_exists('zend_optimizer_version'), 'ionCube' => \extension_loaded('ioncube loader'), 'sourceGuardian' => \extension_loaded('sourceguardian'), 'ldap' => \function_exists('ldap_connect'), 'curl' => \function_exists('curl_init'), 'loadedExtensions' => XconfigApi::isDisabled('phpExtensionsLoaded') ? array() : get_loaded_extensions(), ); return $conf; }); } private function isOpcEnabled() { $isOpcEnabled = \function_exists('opcache_get_configuration'); if ($isOpcEnabled) { $isOpcEnabled = opcache_get_configuration(); $isOpcEnabled = isset($isOpcEnabled['directives']['opcache.enable']) && true === $isOpcEnabled['directives']['opcache.enable']; } return $isOpcEnabled; } } namespace InnStudio\Prober\Components\PhpExtensions; final class PhpExtensions { public function __construct() { new Conf(); } } namespace InnStudio\Prober\Components\PhpExtensions; class PhpExtensionsConstants { protected $ID = 'phpExtensions'; } namespace InnStudio\Prober\Components\PhpInfo; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Xconfig\XconfigApi; final class Conf extends PhpInfoConstants { public function __construct() { EventsApi::on('conf', function (array $conf) { if (XconfigApi::isDisabled($this->ID)) { return $conf; } $conf[$this->ID] = array( 'version' => \PHP_VERSION, 'sapi' => \PHP_SAPI, 'displayErrors' => (bool) \ini_get('display_errors'), 'errorReporting' => (int) \ini_get('error_reporting'), 'memoryLimit' => (string) \ini_get('memory_limit'), 'postMaxSize' => (string) \ini_get('post_max_size'), 'uploadMaxFilesize' => (string) \ini_get('upload_max_filesize'), 'maxInputVars' => (int) \ini_get('max_input_vars'), 'maxExecutionTime' => (int) \ini_get('max_execution_time'), 'defaultSocketTimeout' => (int) \ini_get('default_socket_timeout'), 'allowUrlFopen' => (bool) \ini_get('allow_url_fopen'), 'smtp' => (bool) \ini_get('SMTP'), 'disableFunctions' => XconfigApi::isDisabled('phpDisabledFunctions') ? array() : array_filter(explode(',', (string) \ini_get('disable_functions'))), 'disableClasses' => XconfigApi::isDisabled('phpDisabledClasses') ? array() : array_filter(explode(',', (string) \ini_get('disable_classes'))), ); return $conf; }); } } namespace InnStudio\Prober\Components\PhpInfo; use InnStudio\Prober\Components\Config\ConfigApi; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Rest\RestResponse; use InnStudio\Prober\Components\Rest\StatusCode; use InnStudio\Prober\Components\Xconfig\XconfigApi; final class FetchLatestPhpVersion extends PhpInfoConstants { public function __construct() { EventsApi::on('init', function ($action) { if (XconfigApi::isDisabled($this->ID)) { return $action; } if ('latest-php-version' !== $action) { return $action; } $response = new RestResponse(); $content = file_get_contents('https://www.php.net/releases/?json'); if ( ! $content) { $response->setStatus(StatusCode::$NOT_FOUND)->end(); } $versions = json_decode($content, true); if ( ! $versions) { $response->setStatus(StatusCode::$NOT_FOUND)->end(); } $version = isset($versions[ConfigApi::$LATEST_PHP_STABLE_VERSION]['version']) ? $versions[ConfigApi::$LATEST_PHP_STABLE_VERSION]['version'] : ''; if ( ! $version) { $response->setStatus(StatusCode::$NOT_FOUND)->end(); } $response->setData(array( 'version' => $version, 'date' => $versions[ConfigApi::$LATEST_PHP_STABLE_VERSION]['date'], ))->json()->end(); }); } } namespace InnStudio\Prober\Components\PhpInfo; final class PhpInfo { public function __construct() { new Conf(); new FetchLatestPhpVersion(); } } namespace InnStudio\Prober\Components\PhpInfo; class PhpInfoConstants { protected $ID = 'phpInfo'; } namespace InnStudio\Prober\Components\PhpInfoDetail; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Xconfig\XconfigApi; final class PhpInfoDetail extends PhpInfoDetailConstants { public function __construct() { EventsApi::on('init', function ($action) { if (XconfigApi::isDisabled($this->ID)) { return $action; } if ($this->ID !== $action) { return $action; } phpinfo(); exit; }); } } namespace InnStudio\Prober\Components\PhpInfoDetail; class PhpInfoDetailConstants { protected $ID = 'phpInfoDetail'; } namespace InnStudio\Prober\Components\Ping; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Xconfig\XconfigApi; final class Conf extends PingConstants { public function __construct() { EventsApi::on('conf', function (array $conf) { if (XconfigApi::isDisabled($this->ID)) { return $conf; } $conf[$this->ID] = array(); return $conf; }); } } namespace InnStudio\Prober\Components\Ping; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Rest\RestResponse; use InnStudio\Prober\Components\Xconfig\XconfigApi; final class Ping extends PingConstants { public function __construct() { new Conf(); EventsApi::on('init', function ($action) { if (XconfigApi::isDisabled($this->ID)) { return $action; } if ($this->ID !== $action) { return $action; } $response = new RestResponse(array( 'time' => \defined('XPROBER_TIMER') ? microtime(true) - XPROBER_TIMER : 0, )); $response->json()->end(); }); } } namespace InnStudio\Prober\Components\Ping; class PingConstants { protected $ID = 'ping'; } namespace InnStudio\Prober\Components\Rest; final class RestResponse { private $data; private $headers = array(); private $status = 200; public function __construct($data = null, $status = 200, array $headers = array()) { $this->setData($data); $this->setStatus($status); $this->setHeaders($headers); } public function setHeader($key, $value, $replace = true) { if ($replace || ! isset($this->headers[$key])) { $this->headers[$key] = $value; } else { $this->headers[$key] .= ", {$value}"; } } public function setHeaders(array $headers) { $this->headers = $headers; } public function getHeaders() { return $this->headers; } public function setStatus($status) { $this->status = $status; return $this; } public function getStatus() { return $this->status; } public function setData($data) { $this->data = $data; return $this; } public function getData() { return $this->data; } public function json() { $this->httpResponseCode($this->status); header('Content-Type: application/json'); header('Expires: 0'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Pragma: no-cache'); echo $this->toJson(); return $this; } public function end() { exit; } private function toJson() { $data = $this->getData(); if (null === $data) { return ''; } return json_encode($data); } private function httpResponseCode($code) { if (\function_exists('http_response_code')) { return http_response_code($code); } $statusCode = array( 100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => '(Unused)', 307 => 'Temporary Redirect', 308 => 'Permanent Redirect', 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 418 => "I'm a teapot", 419 => 'Authentication Timeout', 420 => 'Enhance Your Calm', 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', 424 => 'Method Failure', 425 => 'Unordered Collection', 426 => 'Upgrade Required', 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large', 444 => 'No Response', 449 => 'Retry With', 450 => 'Blocked by Windows Parental Controls', 451 => 'Unavailable For Legal Reasons', 494 => 'Request Header Too Large', 495 => 'Cert Error', 496 => 'No Cert', 497 => 'HTTP to HTTPS', 499 => 'Client Closed Request', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported', 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 508 => 'Loop Detected', 509 => 'Bandwidth Limit Exceeded', 510 => 'Not Extended', 511 => 'Network Authentication Required', 598 => 'Network read timeout error', 599 => 'Network connect timeout error', ); $msg = isset($statusCode[$code]) ? $statusCode[$code] : 'Unknow error'; $protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0'); header("{$protocol} {$code} {$msg}"); } } namespace InnStudio\Prober\Components\Rest; final class StatusCode { public static $__default = 200; public static $CONTINUE = 100; public static $SWITCHING_PROTOCOLS = 101; public static $PROCESSING = 102; public static $OK = 200; public static $CREATED = 201; public static $ACCEPTED = 202; public static $NON_AUTHORITATIVE_INFORMATION = 203; public static $NO_CONTENT = 204; public static $RESET_CONTENT = 205; public static $PARTIAL_CONTENT = 206; public static $MULTI_STATUS = 207; public static $ALREADY_REPORTED = 208; public static $IM_USED = 226; public static $MULTIPLE_CHOICES = 300; public static $MOVED_PERMANENTLY = 301; public static $FOUND = 302; public static $SEE_OTHER = 303; public static $NOT_MODIFIED = 304; public static $USE_PROXY = 305; public static $SWITCH_PROXY = 306; public static $TEMPORARY_REDIRECT = 307; public static $PERMANENT_REDIRECT = 308; public static $BAD_REQUEST = 400; public static $UNAUTHORIZED = 401; public static $PAYMENT_REQUIRED = 402; public static $FORBIDDEN = 403; public static $NOT_FOUND = 404; public static $METHOD_NOT_ALLOWED = 405; public static $NOT_ACCEPTABLE = 406; public static $PROXY_AUTHENTICATION_REQUIRED = 407; public static $REQUEST_TIMEOUT = 408; public static $CONFLICT = 409; public static $GONE = 410; public static $LENGTH_REQUIRED = 411; public static $PRECONDITION_FAILED = 412; public static $REQUEST_ENTITY_TOO_LARGE = 413; public static $REQUEST_URI_TOO_LONG = 414; public static $UNSUPPORTED_MEDIA_TYPE = 415; public static $REQUESTED_RANGE_NOT_SATISFIABLE = 416; public static $EXPECTATION_FAILED = 417; public static $I_AM_A_TEAPOT = 418; public static $AUTHENTICATION_TIMEOUT = 419; public static $ENHANCE_YOUR_CALM = 420; public static $METHOD_FAILURE = 420; public static $UNPROCESSABLE_ENTITY = 422; public static $LOCKED = 423; public static $FAILED_DEPENDENCY = 424; public static $UNORDERED_COLLECTION = 425; public static $UPGRADE_REQUIRED = 426; public static $PRECONDITION_REQUIRED = 428; public static $TOO_MANY_REQUESTS = 429; public static $REQUEST_HEADER_FIELDS_TOO_LARGE = 431; public static $NO_RESPONSE = 444; public static $RETRY_WITH = 449; public static $BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS = 450; public static $REDIRECT = 451; public static $UNAVAILABLE_FOR_LEGAL_REASONS = 451; public static $REQUEST_HEADER_TOO_LARGE = 494; public static $CERT_ERROR = 495; public static $NO_CERT = 496; public static $HTTP_TO_HTTPS = 497; public static $CLIENT_CLOSED_REQUEST = 499; public static $INTERNAL_SERVER_ERROR = 500; public static $NOT_IMPLEMENTED = 501; public static $BAD_GATEWAY = 502; public static $SERVICE_UNAVAILABLE = 503; public static $GATEWAY_TIMEOUT = 504; public static $HTTP_VERSION_NOT_SUPPORTED = 505; public static $VARIANT_ALSO_NEGOTIATES = 506; public static $INSUFFICIENT_STORAGE = 507; public static $LOOP_DETECTED = 508; public static $BANDWIDTH_LIMIT_EXCEEDED = 509; public static $NOT_EXTENDED = 510; public static $NETWORK_AUTHENTICATION_REQUIRED = 511; public static $NETWORK_READ_TIMEOUT_ERROR = 598; public static $NETWORK_CONNECT_TIMEOUT_ERROR = 599; } namespace InnStudio\Prober\Components\Script; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Utils\UtilsApi; final class Script { public function __construct() { EventsApi::on('init', function ($action) { if ('script' !== $action) { return $action; } $this->output(); }); } private function output() { UtilsApi::setFileCacheHeader(); header('Content-type: application/javascript'); echo <<<'HTML' !function(){var e={42:function(e,t,n){"use strict";var r=n(664),i={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,a,o,l,s,u,c=!1;t||(t={}),n=t.debug||!1;try{if(o=r(),l=document.createRange(),s=document.getSelection(),(u=document.createElement("span")).textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=i[t.format]||i.default;window.clipboardData.setData(a,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(u),l.selectNodeContents(u),s.addRange(l),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");c=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),a=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(a,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(l):s.removeAllRanges()),u&&document.body.removeChild(u),o()}return c}},70:function(e,t,n){"use strict";e.exports=n(462)},143:function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(481)},462:function(e,t,n){"use strict";var r=n(758),i=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,a={},u=null,c=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)o.call(t,r)&&!s.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:i,type:e,key:u,ref:c,props:a,_owner:l.current}}t.Fragment=a,t.jsx=u,t.jsxs=u},481:function(e,t,n){"use strict";var r=n(758),i=n(896);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n