Skip to content

Commit

Permalink
feat: add backtrace() for cli debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Jan 18, 2024
1 parent 343b795 commit 5c23d24
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions App/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ public function __construct($name = null)
if (method_exists($this, 'config')) $this->config();
}

/**
* Print backtrace (for debugging)
* @return void
*/
public function backtrace()
{
$trace = debug_backtrace();
echo "--- backtrace ---\n";
foreach ($trace as $item) {
echo " " . $item['file'] . ":" . $item['line'] . "\n";
}
echo "------------------\n";
}

/**
* Check if a .ddev folder exists in pw root
* @return bool
Expand Down

0 comments on commit 5c23d24

Please sign in to comment.