0% fat and extremely easy to use. Only connect to database when needed.
Clone the repository:
git clone git://github.com/nbari/DALMP.git dalmpOn FreeBSD you can install DALMP from ports: /usr/ports/databases/dalmp
DALMP takes the parameters from a DSN (database source name) so before you can start using it you need to define these values as shown in the self explanatory example below.
require_once 'dalmp.php';
// DSN format: charset://username:password@host:port/database
$db = new DALMP('utf8://root:'.rawurlencode('pass-?/:word').'@mysql.localbox.org:3306/mydatabase');
$rs = $db->FetchMode('ASSOC')->PGetAll('SELECT id,name FROM users WHERE id=?',3);Example using memcache, notice that the cache parameters are the DSN query
require_once 'dalmp.php';
// DSN format: charset://username:password@host:port/database?(type:host:port:compression)
$db = new DALMP('utf8://root:'.rawurlencode('pass-?/:word').'@mysql.localbox.org:3306/mydatabase?memcache:127.0.0.1:11211:1');
$rs = $db->FetchMode('ASSOC')->PCacheGetAll('SELECT id,name FROM users WHERE id=?',3);Example storing Session on DB
require_once 'dalmp.php';
$db = new DALMP('utf8://root:'.rawurlencode('pass-?/:word').'@mysql.localbox.org:3306/mydatabase');
$sessions = new DALMP_Sessions($db);
if ((mt_rand() % 10) == 0) {
$sessions->regenerate_id(4);
}
$_SESSION['test'] = 1 + @$_SESSION['test'];
If you found a bug of have any other inquiries please use the the DALMP group at :https://groups.google.com/group/dalmp