aboutsummaryrefslogtreecommitdiffstats
path: root/public/catalog/controller/event/debug.php
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-08-18 21:14:58 -0500
committerJesús <heckyel@hyperbola.info>2019-08-18 21:14:58 -0500
commit2eed7b082f83630301e51f57ca8394de228a8605 (patch)
tree1d19962d22d30f99317d9276e4bae7744fc93fc2 /public/catalog/controller/event/debug.php
downloadlibrecart-2eed7b082f83630301e51f57ca8394de228a8605.tar.lz
librecart-2eed7b082f83630301e51f57ca8394de228a8605.tar.xz
librecart-2eed7b082f83630301e51f57ca8394de228a8605.zip
first commit
Diffstat (limited to 'public/catalog/controller/event/debug.php')
-rw-r--r--public/catalog/controller/event/debug.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/public/catalog/controller/event/debug.php b/public/catalog/controller/event/debug.php
new file mode 100644
index 0000000..fa66f1b
--- /dev/null
+++ b/public/catalog/controller/event/debug.php
@@ -0,0 +1,21 @@
+<?php
+class ControllerEventDebug extends Controller {
+ public function before(&$route, &$args) {
+ if ($route == 'common/home') { // add the route you want to test
+ $this->session->data['debug'][$route] = microtime();
+ }
+ }
+
+ public function after($route, &$args, &$output) {
+ if ($route == 'common/home') { // add the route you want to test
+ if (isset($this->session->data['debug'][$route])) {
+ $log_data = array(
+ 'route' => $route,
+ 'time' => microtime() - $this->session->data['debug'][$route]
+ );
+
+ $this->log->write($log_data);
+ }
+ }
+ }
+}