Skip to content

Commit

Permalink
Fix missing TracyDebugger cache dir
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianbj committed Feb 22, 2021
1 parent d99aaa3 commit 379bfe9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 7 additions & 2 deletions TracyDebugger.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)) {
Expand Down
3 changes: 0 additions & 3 deletions includes/CodeProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 379bfe9

Please sign in to comment.