Installation Instructions
Short Version
Unzip and copy everything within application into your CodeIgniter installation's application folder, add the bootstrap to the index.php file, edit the config, and go map some data!
Long Version
DataMapper is installed in seven steps, with two optional steps:
- Unzip the package.
- Open the application/config/datamapper.php file with a text editor and set your preferred DataMapper settings.
- Upload the application/config/datamapper.php file to your CodeIgniter application/config folder.
- Upload the application/libraries/datamapper.php file to your CodeIgniter application/libraries folder.
- Upload the application/third_party/datamapper folder to your CodeIgniter application/third_party folder.
- Upload the application/language folder to your CodeIgniter application/language folder.
- Open your CodeIgniter application/config/autoload.php file with a text editor and add the database and datamapper libraries to the autoload libraries array.
$autoload['libraries'] = array('database', 'datamapper');
Also, make sure you clear the models array, because DataMapper automatically loads these.$autoload['models'] = array();
For further information on auto-loading, read Auto-loading Resources. - Open your CodeIgniter application/config/database.php file with a text editor and set your database settings, ensuring you set the dbprefix to an empty string.
$db['default']['dbprefix'] = "";
For information on using table prefixes with DataMapper, read Setting up Table Prefixes. - Open your CodeIgniter /index.php file with a text editor and add the DataMapper bootstrap, directly BEFORE the Codeigniter bootstrap.
/* -------------------------------------------------------------------- * LOAD THE DATAMAPPER BOOTSTRAP FILE * -------------------------------------------------------------------- */ require_once APPPATH.'third_party/datamapper/bootstrap.php';
- Optionally, upload the application/helpers/inflector_helper.php file to your CodeIgniter application/helpers folder.
- Optionally, upload the application/datamapper directory to your CodeIgniter application folder, to enable the use of extensions. Highly Recommended! This doesn't have any performance penalty if you do not load the extensions.
Some extensions may require additional views, libraries, helpers, or other items to function correctly. Please check the extensions you plan on using.
That's it!
If you're new to DataMapper, please read the Getting Started section of the User Guide to begin learning how to use DataMapper. Enjoy!