Skip to content

Commit

Permalink
update to 1.7.5
Browse files Browse the repository at this point in the history
  • Loading branch information
kmvan committed Dec 20, 2018
1 parent d76f0e1 commit baf17af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dist/prober.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
{$this->getContent()}
</div>
HTML;
} private function getContent() { $errLevels = HelperApi::getErrNameByCode(\ini_get('error_reporting')); $items = array( array( 'label' => $this->_('PHP info detail'), 'content' => HelperApi::getBtn("👆 {$this->_('Click to check')}", '?action=phpInfo'), ), array( 'label' => $this->_('Version'), 'title' => \sprintf($this->_('X Prober builtin latest PHP stable version: %s'), '7.2.12'), 'content' => \PHP_VERSION . ' ' . (\version_compare(\PHP_VERSION, ConfigApi::$LATEST_PHP_STABLE_VERSION, '<') ? $this->_('(Old)') : $this->_('(Up to date)')), ), array( 'label' => $this->_('SAPI interface'), 'content' => \PHP_SAPI, ), array( 'label' => $this->_('Error reporting'), 'title' => "error_reporting: {$errLevels}", 'content' => HelperApi::strcut($errLevels), ), array( 'label' => $this->_('Max memory limit'), 'title' => 'memory_limit', 'content' => \ini_get('memory_limit'), ), array( 'label' => $this->_('Max POST size'), 'title' => 'post_max_size', 'content' => \ini_get('post_max_size'), ), array( 'label' => $this->_('Max upload size'), 'title' => 'upload_max_filesize', 'content' => \ini_get('upload_max_filesize'), ), array( 'label' => $this->_('Max input variables'), 'title' => 'max_input_vars', 'content' => \ini_get('max_input_vars'), ), array( 'label' => $this->_('Max execution time'), 'title' => 'max_execution_time', 'content' => \ini_get('max_execution_time'), ), array( 'label' => $this->_('Timeout for socket'), 'title' => 'default_socket_timeout', 'content' => \ini_get('default_socket_timeout'), ), array( 'label' => $this->_('Display errors'), 'title' => 'display_errors', 'content' => HelperApi::getIni('display_errors'), ), array( 'label' => $this->_('Treatment URLs file'), 'title' => 'allow_url_fopen', 'content' => HelperApi::getIni('allow_url_fopen'), ), array( 'label' => $this->_('SMTP support'), 'title' => 'SMTP', 'content' => HelperApi::getIni('SMTP') ?: HelperApi::getIni(0, false), ), array( 'col' => '1-1', 'label' => $this->_('Disabled functions'), 'title' => 'disable_functions', 'content' => \implode(', ', \explode(',', HelperApi::getIni('disable_functions'))) ?: '-', ), array( 'col' => '1-1', 'label' => $this->_('Disabled classes'), 'title' => 'disable_classes', 'content' => \implode(', ', \explode(',', HelperApi::getIni('disable_classes'))) ?: '-', ), ); $content = ''; foreach ($items as $item) { $title = isset($item['title']) ? "title=\"{$item['title']}\"" : ''; $col = isset($item['col']) ? $item['col'] : '1-3'; $id = isset($item['id']) ? "id=\"{$item['id']}\"" : ''; $content .= <<<HTML
} private function getContent() { $errLevels = HelperApi::getErrNameByCode(\ini_get('error_reporting')); $items = array( array( 'label' => $this->_('PHP info detail'), 'content' => HelperApi::getBtn("👆 {$this->_('Click to check')}", '?action=phpInfo'), ), array( 'label' => $this->_('Version'), 'title' => \sprintf($this->_('X Prober builtin latest PHP stable version: %s'), ConfigApi::$LATEST_PHP_STABLE_VERSION), 'content' => \PHP_VERSION . ' ' . (\version_compare(\PHP_VERSION, ConfigApi::$LATEST_PHP_STABLE_VERSION, '<') ? $this->_('(Old)') : $this->_('(Up to date)')), ), array( 'label' => $this->_('SAPI interface'), 'content' => \PHP_SAPI, ), array( 'label' => $this->_('Error reporting'), 'title' => "error_reporting: {$errLevels}", 'content' => HelperApi::strcut($errLevels), ), array( 'label' => $this->_('Max memory limit'), 'title' => 'memory_limit', 'content' => \ini_get('memory_limit'), ), array( 'label' => $this->_('Max POST size'), 'title' => 'post_max_size', 'content' => \ini_get('post_max_size'), ), array( 'label' => $this->_('Max upload size'), 'title' => 'upload_max_filesize', 'content' => \ini_get('upload_max_filesize'), ), array( 'label' => $this->_('Max input variables'), 'title' => 'max_input_vars', 'content' => \ini_get('max_input_vars'), ), array( 'label' => $this->_('Max execution time'), 'title' => 'max_execution_time', 'content' => \ini_get('max_execution_time'), ), array( 'label' => $this->_('Timeout for socket'), 'title' => 'default_socket_timeout', 'content' => \ini_get('default_socket_timeout'), ), array( 'label' => $this->_('Display errors'), 'title' => 'display_errors', 'content' => HelperApi::getIni('display_errors'), ), array( 'label' => $this->_('Treatment URLs file'), 'title' => 'allow_url_fopen', 'content' => HelperApi::getIni('allow_url_fopen'), ), array( 'label' => $this->_('SMTP support'), 'title' => 'SMTP', 'content' => HelperApi::getIni('SMTP') ?: HelperApi::getIni(0, false), ), array( 'col' => '1-1', 'label' => $this->_('Disabled functions'), 'title' => 'disable_functions', 'content' => \implode(', ', \explode(',', HelperApi::getIni('disable_functions'))) ?: '-', ), array( 'col' => '1-1', 'label' => $this->_('Disabled classes'), 'title' => 'disable_classes', 'content' => \implode(', ', \explode(',', HelperApi::getIni('disable_classes'))) ?: '-', ), ); $content = ''; foreach ($items as $item) { $title = isset($item['title']) ? "title=\"{$item['title']}\"" : ''; $col = isset($item['col']) ? $item['col'] : '1-3'; $id = isset($item['id']) ? "id=\"{$item['id']}\"" : ''; $content .= <<<HTML
<div class="poi-g-lg-{$col}">
<div class="form-group">
<div class="group-label" {$title}>{$item['label']}</div>
Expand Down Expand Up @@ -392,7 +392,7 @@ function fillNetworkStats(data) {
<?php
} private function getHumamMemUsage($type) { return HelperApi::getHumamMemUsage($type); } private function _($str) { return I18nApi::_($str); } private function getMemUsage($key, $precent = false, $totalKey = 'MemTotal') { if (false === $precent) { return HelperApi::getMemoryUsage($key); } return HelperApi::getMemoryUsage($key) ? \sprintf('%01.2f', HelperApi::getMemoryUsage($key) / HelperApi::getMemoryUsage($totalKey) * 100) : 0; } }
namespace InnStudio\Prober\I18n; class I18nApi { public static function _($str) { static $translation = null; if (null === $translation) { $translation = \json_decode(\base64_decode(\LANG), true); } $clientLang = self::getClientLang(); $output = isset($translation[$clientLang][$str]) ? $translation[$clientLang][$str] : $str; return $output ?: $str; } public static function getClientLang() { static $cache = null; if (null !== $cache) { return $cache; } if ( ! isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $cache = ''; return $cache; } $client = \explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); if (isset($client[0])) { $cache = \str_replace('-', '_', $client[0]); } else { $cache = 'en'; } return $cache; } }
namespace InnStudio\Prober\Updater; use InnStudio\Prober\Config\ConfigApi; use InnStudio\Prober\Events\EventsApi; use InnStudio\Prober\Helper\HelperApi; use InnStudio\Prober\I18n\I18nApi; class Updater { private $ID = 'updater'; public function __construct() { EventsApi::on('script', array($this, 'filter')); EventsApi::on('init', array($this, 'filterInit')); } public function filterInit() { if ( ! HelperApi::isAction('update')) { return; } if ( ! \is_writable(__FILE__)) { HelperApi::dieJson(array( 'code' => -1, 'msg' => I18nApi::_('File can not update.'), )); } $content = \file_get_contents(ConfigApi::$UPDATE_PHP_URL); if ( ! $content) { HelperApi::dieJson(array( 'code' => -1, 'msg' => I18nApi::_('Update file not found.'), )); } if ((bool) \file_put_contents(__FILE__, $content)) { HelperApi::dieJson(array( 'code' => 0, 'msg' => I18nApi::_('Update success...'), )); } HelperApi::dieJson(array( 'code' => -1, 'msg' => I18nApi::_('Update error.'), )); } public function filter() { $version = ConfigApi::$APP_VERSION; $changeLogUrl = ConfigApi::$CHANGELOG_URL; $authorUrl = ConfigApi::$AUTHOR_URL; echo <<<HTML
namespace InnStudio\Prober\Updater; use InnStudio\Prober\Config\ConfigApi; use InnStudio\Prober\Events\EventsApi; use InnStudio\Prober\Helper\HelperApi; use InnStudio\Prober\I18n\I18nApi; class Updater { private $ID = 'updater'; public function __construct() { EventsApi::on('script', array($this, 'filter')); EventsApi::on('init', array($this, 'filterInit')); } public function filterInit() { if ( ! HelperApi::isAction('update')) { return; } if ( ! \is_writable(__FILE__)) { HelperApi::dieJson(array( 'code' => -1, 'msg' => I18nApi::_('File can not update.'), )); } $content = \file_get_contents(ConfigApi::$UPDATE_PHP_URL); if ( ! $content) { HelperApi::dieJson(array( 'code' => -1, 'msg' => I18nApi::_('Update file not found.'), )); } if ((bool) \file_put_contents(__FILE__, $content)) { if (\function_exists('\\opcache_reset')) { \opcache_reset(); } HelperApi::dieJson(array( 'code' => 0, 'msg' => I18nApi::_('Update success...'), )); } HelperApi::dieJson(array( 'code' => -1, 'msg' => I18nApi::_('Update error.'), )); } public function filter() { $version = ConfigApi::$APP_VERSION; $changeLogUrl = ConfigApi::$CHANGELOG_URL; $authorUrl = ConfigApi::$AUTHOR_URL; echo <<<HTML
<script>
(function(){
var versionCompare = function(left, right) {
Expand Down Expand Up @@ -522,7 +522,7 @@ function getVersionInfo(data){
</div>
HTML;
} return $content; } }
namespace InnStudio\Prober\Config; class ConfigApi { public static $APP_VERSION = '1.7.4'; 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 $UPDATE_PHP_URL = 'https://raw.githubusercontent.com/kmvan/x-prober/master/dist/prober.php'; public static $AUTHOR_NAME = 'INN STUDIO'; public static $CHANGELOG_URL = 'https://raw.githubusercontent.com/kmvan/x-prober/master/CHANGELOG.md'; public static $LATEST_PHP_STABLE_VERSION = '7.2.12'; }
namespace InnStudio\Prober\Config; class ConfigApi { public static $APP_VERSION = '1.7.5'; 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 $UPDATE_PHP_URL = 'https://raw.githubusercontent.com/kmvan/x-prober/master/dist/prober.php'; public static $AUTHOR_NAME = 'INN STUDIO'; public static $CHANGELOG_URL = 'https://raw.githubusercontent.com/kmvan/x-prober/master/CHANGELOG.md'; public static $LATEST_PHP_STABLE_VERSION = '7.3.0'; }
namespace InnStudio\Prober\Style; use InnStudio\Prober\Events\EventsApi; class Style { private $ID = 'style'; public function __construct() { EventsApi::on('style', array($this, 'filter')); } public function filter() { $this->styleProgress(); $this->styleGlobal(); $this->stylePoiContainer(); $this->stylePoiGrid(); $this->styleTitle(); } private function styleTitle() { ?>
<style>
.long-title{
Expand Down

0 comments on commit baf17af

Please sign in to comment.