This document will give you a brief overview of the ItemManager API, including how to download and use it.
Get up and running in 2 steps:
The file structure of ItemManager is not completely created yet and I am still making some changes...
your-project │ .htaccess │ imanager.php │ index.php │ README.md │ └───data │ │ │ └───backups │ │ │ your-backup-files │ │ │ ... │ │ │ └───cache │ │ │ your-chache-files │ │ │ ... │ │ │ └───datasets │ │ │ contents │ │ │ ... │ │ │ └───logs │ │ │ system-logs │ │ │ ... │ │ │ └───settings │ │ │ custom-settings │ │ │ ... │ │ │ └───uploads │ │ uploaded-files │ │ ... │ └───imanager │ imanager-core-files │ ...
Before you start using ItemManager, you must set appropriate file permissions to allow ItemManager access and write into the complete
data/ directory except
It is recommended the 755 permission for writable directories and 644 permission for writable files, as a starting point.
Please be careful with file permissions like 777 or 666. Those permissions effectively make the files readable and writable to all accounts on the server.
Please make sure that the
.htaccess file that comes with ItemManager, is located in the root directory – it's usually where your
imanager.php file is locaded.
Note: In order for
.htaccessfile to work and run,
AllowOverridedirective must be enabled.
When you run ItemManager, your project-specific configuration settings can be included during execution. You can add your configuration entries into the
custom.config.php file. By default there is no custom.config.php file in your
/your-project/data/settings/ directory, you have to create it first. The directory
/your-project/imanager/inc/ contains a
config.php file (This is the default configuration file and should not be changed). You will need to make a copy of this file, place it in the
/your-project/data/settings/ directory and re-name it to
custom.config.php, that one will take priority over default ItemManager settings. Now, you can modify all variables listed in the custom.config.php suit your needs.
The basic architecture of ItemManager is based on the following 3 main objects:
The Categories represent a kind of initial model, each Item or Field you create must belong to a specific category. The fields are used to determine the properties of items in a category and to control the input, storage and output of the content. ItemManager's fields actually consist of two separate entities: field and input. There are several field types that you can use to customize your items according to your needs.
The probably best approach to understand the concept of ItemManager is to compare it to a database. So imagine the categories are tables, the fields are columns and items are the datasets contained in the tables.
Take a look at the example of the Users category:
To be able to work with the users, we first access the category (table):
id username password 1 user-1 email@example.com ... 2 user-2 firstname.lastname@example.org ... 3 user-3 email@example.com ...In the next step we have the access to the specific user data:
$users = $imanager->getCategory('name=Users');
$user = $users->getItem('username=user-2'); echo $user->email;
Let's start with the proper tutorial.