Database Reference
In-Depth Information
Chapter 8
Neo4j + PHP
This chapter focuses on using PHP with Neo4j and creating a working application that integrates the five graph model
types covered in Chapter 3. As with other languages that offer drivers for Neo4j, the integration takes place using a
Neo4j server instance with the Neo4j REST API. This chapter is divided into the following topics:
PHP and Neo4j Development Environment
Neo4jPHP
Developing a PHP and Neo4j application
In each chapter that explores a particular language paired with Neo4j, I recommend that you start a free trial on
www.graphstory.com or have installed a local Neo4j server instance as shown in Chapter 2.
To quickly set up a server instance with the sample data and plugins for this chapter, go to graphstory.com/
practicalneo4j . You will be provided with your own free trial instance, a knowledge base, and email support from
Graph Story.
Tip
For this chapter, I assume that you have at least a beginning knowledge of PHP and a basic understanding of how
to configure PHP for your preferred operating system. To proceed with the examples in this chapter, you will need to
have installed and configured PHP 5.3.28 or greater. In addition, the sample application uses the Apache HTTP server
and php5_module.
If you do not have Apache HTTP installed, it is highly recommended that you follow the instructions at
http://httpd.apache.org/ based on your operating system. Configuring PHP with a local instance of Apache HTTP is
beyond the scope of this topic, but the basic steps can be found at http://www.php.net/manual/en/refs.utilspec.
server.php .
Do This
I also assume that you have a basic understanding of the model-view-controller (MVC) pattern and some
knowledge of PHP frameworks that provide an MVC pattern. There are, of course, a number of excellent PHP
frameworks from which to choose, but I had to pick one for the illustrative purposes of the application in this chapter.
I chose the Slim PHP framework because it is limited in its scope and allows the focus to remain on the application to
the greatest extent possible. This chapter is focused on integrating Neo4j into your PHP skill set and projects and does
not dive deeply into the best practices of developing with PHP or PHP frameworks.
 
 
Search WWH ::




Custom Search