Database Reference
In-Depth Information
<Directory /path/to/your/workspace/practicalneo4j-php/app/public>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
In addition the configuration changes for your local Apache webserver, complete the following two items to
finalize your development environment:
1.
Point your virtual host document root to your new application's public/ directory.
2.
Ensure logs/ and templates/cache are web writeable.
Neo4jPHP
This section covers basic operations and usage of the Neo4jPHP library with the goal of understanding the library
before implementing it within an application. The next section of this chapter will walk you through a sample
application with specific graph goals and models.
Like most of the language drivers and libraries available for Neo4j, the purpose of Neo4jPHP is to provide
a degree of abstraction over the Neo4j REST API. In addition, the Neo4jPHP API provides some additional
enhancements that might otherwise be required at some other stage in the development of your PHP application,
such as caching.
Neo4jPHP is maintained by the super-awesome josh Adell and supported by a number of great PHP graphistas.
If you would like to get involved with Neo4jPHP, go to https://github.com/jadell/neo4jphp .
Note
Each of the following brief sections covers concepts that tie either directly or indirectly to features and
functionality found within the Neo4j Server and REST API. If you choose to go through each language chapter, you will
notice how each library covers those features and functionality in similar ways but takes advantage of the language-
specific capabilities to ensure that the API is flexible and performant.
Managing Nodes and Relationships
Chapters 1 and 2 covered the elements of a graph database, which includes the most basic of graph concepts: the
node. Managing nodes and their properties and relationships will probably account for the bulk of your application's
graph-related code.
Creating a Node
The maintenance of nodes is set in motion with the creation process, as shown in Listing 8-5. Creating a node begins
with setting up a connection to the database and making the node instance. The node properties are set next, and
then the node can be saved to the database.
 
 
Search WWH ::




Custom Search