Time for action - setting up the application
1. Create a
properties
directory in your webroot,/path/to/webroot/properties:
$ mkdir /path/to/webroot/properties
2. Create the
/path/to/webroot/properties/views
directory:$ mkdir /path/to/webroot/properties/views
3. Copy the
sphinxapi.php
file from the Sphinx source directory to theproperties
directory:$ cp /path/to/sphinx-0.9.9/api/sphinxapi.php /path/to/webroot/properties/
4. Create the file
/path/to/webroot/properties/init.php
with the following code:<?php /** * File: /path/to/webroot/properties/init.php */ // Database connection credentials $dsn ='mysql:dbname=sphinx_properties;host=localhost'; $user = 'root'; $pass = ''; // Instantiate the PDO (PHP 5 specific) class try { $dbh = new PDO($dsn, $user, $pass); } catch (PDOException $e){ echo'Connection failed: '.$e->getMessage(); } // Array to hold variables to be used in views $viewVars = array(); /** * Method to fetch the contents of a view (thtml) file * and return the contents...