ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v6:index

This is an old revision of the document!


ADOdb Version 6

This description relates to prototype versions of ADOdb Version 6 and is subject to change

About ADOdb Version 6

ADOdb Version 6 is a major refactoring (not rewrite) of the main portion of the ADOdb code into a PSR Compliant codebase featuring autoloading and improved logging capabilities. Its focus is on the main Database Extraction features, as well as Meta Functions, The Data Dictionary, the Time library and Session management. There are no plans at this moment to move any of the add-on features, or deprecated drivers forward. Some functions may be discarded, even though the product is generally backwards compatible with version 5.

Highlights

PHP Version

The minimum required version of PHP for this product is 7.4

Logging

All of the logging functions of ADOdb have been offloaded to the Monolog library, allowing you to define individual streams for both debug mode and error trapping. Logging for error handling is now always on, and unaffected by the debug mode flag, although messages along that channel can be discarded by setting up the appropriate monolog stream. For more about logging, visit Logging

Autoloading

ADOdb becomes a PSR level 4 autoload library. An appropriate autoloader class is required.

Encapsulation

ADOdb Version 6 does not use any globalized variables or constants. Each connection becomes a standalone entity, with its own set of definitions, each definition representing an ADOdb Version 5 global or constant. This means, for example that a connection to one database might use numeric arrays in record fetch operations, while a second might simultaneously use associative arrays.

Data Quality

All methods are now type hinted, both on input and output variables. This allows us to eliminate unexpected return types. In addition, all internal methods are now protected.

Footprint

By moving the code of most of the methods from the core files into JIT loadable classes, the footprint of ADOdb becomes much smaller

Easier to understand driver options

Driver specific options are now directly exposed under the name ** OEM Flags **. Each drivers available options can be viewed and modified as necessary, then loaded into the driver. This feature replaces a number of individually crafted items, such as setConnectionParameter(), optionFlags or driverFlags

Feature Enhancements

Part of the new development is to include requested feature that did not appear in version 5. Examples are:

  1. Support for both GEO and JSON datatypes in the data dictionary and meta functions.
  2. Additional metaIndex feature
  3. Additional Date/Time features

Example Connections

ADOdb Version 5

define('ADODB_FETCH_MODE',1);
define('ADODB_ASSOC_CASE',0);
 
include 'adodb/adodb.inc.php';
 
$db = newADOConnection('mysqli');
 
$db->connect('localhost','user','password','database');

ADOdb Version 6 Equivalent Connection

$definitions = new ADOdb\ADOConnectionDefinitions;
$definitions->driver = 'mysqli';
$definitions->fetchMode = $definitions::ADODB_FETCH_ASSOC;
$definitions->assocCase = $definitions::ADODB_ASSOC_CASE_UPPER;
 
$obj = new ADOdb\connector($definitions);
 
$db = $obj->connect('localhost','user','password','database');

Session Management Module

The session management module is now an integrated part of the ADOdb core object. It is now substantially easier to add additional modules such as compression or encryption. The session information can be me unserialized with standard PHP function. The session class itself can be extended much more easily. For more information, see Session Management With V6

Results Caching Service

The caching service supports connections via Memcache servers or APCu . Connections via disk service are no longer supported. For more information see V6 Caching Services

Methods removed in this release

  1. Anything to do with magic quotes
  2. Anything to do with file based caching. Only memcache is supported.
  3. q() - use quote()
  4. errorNative() - use errorNo()
  5. nextId() - use genId()
  6. query() - use execute()
  7. limitQuery() use selectLimit()
  8. disconnect() - use close()
  9. unixDate() - No longer a static method
  10. escape() - use addQ
  11. commitLock() - use commitTrans()
  12. rollBackLock() - use rollBackTrans()
  13. getRows() - use getArray()
  14. free() - use close
  15. numRows() - use recordCount
  16. numcols() - use fieldcount
  17. absolutePosition() - use currentRow()
  18. setConnectionParameter - use ADOOemFlags class
  19. po_Insert_ID() - Also supported databases support insert_id()

Other Changes

  1. $transCnt and $transOff are no longer public, use getTransCnt/setTransCnt getTransOff/setTransOff instead
  2. undocumented constant ADODB_NEVER_PERSIST removed
  3. Pear compatibility removed
  4. Pear ADODB_COMPAT_FETCH removed

Pages in this namespace

v6/index.1614121324.txt.gz · Last modified: by 127.0.0.1