From 97b9670d489db00a010bb45cc968738ea82b95ba Mon Sep 17 00:00:00 2001 From: "Km.Van" Date: Tue, 13 Jul 2021 15:19:54 +0800 Subject: [PATCH] update to 8.0 --- AppConfig.json | 2 +- CHANGELOG.md | 6 ++++++ dist/prober.php | 6 +++--- src/Components/Config/ConfigApi.php | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/AppConfig.json b/AppConfig.json index b1f55cc..4631e5b 100644 --- a/AppConfig.json +++ b/AppConfig.json @@ -1,5 +1,5 @@ { - "APP_VERSION": "7.7", + "APP_VERSION": "8.0", "APP_NAME": "X Prober", "APP_URL": "https://github.com/kmvan/x-prober", "AUTHOR_URL": "https://inn-studio.com/prober", diff --git a/CHANGELOG.md b/CHANGELOG.md index 776d1ec..7c81ca8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All Notable changes to `X-Prober` will be documented in this file +## 8.0.0 - 2021-07-13 + +### Add + +- New server benchmarks + ## 7.7.0 - 2021-06-30 ### Fix diff --git a/dist/prober.php b/dist/prober.php index 71ab2c8..ff745a7 100644 --- a/dist/prober.php +++ b/dist/prober.php @@ -19,11 +19,11 @@ namespace InnStudio\Prober\Components\PreDefine; \define('XPROBER_TIMER', \micro HTML; } } namespace InnStudio\Prober\Components\Database; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Xconfig\XconfigApi; class Conf extends DatabaseConstants { public function __construct() { EventsApi::on('conf', array($this, 'conf')); } public function conf(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'), 'filePro' => \function_exists('\\filepro'), 'maxDbClient' => \function_exists('\\maxdb_get_client_version') ? \maxdb_get_client_version() : false, 'maxDbServer' => \function_exists('\\maxdb_get_server_version') ? \maxdb_get_server_version() : false, ); return $conf; } } namespace InnStudio\Prober\Components\Database; class Database { public function __construct() { new Conf(); } } namespace InnStudio\Prober\Components\Database; class DatabaseConstants { protected $ID = 'database'; } namespace InnStudio\Prober\Components\Updater; use InnStudio\Prober\Components\Config\ConfigApi; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Restful\HttpStatus; use InnStudio\Prober\Components\Restful\RestfulResponse; class Updater { public function __construct() { EventsApi::on('init', array($this, 'filter')); } public function filter($action) { if ('update' !== $action) { return $action; } $response = new RestfulResponse(); if ( ! \is_writable(__FILE__)) { $response->setStatus(HttpStatus::$INSUFFICIENT_STORAGE); $response->dieJson(); } $code = ''; foreach (ConfigApi::$UPDATE_PHP_URLS as $url) { $code = (string) \file_get_contents($url); if ('' !== \trim($code)) { break; } } if ( ! $code) { $response->setStatus(HttpStatus::$NOT_FOUND); $response->dieJson(); } if (\defined('\\XPROBER_IS_DEV') && \XPROBER_IS_DEV) { $response->dieJson(); } if ((bool) \file_put_contents(__FILE__, $code)) { if (\function_exists('\\opcache_compile_file')) { @\opcache_compile_file(__FILE__) || \opcache_reset(); } $response->dieJson(); } $response->setStatus(HttpStatus::$INTERNAL_SERVER_ERROR); $response->dieJson(); } } namespace InnStudio\Prober\Components\Ping; class PingConstants { protected $ID = 'ping'; } namespace InnStudio\Prober\Components\Ping; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Restful\RestfulResponse; use InnStudio\Prober\Components\Xconfig\XconfigApi; class Ping extends PingConstants { public function __construct() { EventsApi::on('init', array($this, 'filter')); } public function filter($action) { if (XconfigApi::isDisabled($this->ID)) { return $action; } if ($this->ID !== $action) { return $action; } $response = new RestfulResponse(array( 'time' => \microtime(true) - \XPROBER_TIMER, )); $response->dieJson(); } } namespace InnStudio\Prober\Components\Script; use InnStudio\Prober\Components\Events\EventsApi; use InnStudio\Prober\Components\Utils\UtilsApi; class Script { private $ID = 'script'; public function __construct() { EventsApi::on('init', array($this, 'filter')); } public function filter($action) { if ('script' !== $action) { return $action; } $this->output(); } private function output() { UtilsApi::setFileCacheHeader(); \header('Content-type: application/javascript'); echo <<<'HTML' -!function(){var e={640:function(e,t,n){"use strict";var r=n(742),a={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,o,i,l,s,u,c=!1;t||(t={}),n=t.debug||!1;try{if(i=r(),l=document.createRange(),s=document.getSelection(),(u=document.createElement("span")).textContent=e,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 o=a[t.format]||a.default;window.clipboardData.setData(o,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"),o=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(o,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(l):s.removeAllRanges()),u&&document.body.removeChild(u),i()}return c}},679:function(e,t,n){"use strict";var r=n(864),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var a=p(n);a&&a!==h&&e(t,a,r)}var i=c(n);d&&(i=i.concat(d(n)));for(var l=s(t),m=s(n),v=0;v