From 27c3f554aa635ff2164ec35751678dddac4b88a4 Mon Sep 17 00:00:00 2001
From: DieGOs <9585999@gmail.com>
Date: Tue, 8 Aug 2017 23:58:45 +0300
Subject: [PATCH 1/5] Update Debugger.php
---
src/Module/Debugger.php | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/Module/Debugger.php b/src/Module/Debugger.php
index 09cd6bf..4e4c643 100644
--- a/src/Module/Debugger.php
+++ b/src/Module/Debugger.php
@@ -81,11 +81,18 @@ public function hierarchy()
global $wp_query;
$templates = (new \Brain\Hierarchy\Hierarchy())->getTemplates($wp_query);
$templates[] = 'app.php';
- $templates = array_reverse($templates);
+
+ $templates = array_map(function ($template) {
+ return basename($template);
+ }, $templates);
+
+ $templates = array_reverse(array_unique($templates));
+
$path = get_stylesheet_directory() . '/controllers';
$path = (has_filter('sober/controller/path') ? apply_filters('sober/controller/path', rtrim($path)) : get_stylesheet_directory() . '/controllers');
$path = basename($path);
echo '
Hierarchy Debugger:
';
+
foreach ($templates as $template) {
if (strpos($template, '.blade.php') || $template === 'index.php') {
continue;
From ced987d577758b69bb08487c7b2f842c97fc696e Mon Sep 17 00:00:00 2001
From: DieGOs <9585999@gmail.com>
Date: Wed, 9 Aug 2017 00:34:44 +0300
Subject: [PATCH 2/5] Update Debugger.php
---
src/Module/Debugger.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Module/Debugger.php b/src/Module/Debugger.php
index 4e4c643..c8732ec 100644
--- a/src/Module/Debugger.php
+++ b/src/Module/Debugger.php
@@ -91,8 +91,8 @@ public function hierarchy()
$path = get_stylesheet_directory() . '/controllers';
$path = (has_filter('sober/controller/path') ? apply_filters('sober/controller/path', rtrim($path)) : get_stylesheet_directory() . '/controllers');
$path = basename($path);
+
echo '
Hierarchy Debugger:
';
-
foreach ($templates as $template) {
if (strpos($template, '.blade.php') || $template === 'index.php') {
continue;
From dd15391f0e774beb1d6a4091cc73302f4f409d29 Mon Sep 17 00:00:00 2001
From: DieGOs <9585999@gmail.com>
Date: Wed, 9 Aug 2017 10:00:39 +0300
Subject: [PATCH 3/5] Update Debugger.php
A bug was detected, template files template-custom.php were not output. Corrected.
---
src/Module/Debugger.php | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/Module/Debugger.php b/src/Module/Debugger.php
index c8732ec..3e8809e 100644
--- a/src/Module/Debugger.php
+++ b/src/Module/Debugger.php
@@ -83,23 +83,24 @@ public function hierarchy()
$templates[] = 'app.php';
$templates = array_map(function ($template) {
- return basename($template);
+ $template = basename($template);
+ if ($template === 'index') {
+ $template = 'index.php';
+ }
+ if (strpos($template, '.blade.php')) {
+ $template = str_replace('.blade', '', $template);
+ }
+ return $template;
}, $templates);
-
- $templates = array_reverse(array_unique($templates));
+ $templates = array_reverse(array_unique($templates));
+
$path = get_stylesheet_directory() . '/controllers';
$path = (has_filter('sober/controller/path') ? apply_filters('sober/controller/path', rtrim($path)) : get_stylesheet_directory() . '/controllers');
$path = basename($path);
-
+
echo '
Hierarchy Debugger:
';
foreach ($templates as $template) {
- if (strpos($template, '.blade.php') || $template === 'index.php') {
- continue;
- }
- if ($template === 'index') {
- $template = 'index.php';
- }
echo "- " . $path . '/' . $template . "
";
}
echo '
';
From 331f4e9230a7dd234d660cd720ecc34cd5322441 Mon Sep 17 00:00:00 2001
From: DieGOs <9585999@gmail.com>
Date: Wed, 9 Aug 2017 10:15:24 +0300
Subject: [PATCH 4/5] Update Debugger.php
---
src/Module/Debugger.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Module/Debugger.php b/src/Module/Debugger.php
index 3e8809e..93aeded 100644
--- a/src/Module/Debugger.php
+++ b/src/Module/Debugger.php
@@ -96,7 +96,7 @@ public function hierarchy()
$templates = array_reverse(array_unique($templates));
$path = get_stylesheet_directory() . '/controllers';
- $path = (has_filter('sober/controller/path') ? apply_filters('sober/controller/path', rtrim($path)) : get_stylesheet_directory() . '/controllers');
+ $path = (has_filter('sober/controller/path') ? apply_filters('sober/controller/path', rtrim($path)) : $path);
$path = basename($path);
echo 'Hierarchy Debugger:
';
From fa65cdccd61b1dc0064cab88fda666cb94b6b398 Mon Sep 17 00:00:00 2001
From: DieGOs <9585999@gmail.com>
Date: Wed, 9 Aug 2017 10:33:12 +0300
Subject: [PATCH 5/5] Update Debugger.php
Final.
---
src/Module/Debugger.php | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/Module/Debugger.php b/src/Module/Debugger.php
index 93aeded..6f2e559 100644
--- a/src/Module/Debugger.php
+++ b/src/Module/Debugger.php
@@ -83,14 +83,13 @@ public function hierarchy()
$templates[] = 'app.php';
$templates = array_map(function ($template) {
- $template = basename($template);
if ($template === 'index') {
$template = 'index.php';
}
if (strpos($template, '.blade.php')) {
$template = str_replace('.blade', '', $template);
}
- return $template;
+ return basename($template);
}, $templates);
$templates = array_reverse(array_unique($templates));