Getting started with the Rocks PHP Library
First of all you need to extract the Rocks Library in a folder of your choice for instance "Rocks".
Next you will need to create the configuration file. The default name for this is config.ini and should be located in the same directory
as where your classes are used. Note that you can use an alternative configuration name, although you will have to provide this when using it in classes etc.
The contents of a typical config file are shown below.
Username = "root"
Password = "pa55w0rd"
Hostname = "localhost"
DatabaseName = "mydatabase"
DatabaseType = "mysql"
Debug = false;
Most of the configuration options are self explanetary. However here in detail is an explanation of all the fields within the configuration file.
- Username field is the username of the user you will connect to your database with.
- Password field is the password of the user you will connect to your database with.
- Hostname field is the name of the database host, which if it is on the same local machine will be localhost, otherwise it could be a named database server instance or IP address.
- DatabaseName field is the name of the database, which is whatever you decided to name your database.
- DatabaseType field is the name of the type of database. Currently the options are: -
- mysql - MySQL
- mssql - Microsoft SQL Server
- pg - PostgreSQL
- oci - Oracle OCI8
- sqlite - SQLite
- sybase - Sybase
- ibase - Firebird/InterBase
- db2 - IBM DB2, Cloudscape and Apache Derby
- ingres - Ingres DBMS, EDBC, and Enterprise Access Gateways
- fbsql - FrontBase
- Debug field. If this is set to true then any queries that are run on the database will be output to the screen. This is a excellent way of seeing what Rocks is doing.
Remember don't delete the [Database] section of the configuration file!
After the configuration settings to your database are complete you are now ready to include Rocks in your PHP code.
Comments to date: 3. Page 1 of 1. Average Rating:
Dash 1:59pm on Monday, May 13th, 2013
That's a smart way of looikng at the world.
DSkinner1983 6:16am on Friday, May 29th, 2009
It currently supports multiple databases by having more than one config file. So one for each database, then when you create a RocksDBO or RocksDatabase class you can pass the config file required for that database to its constructor.
Rulatir 12:32am on Friday, May 29th, 2009
Multiple databases? Is it supported? How?
Written by Dominic Skinner
Last Updated: 2011-10-25 16:00:38