From 379bfe941bfa03222d4f6cfa2b1ffb470c8a4286 Mon Sep 17 00:00:00 2001 From: adrianbj Date: Mon, 22 Feb 2021 06:50:55 -0800 Subject: [PATCH] Fix missing TracyDebugger cache dir --- TracyDebugger.module.php | 9 +++++++-- includes/CodeProcessor.php | 3 --- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/TracyDebugger.module.php b/TracyDebugger.module.php index 36609b38..a182e5e1 100644 --- a/TracyDebugger.module.php +++ b/TracyDebugger.module.php @@ -27,7 +27,7 @@ public static function getModuleInfo() { 'summary' => __('Tracy debugger from Nette with several PW specific custom tools.', __FILE__), 'author' => 'Adrian Jones', 'href' => 'https://processwire.com/talk/forum/58-tracy-debugger/', - 'version' => '4.21.47', + 'version' => '4.21.48', 'autoload' => 100000, // in PW 3.0.114+ higher numbers are loaded first - we want Tracy first 'singular' => true, 'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4', @@ -378,6 +378,12 @@ public function init() { $this->tracyCacheDir = $this->wire('config')->paths->cache . 'TracyDebugger/'; + if(!is_dir($this->tracyCacheDir)) { + if(!wireMkdir($this->tracyCacheDir)) { + throw new WireException("Unable to create cache path: " . $this->tracyCacheDir); + } + } + // REQUEST LOGGER // add getRequestData() method to the $page object @@ -704,7 +710,6 @@ public function init() { // if modules have been checked to disable if($this->wire('input')->cookie->tracyModulesDisabled) { - if (!file_exists($this->tracyCacheDir)) wireMkdir($this->tracyCacheDir); // if it doesn't already exist, backup existing modules database if(!file_exists($this->tracyCacheDir . $this->modulesDbBackupFilename)) { diff --git a/includes/CodeProcessor.php b/includes/CodeProcessor.php index 3c49c2a0..6b7400fc 100644 --- a/includes/CodeProcessor.php +++ b/includes/CodeProcessor.php @@ -34,9 +34,6 @@ if(file_exists($finishedPath)) include_once($finishedPath); $cachePath = $this->wire('config')->paths->cache . 'TracyDebugger/'; - if(!is_dir($cachePath)) if(!wireMkdir($cachePath)) { - throw new WireException("Unable to create cache path: $cachePath"); - } $this->file = $cachePath.'consoleCode.php'; $tokens = token_get_all($code);