How do you get Neo4jPHP to autoload as a library in CodeIgniter 2 ?
https://github.com/jadell/Neo4jPHP http://codeigniter.com/
Neo4jPHP is a wrapper for the Neo4j SERVER REST API.
I have the Neo4j server running and used PHP to populate the DB with many nodes and relationships.
Next STEP - start using a more complete PHP abstraction of the REST API - Neo4jPHP
But, I'm stuck at auto loadi开发者_JAVA技巧ng Neo4jPHP as a library in CodeIgniter.
I added: $autoload['libraries'] = array('Everyman/Neo4j');
And get: An Error Was Encountered : "Unable to load the requested class: neo4j"
I'm pulling my hair out over what should be a simple step to get going...
I'm the author of Neo4jPHP. I'm not that familiar with CI, but I worked up a quick blog post on a technique that I think might work. Please let me know if it does not, or it needs to be improved.
http://blog.everymansoftware.com/2011/08/getting-neo4jphp-working-with.html
From the CI User Guide:
File names must be capitalized. For example: Myclass.php
Class declarations must be capitalized. For example: class Myclass
Classnames and file names must match.
That's why CI is trying to construct object for class Neo4j. I suggest you create a wrapper class for the Neo4j interface.
精彩评论