diff --git a/framework/library/astroid/Debugger.php b/framework/library/astroid/Debugger.php index 937cb800..6d5ea083 100644 --- a/framework/library/astroid/Debugger.php +++ b/framework/library/astroid/Debugger.php @@ -50,7 +50,7 @@ public function stop($name) $utime = $this->getRunTime($stop, $this->markers[$name], "utime"); $stime = $this->getRunTime($stop, $this->markers[$name], "stime"); - $report = new DebugReport($name); + $report = new Helper\DebugReport($name); $report->save($utime, $stime, memory_get_usage(), memory_get_peak_usage()); Framework::getReporter('Debug')->add($report->render()); } @@ -60,27 +60,3 @@ protected function getRunTime($ru, $rus, $index) return ($ru["ru_$index.tv_sec"] * 1000 + intval($ru["ru_$index.tv_usec"] / 1000)) - ($rus["ru_$index.tv_sec"] * 1000 + intval($rus["ru_$index.tv_usec"] / 1000)); } } - -class DebugReport -{ - public $id = '', $title = '', $utime = 0, $stime = 0, $memory = 0, $memorypeak = 0, $processed = false; - public function __construct($id) - { - $this->id = $id; - $this->title = str_replace(['-', '_'], ' ', Helper::title($id)); - } - - public function save($utime, $stime, $memory, $memorypeak) - { - $this->utime = $utime; - $this->stime = $stime; - $this->memory = $memory; - $this->memorypeak = $memorypeak; - $this->processed = true; - } - - public function render() - { - return '
' . $this->title . ' Time: ' . $this->utime . ' ms Memory: ' . round(($this->memorypeak - $this->memory) / 1048576, 3) . ' MB' . '
'; - } -} diff --git a/framework/library/astroid/Element.php b/framework/library/astroid/Element.php index cd41e8ed..01dfc41a 100644 --- a/framework/library/astroid/Element.php +++ b/framework/library/astroid/Element.php @@ -285,7 +285,6 @@ public function getForm() protected function getParams() { $formData = []; - $return = []; foreach ($this->data as $data) { $data = (array) $data; $formData[$data['name']] = $data['value']; @@ -300,26 +299,6 @@ protected function getParams() } } */ - return $AstroidParams = new AstroidParams($formData); + return new Helper\AstroidParams($formData); } } - -class AstroidParams -{ - - public $params = []; - - function __construct($params) - { - $this->params = $params; - } - - public function get($key, $default = null) - { - if (isset($this->params[$key])) { - return $this->params[$key]; - } else { - return $default; - } - } -} diff --git a/framework/library/astroid/Helper/AstroidParams.php b/framework/library/astroid/Helper/AstroidParams.php new file mode 100644 index 00000000..abe20bb6 --- /dev/null +++ b/framework/library/astroid/Helper/AstroidParams.php @@ -0,0 +1,28 @@ +params = $params; + } + + public function get($key, $default = null) + { + if (isset($this->params[$key])) { + return $this->params[$key]; + } else { + return $default; + } + } +} \ No newline at end of file diff --git a/framework/library/astroid/Helper/Constants.php b/framework/library/astroid/Helper/Constants.php index a82e0286..7c179d69 100644 --- a/framework/library/astroid/Helper/Constants.php +++ b/framework/library/astroid/Helper/Constants.php @@ -18,7 +18,7 @@ class Constants { - public static $astroid_version = '3.1.8'; + public static $astroid_version = '3.1.9-rc1'; public static $fontawesome_version = '6.6.0'; public static $fancybox_version = '5.0'; public static $animatecss_version = '3.7.0'; diff --git a/framework/library/astroid/Helper/DebugReport.php b/framework/library/astroid/Helper/DebugReport.php new file mode 100644 index 00000000..9934a6b9 --- /dev/null +++ b/framework/library/astroid/Helper/DebugReport.php @@ -0,0 +1,34 @@ +id = $id; + $this->title = str_replace(['-', '_'], ' ', Helper::title($id)); + } + + public function save($utime, $stime, $memory, $memorypeak) + { + $this->utime = $utime; + $this->stime = $stime; + $this->memory = $memory; + $this->memorypeak = $memorypeak; + $this->processed = true; + } + + public function render() + { + return '' . $this->title . ' Time: ' . $this->utime . ' ms Memory: ' . round(($this->memorypeak - $this->memory) / 1048576, 3) . ' MB' . '
'; + } +} \ No newline at end of file