Class not found in setup.php
Closed this issue · 5 comments
Using php 5.4 here and getting an error when attempting step "6 Execute setup.php by running php -f setup.php and follow the instructions"
What I'm seeing is...
PHP Fatal error: Class 'sqlbee' not found in /home/bob/ecobee/sqlbee-master/setup.php on line 4
I'll be the first to admit my php skills are lacking and I'm not sure what this error is pointing to.
I realize this is a personal project and hasn't seen much activity, but I'd appreciate any help you can toss out.
bob
Hah, I think it's awesome that someone actually tried this code.
I'll take a look this evening and respond with some help; I just need to brush up on this code. :)
Hey, equally awesome that you got back to me so fast. Thanks!
I just got the ecobee this weekend and saw your project as a good way to get my feet wet in probing into that beastie.
@bob109 - I got my ecobee about a month ago, also downloaded this project, and ran into the same error you got!
I found a quick and dirty fix: enclose the contents of setup.php in a namespace.
Add this line to the top of setup.php:
namespace sqlbee {
...and put a closing bracket } at the end of the file.
I did the same thing for cron.php.
Good luck.
@bob109: @jnite has the correct solution. This project used to work fine, but when I pulled this code into a larger project as a submodule I made a few breaking changes that I never went back and fixed after I separated the two projects back out.
Since there appears to be at least some interest in this code, I'm going to fix the issue and revisit this a bit and get it into a better state. I'll probably continue this project as a read only interface with the intention of collecting the thermostat logs, but if either of you have any feature requests please open up new issues and let me know.
I'll close this in a commit once I fix the issue. Until then, you can just add the namespace yourself since that's how I'm going to fix it anyways. :)