Installation Instructions
For MySQL users: Before proceeding, you should first update your CodeIgniter installations MySQL Driver with the latest version from the CodeIgniter SVN.
For specific instructions on how to do this, read Troubleshooting. This may be fixed in CodeIgniter 1.7.1+.
Short Version
Unzip and copy everything within application into your CodeIgniter installation's application folder, edit the config, and go map some data!
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/languages/english/datamapper_lang.php file to your CodeIgniter application/language/english 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. - 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!