Skip to content

Commit 775f50c

Browse files
authored
Merge pull request #5403 from kenjis/fix-debug-toolbar-database
fix: undefined constant `VENDORPATH` in `Debug\Toolbar\Collectors\Database`
2 parents 0dbdc1a + 6133888 commit 775f50c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

system/Debug/Toolbar/Collectors/Database.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ public function display(): array
141141
// Clean up the file paths
142142
$traceLine['file'] = str_ireplace(APPPATH, 'APPPATH/', $traceLine['file']);
143143
$traceLine['file'] = str_ireplace(SYSTEMPATH, 'SYSTEMPATH/', $traceLine['file']);
144-
$traceLine['file'] = str_ireplace(VENDORPATH, 'VENDORPATH/', $traceLine['file']);
144+
if (defined('VENDORPATH')) {
145+
// VENDORPATH is not defined unless `vendor/autoload.php` exists
146+
$traceLine['file'] = str_ireplace(VENDORPATH, 'VENDORPATH/', $traceLine['file']);
147+
}
145148
$traceLine['file'] = str_ireplace(ROOTPATH, 'ROOTPATH/', $traceLine['file']);
146149

147150
if (strpos($traceLine['file'], 'SYSTEMPATH') !== false) {

0 commit comments

Comments
 (0)