Skip to content
This repository has been archived by the owner on Apr 2, 2023. It is now read-only.

I have to comment out the namespace in easyphp.php to make it work #1

Open
skyynet opened this issue May 22, 2019 · 3 comments
Open

Comments

@skyynet
Copy link

skyynet commented May 22, 2019

When I just use the package on my PHP7 environment I get a fatal error: Uncaught Error: Class 'easyMQTT' not found.

When I remove the namespace easyMQTT; at the beginning it works. Is this a PHP7 issue or something else?

@frmatias
Copy link
Owner

It is happens because you need import the class and use the clause importing the class from this name space like this before your code.. this is just a example use App\Conn;

@skyynet
Copy link
Author

skyynet commented May 26, 2019

I use require("easyMQTT.php"); in the first line of my script. What do you mean with use App\Conn;?

@znueni
Copy link

znueni commented Dec 22, 2022

@skyynet
use

require("easyMQTT.php");
$mq = new easyMQTT\easyMQTT( ... )

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants