Skip to content

Commit

Permalink
update packer to 1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kmvan committed Mar 18, 2018
1 parent 86e829c commit 1de6e06
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dist/prober.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
namespace InnStudio\Prober\PreDefine;
\define('TIMER', \microtime(true));
\define('DEBUG', false);
\define('LANG', 'eyJodHRwczpcL1wvZ2l0aHViLmNvbVwva212YW5cL3gtcHJvYmVyIjp7InpoLUNOIjoiaHR0cDpcL1wvZ2l0aHViLmNvbVwva212YW5cL3gtcHJvYmVyIn0sIklOTiBTVFVESU8iOnsiemgtQ04iOiJJTk4gU1RVRElPIn0sImh0dHBzOlwvXC9pbm4tc3R1ZGlvLmNvbVwvcHJvYmVyIjp7InpoLUNOIjoiaHR0cHM6XC9cL2lubi1zdHVkaW8uY29tXC9wcm9iZXIifSwiWCBQcm9iZXIiOnsiemgtQ04iOiJYIFx1NjNhMlx1OTQ4OCJ9LCJGb3VuZCB1cGRhdGUhIHtBUFBfTkFNRX0gaGFzIG5ldyB2ZXJzaW9uIHZ7QVBQX05FV19WRVJTSU9OfSI6eyJ6aC1DTiI6Ilx1NTNkMVx1NzNiMFx1NjZmNFx1NjViMFx1ZmYwMXtBUFBfTkFNRX0gXHU2NzA5XHU2NWIwXHU3MjQ4XHU2NzJjXHVmZjFhdntBUFBfTkVXX1ZFUlNJT059In0sIlVuYXZhaWxhYmxlIjp7InpoLUNOIjoiXHU0ZTBkXHU1M2VmXHU3NTI4In0sIlNlcnZlciBzdGF0dXMiOnsiemgtQ04iOiJcdTY3MGRcdTUyYTFcdTU2NjhcdTcyYjZcdTYwMDEifSwiU3lzdGVtIGxvYWQiOnsiemgtQ04iOiJcdTdjZmJcdTdlZGZcdThkMWZcdThmN2QifSwiTm90IHN1cHBvcnQgb24gV2luZG93cyI6eyJ6aC1DTiI6IldpbmRvd3MgXHU3Y2ZiXHU3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TkxY2NcdTRlOTFcL1x1NTZmZFx1OTY0NVx1NzI0OFwvUEhQNSJ9LCJUZW5jZW50XC9QSFA3Ijp7InpoLUNOIjoiXHU4MTdlXHU4YmFmXHU0ZTkxXC9QSFA3In0sIk15IGluZm9ybWF0aW9uIjp7InpoLUNOIjoiXHU2MjExXHU3Njg0XHU0ZmUxXHU2MDZmIn0sIk15IElQIjp7InpoLUNOIjoiXHU2MjExXHU3Njg0IElQIn0sIk15IFVBIjp7InpoLUNOIjoiXHU2MjExXHU3Njg0IFVBIn0sIkdlbmVyYXRvciAlcyI6eyJ6aC1DTiI6Ilx1OGJlNVx1OTg3NVx1OTc2Mlx1NzUzMSAlcyBcdTc1MWZcdTYyMTAifSwiQXV0aG9yICVzIjp7InpoLUNOIjoiXHU0ZjVjXHU4MDA1XHU0ZTNhICVzIn19');
namespace InnStudio\Prober\Awesome; use InnStudio\Prober\Events\Api as Events; use InnStudio\Prober\I18n\Api as I18n; class Awesome { private $ID = 'awesome'; private $ZH_CN_URL = 'https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css'; private $DEFAULT_URL = 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'; public function __construct() { } public function filter() { ?>
<link rel="stylesheet" href="<?php echo $this->getUrl(); ?>">
<?php
} private function getUrl() { switch (I18n::getClientLang()) { case 'zh-CN': return $this->ZH_CN_URL; } return $this->DEFAULT_URL; } }
namespace InnStudio\Prober\Benchmark; use InnStudio\Prober\Events\Api as Events; use InnStudio\Prober\Helper\Api as Helper; class Benchmark { public function __construct() { Events::on('init', array($this, 'filter')); } public function filter() { if ( ! Helper::isAction('benchmark')) { return; } $this->display(); } private function getPointsByTime($time) { return \pow(10, 3) - (int) ($time * \pow(10, 3)); } private function getHashPoints() { $data = 'inn-studio.com'; $hash = array('md5', 'sha512', 'sha256', 'crc32'); $count = \pow(10, 5); $start = \microtime(true); for ($i = 0; $i < $count; ++$i) { foreach ($hash as $v) { \hash($v, $data); } } return $this->getPointsByTime(\microtime(true) - $start); } private function getIntLoopPoints() { $j = 0; $count = \pow(10, 7); $start = \microtime(true); for ($i = 0; $i < $count; ++$i) { ++$j; } return $this->getPointsByTime(\microtime(true) - $start); } private function getFloatLoopPoints() { $j = 1 / 3; $count = \pow(10, 7); $start = \microtime(true); for ($i = 0; $i < $count; ++$i) { ++$j; } return $this->getPointsByTime(\microtime(true) - $start); } private function getIoLoopPoints() { $tmpDir = \sys_get_temp_dir(); if ( ! \is_writable($tmpDir)) { return 0; } $count = \pow(10, 4); $start = \microtime(true); for ($i = 0; $i < $count; ++$i) { $filePath = "{$tmpDir}/innStudioIoBenchmark-{$i}"; \file_put_contents($filePath, $filePath); \unlink($filePath); } return $this->getPointsByTime(\microtime(true) - $start); } private function getPoints() { return array( 'hash' => $this->getHashPoints(), 'intLoop' => $this->getIntLoopPoints(), 'floatLoop' => $this->getFloatLoopPoints(), 'ioLoop' => $this->getIoLoopPoints(), ); } private function display() { \set_time_limit(0); Helper::dieJson(array( 'code' => 0, 'data' => array( 'points' => $this->getPoints(), ), )); } }
namespace InnStudio\Prober\Config; class Api { public static $APP_VERSION = '1.3.2'; public static $APP_NAME = 'X Prober'; public static $APP_URL = 'https://github.com/kmvan/x-prober'; public static $AUTHOR_URL = 'https://inn-studio.com/prober'; public static $AUTHOR_NAME = 'INN STUDIO'; public static $CHANGELOG_URL = 'https://raw.githubusercontent.com/kmvan/x-prober/master/CHANGELOG.md'; }
namespace InnStudio\Prober\Benchmark; use InnStudio\Prober\Events\Api as Events; use InnStudio\Prober\Helper\Api as Helper; use InnStudio\Prober\I18n\Api as I18n; class Benchmark { private $EXPIRED = 300; public function __construct() { Events::on('init', array($this, 'filter')); } public function filter() { if ( ! Helper::isAction('benchmark')) { return; } $this->display(); } private function getTmpRecorderPath() { return \sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'xproberBenchmarkTimer'; } private function saveTmpRecorder() { return (bool) \file_put_contents($this->getTmpRecorderPath(), \json_encode(array( 'expired' => (int) $_SERVER['REQUEST_TIME'] + $this->EXPIRED, ))); } private function getRemainingSeconds() { $path = $this->getTmpRecorderPath(); if ( ! \is_readable($path)) { return 0; } $data = (string) \file_get_contents($this->getTmpRecorderPath()); if ( ! $data) { return 0; } $data = \json_decode($data, true); if ( ! $data) { return 0; } $expired = isset($data['expired']) ? (int) $data['expired'] : 0; if ( ! $expired) { return 0; } return $expired > (int) $_SERVER['REQUEST_TIME'] ? $expired - (int) $_SERVER['REQUEST_TIME'] : 0; } private function getPointsByTime($time) { return \pow(10, 3) - (int) ($time * \pow(10, 3)); } private function getHashPoints() { $data = 'inn-studio.com'; $hash = array('md5', 'sha512', 'sha256', 'crc32'); $count = \pow(10, 5); $start = \microtime(true); for ($i = 0; $i < $count; ++$i) { foreach ($hash as $v) { \hash($v, $data); } } return $this->getPointsByTime(\microtime(true) - $start); } private function getIntLoopPoints() { $j = 0; $count = \pow(10, 7); $start = \microtime(true); for ($i = 0; $i < $count; ++$i) { ++$j; } return $this->getPointsByTime(\microtime(true) - $start); } private function getFloatLoopPoints() { $j = 1 / 3; $count = \pow(10, 7); $start = \microtime(true); for ($i = 0; $i < $count; ++$i) { ++$j; } return $this->getPointsByTime(\microtime(true) - $start); } private function getIoLoopPoints() { $tmpDir = \sys_get_temp_dir(); if ( ! \is_writable($tmpDir)) { return 0; } $count = \pow(10, 4); $start = \microtime(true); for ($i = 0; $i < $count; ++$i) { $filePath = "{$tmpDir}/innStudioIoBenchmark:{$i}"; \file_put_contents($filePath, $filePath); \unlink($filePath); } return $this->getPointsByTime(\microtime(true) - $start); } private function getPoints() { return array( 'hash' => $this->getHashPoints(), 'intLoop' => $this->getIntLoopPoints(), 'floatLoop' => $this->getFloatLoopPoints(), 'ioLoop' => $this->getIoLoopPoints(), ); } private function display() { $remainingSeconds = $this->getRemainingSeconds(); if ($remainingSeconds) { Helper::dieJson(array( 'code' => -1, 'msg' => \sprintf(I18n::_('Please wait %d seconds'), $remainingSeconds), )); } $this->saveTmpRecorder(); \set_time_limit(0); Helper::dieJson(array( 'code' => 0, 'data' => array( 'points' => $this->getPoints(), ), )); } }
namespace InnStudio\Prober\Config; class Api { public static $APP_VERSION = '1.3.3'; public static $APP_NAME = 'X Prober'; public static $APP_URL = 'https://github.com/kmvan/x-prober'; public static $AUTHOR_URL = 'https://inn-studio.com/prober'; public static $AUTHOR_NAME = 'INN STUDIO'; public static $CHANGELOG_URL = 'https://raw.githubusercontent.com/kmvan/x-prober/master/CHANGELOG.md'; }
namespace InnStudio\Prober\Database; use InnStudio\Prober\Events\Api as Events; use InnStudio\Prober\Helper\Api as Helper; use InnStudio\Prober\I18n\Api as I18n; class Database { private $ID = 'database'; public function __construct() { Events::patch('mods', array($this, 'filter'), 500); } public function filter($mods) { $mods[$this->ID] = array( 'title' => I18n::_('Database'), 'tinyTitle' => I18n::_('DB'), 'display' => array($this, 'display'), ); return $mods; } public function display() { ?>
<div class="row">
<?php echo $this->getContent(); ?>
Expand Down Expand Up @@ -446,8 +446,10 @@ function load() {
points += res.data.points[k];
}
el.innerHTML = '✔️ ' + points.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
} else if (res && res.code) {
el.innerHTML = '⏳ ' + res.msg;
} else {
el.innerHTML = errTx;
el.innerHTML = res;
}
} else {
el.innerHTML = errTx;
Expand Down

0 comments on commit 1de6e06

Please sign in to comment.