99designs / pheasant-adodb
A subset of the ADOdb API on Pheasant
Installs: 13 884
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.2
- lox/pheasant: >=1.0.0-rc1
Requires (Dev)
- adodb/adodb: 4.81
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2022-02-01 12:23:02 UTC
README
Implements a subset of the ADOdb API using Pheasant
Example Usage
# set up Pheasant connection $pheasant = \Pheasant::setup('mysql://user@localhost/mydb'); $adodbConnection = new \PheasantAdodb\Connection($pheasant->connection()); # start using ADOdb API $adodbConnection->Execute("SELECT 1,2,3")->GetAll();
Or as a drop in replacement for adodb, you can use the compatability include files
# include compatibility files require_once('adodb/adodb.inc.php'); require_once('adodb/adodb-exceptions.inc.php'); # instantiate ADOdb, set fetch mode $adodbConnection = ADONewConnection('mysql://user@localhost/mydb'); $adodbConnection->setFetchMode(ADODB_FETCH_ASSOC); # start using ADOdb API $adodbConnection->Execute("SELECT 1,2,3")->GetAll();
Limitations and assumptions
- Tries to match the behavour of ADOdb v4.81 with the adodb-mysqlt driver only
->Replace(
does not support disabling auto quoting- Every field is escaped as if it were a string
- Magic quotes not supported
- If instantiated directly
- Assumes ADODB_FETCH_ASSOC as the only fetchmode
- Throws exceptions instead of returning error codes
- If instantiated via ADONewConnection
- requires
->setFetchMode(ADODB_FETCH_ASSOC)
to be called - returns error codes unless
adodb-exceptions.inc.php
is included
- requires
Testing
The testsuite uses the real adodb (with mysqlt driver) to compare the results from API calls.
composer install --dev mysql -e 'create database pheasantadodb_test1;' mysql -e 'create database pheasantadodb_test2;' phpunit