PersistenceObjects for php

5. Configure DatabaseManager and create the database.

PersistenceObjects use a DatabaseManager-class for all database-queries. The manager needs to be configured. There is a conf.ini-file located in lib/databasemanager/conf-folder. Setup the configuration as is best for your case.

[mysql_settings]
host = localhost
user = root
password = 
port = 
database = persistenceobjectstest

There is also a logger that is used for logging everything possible as loggers usually do. Be aware that only NONE and ERRORS loglevel should be used on deployed enviroments since logging affects performance a lot. Logger has a simple conf.ini file in it's conf folder. The default is usually enough.

// acceptable logLevels: NONE, ERRORS, EVENTS, QUERIES, ALL
[logger_settings]
logFile = log.txt
logLevel = NONE

Finally we have to create the tables in the database. The database setup for this example is like this:

If everything is done correctly the test should run and no exceptions should come up.

previous - Describe the classes
next - Use the PersistenceObjects in your controllers