Quantcast
Channel: Active questions tagged require - Stack Overflow
Viewing all articles
Browse latest Browse all 144

php composer use function and call in required files doesn't work

$
0
0

I'm trying to declare the JWT classes in a separate file to use them in functions, but it's not working, and I really don't understand why.

If I put the use declarations from use.php into jwt.php, it works fine, but I want to be able to put them elsewhere or at least understand why it doesn't work.

I have the error message :

PHP Fatal error: Uncaught Error: Class "JWT" not found in/var/www/config/includes/functions/jwt.php:4

I have created a minimal sandbox reproducing the structure of my project. Thank you for your help!

Here is the sandbox : https://phpsandbox.io/e/x/tromp?layout=EditorPreview&defaultPath=%2F&theme=dark&showExplorer=no&openedFiles=


Viewing all articles
Browse latest Browse all 144

Trending Articles