thobbs / phpcassa

PHP client library for Apache Cassandra
thobbs.github.com/phpcassa
MIT License
248 stars 78 forks source link

php 5.3.2 - Issue with autoload.php #116

Closed drewbroadley closed 11 years ago

drewbroadley commented 11 years ago

I have an issue with this, where the autoloader's anonymous function doesn't get triggered on a "use" statement.

I have the following:

include_once("lib/thirdparty/Data/Cassandra/lib/autoload.php");
use phpcassa\ColumnFamily;
use phpcassa\ColumnSlice;
use phpcassa\Connection\ConnectionPool;

Not one of those use calls gets triggered by the autoload.php (unchanged from git)

OS: Ubuntu 10.10 LTS PHP: 5.3.2

Is this an issue with the autoloader or an issue with the PHP version ?

drewbroadley commented 11 years ago

https://bugs.php.net/bug.php?id=51991

Seems like this could be related, I'm curious why no one else has had this issue

drewbroadley commented 11 years ago

Okay on discovery, it's issues with phpcassa's autoloader an scoping.

Can you please provide an example of using phpcassa outside of a single file, i.e. inside a wrapper class etc.

thobbs commented 11 years ago

I'm not sure what scoping issues you're referring to. You can look at the files inside of test/ for examples; some of the test modules require other test modules.

Are you interacting with the autoloader somewhere else with anything other than spl_autoload_register()?

ricardclau commented 11 years ago

well use clause does not trigger any autoload, it is triggered indeed when you instance, extend or typehint the class.

Also 5.3.2 is considered buggy, minimal accepted version in most PHP projects is 5.3.3 so might be also an issue with PHP verion

thobbs commented 11 years ago

Closing until we get more details or other reports.