Welcome Guest, Not a member yet? Register   Sign In
Undefined constant "CodeIgniter\Debug\VENDORPATH"
#1

(This post was last modified: 12-16-2022, 03:48 AM by rolf.)

Hi there,
Short question; 

I've been working a while with CI4 (version 4.2.10) now, and I keep getting the following error on a regular basis;

---

Undefined constant "CodeIgniter\Debug\VENDORPATH"

SYSTEMPATH/Debug/Exceptions.php at line 177

----

It seems like a Codeigniter Issue, but I'm not sure if any of you have had the same problem.

The line where the error occurs is 177;

PHP Code:
173     private function isFakerDeprecationError(int $severitystring $message, ?string $file null, ?int $line null)
174     {
175         if (
176             $severity === E_DEPRECATED
177             
&& strpos($fileVENDORPATH 'fakerphp/faker/') !== false
178             
&& $message === 'Use of "static" in callables is deprecated'
179         ) {
180             log_message(
181                 LogLevel::WARNING,
182                 '[DEPRECATED] {message} in {errFile} on line {errLine}.',
183                 [
184                     'message' => $message

Is there something wrong with my configuration? Maybe I should define VENDORPATH somewhere?
Or should we simply add an "defined('VENDORPATH')" in order to not get this error anymore.

Any ideas here are very welcome.
Thanks!



For now I've solved it changing line 177 to:

$severity === E_DEPRECATED && (defined('VENDORPATH'))

However, if this is an error in CI4 itself, I suppose it would be recommendable to report this as an issue?
Reply
#2

It is a bug in CI4.

I sent a PR to fix: https://github.com/codeigniter4/CodeIgniter4/pull/6985
Reply
#3

Thanks @kenjis
Reply
#4

This bug will be fixed in v4.2.11.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB