Installing the DataMapper for PHP

This section explains how to install, configure, and use the SQLMap DataMapper with your PHP application.

There are two steps to using SQLMap DataMapper with your application for the first time.

  1. Setup the distribution
  2. Add XML documents

Setup the Distribution

The official site for SQLMap PHP DataMapper is https://github.com/pradosoft/prado. The DataMapper is availabe as a source distribution in the form of a ZIP archive. To download the distributions, follow the link to the Downloads area on the web site, and select the the source distribution for the SQLMap PHP DataMapper release. You can extract the distribution using a utility like WinZip or the extractor built into newer versions of Windows.

TODO: Add distribution contents

Add XML file items

After unpacking the source distribution, you will need to add two types of XML files to your Web application, or library project (and Test project if you have one). These files are:

SqlMap.xml
-- A Data Map file that contains your SQL queries. Your project will contain one or more of these files with names such as Account.xml or Product.xml.
SqlMap.config
-- The DataMapper configuration file that is used to specify the locations of your SqlMap.xml files. It is also used to define other DataMapper configuration options such as caching. You will need to include one SqlMap.config file for each data source that your project has.

As expected, the SqlMap.config file should be (by default) placed where the DataMapper can find them at runtime.