AdoDB 507 für PHP 5 Anwender

In diesem Board könnt Ihr alle "allgemeinen" Fragen zum Thema MyOOS stellen.
Antworten
r23
Beiträge: 2622
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

Hallo,

allen MyOOS Anwendern von PHP 5 empfehlen wir ein update auf adodb-507-for-php5 im Shop-Framework

in 1.6.x liegt adodb
in dem Verzeichnis
~/shop/includes/classes/adodb/
und
~/shop/admin/includes/classes/adodb/

da man hier noch den Shop vom Admin trennen konnte.

Da dies keiner machte ;) gibt in der aktuellen Version adodb nur noch einmal
~/shop/includes/classes/thirdparty/adodb/





File Release Notes and Changelog

Release Name: adodb-507-for-php5

Notes:
Major Changes:


PHP5.3 Support
==============
Removed all ereg* functions in sybase and postgres drivers.


PHP4 No Longer Supported
========================

Kindly note that all php4 releases are no longer supported. Please upgrade to PHP5 if you want to continue using the latest ADOdb.



Active Record Parent Child Redesign
===================================

Redesign of active record parent-child relationships. The old way was

$person = new person();
$person->HasMany('children', 'person_id');
$person->Load("id=1");

Where "persons" is parent table, "children" is child table and "children.person_id" is field in "children" pointing to "persons".

This makes it confusing for the programmer. Has $person->HasMany() been called yet? The above code will still work in adodb, but is deprecated.

ClassHasMany
------------
The new way defines the relationship in a static function, which makes it clearer that it only needs to be called once in your init php code:

class person extends ADOdb_Active_Record{}
ADODB_Active_Record::ClassHasMany('person', 'children','person_id');
$person = new person();
$person->Load("id=1");

TableHasMany
------------
If the table name of the parent is not "persons", but "people", you can use:

ADODB_Active_Record::TableHasMany('people', 'children','person_id');
$person = new person();
$person->Load("id=1");

TableKeyHasMany
---------------
The default primary key name is "id". You can override it (say "pid" is used) using

ADODB_Active_Record::TableKeyHasMany('people', 'pid', 'children', 'person_id')

Child Class Definition
----------------------
Formerly, the child class was always an ADODB_Active_Record instnace. Now you can derive the class of the children like this:

class childclass extends ADODB_Active_Record {... };
ADODB_Active_Record::ClassHasMany('person', 'children','person_id', 'childclass');

Works the same way with TableHasMany().

Belongs To
----------
Analogously, there are functions ClassBelongsTo, TableBelongsTo, TableKeyBelongsTo for defining child pointing to parent.


Changes:
BeginTrans/CommitTrans/RollbackTrans return true/false correctly on success/failure now for mssql, odbc, oci8, mysqlt, mysqli, postgres, pdo.

Replace() now quotes all non-null values including numeric ones.

Postgresql qstr() now returns booleans as true and false without quotes.

MetaForeignKeys in mysql and mysqli drivers had this problem: A table can have two foreign keys pointing to the same column in the same table. The original code will incorrectly report only the last column. Fixed. https://sourceforge.net/tracker/index.p ... tid=433976

Passing in full ado connection string in $argHostname with ado drivers was failing in adodb5 due to bug. Fixed.

Fixed memcachelib flushcache and flushall bugs. Also fixed possible timeCreated = 0 problem in readcache. (Also in adodb 4.992). Thanks AlexB_UK (alexbarnes#hotmail.com).

Fixed a notice in adodb-sessions2.inc.php, in _conn(). Thx bober m.derlukiewicz#rocktech.remove_me.pl;

ADOdb Active Record: Fixed some issues with incompatible fetch modes (ADODB_FETCH_ASSOC) causing problems in UpdateActiveTable().

ADOdb Active Record: Added support for functions that support predefining one-to-many relationships:
ClassHasMany ClassBelongsTo TableHasMany TableBelongsTo TableKeyHasMany TableKeyBelongsTo.
You can also define your child/parent class in these functions, instead of the default ADODB_Active_Record. Thx Arialdo Martini & Chris R for idea.

ADOdb Active Record: HasMany hardcoded primary key to "id". Fixed.

Many pdo and pdo-sqlite fixes from Sid Dunayer [sdunayer#interserv.com].

CacheSelectLimit not working for mssql. Fixed. Thx AlexB.

The rs2html function did not display hours in timestamps correctly. Now 24hr clock used.

Changed ereg* functions to use preg* functions as ereg* is deprecated in PHP 5.3. Modified sybase and postgresql drivers.
Antworten