From: Firman W. <fi...@gm...> - 2005-08-27 09:36:44
|
On 8/27/05, Yves Glodt <yg...@mi...> wrote: > On Saturday 27 August 2005 06:24, Firman Wandayandi wrote: > > On 8/26/05, Yves Glodt <yg...@mi...> wrote: > > > > Nice idea. And also we need to think about "phpsla" system db, > > > > should we use SQLite2 or SQLite3 or both (2 databases)? > > > > > > I'd say we should stay with v2 as long as possible, because v3 will > > > only work with php >=3D 5.1, whereas v2 will work even with php4. > > > > Let me clarify, PDO work on PHP5.x (5.0.x or 5.1.x). If we stay with > > v2, that's mean the user *MUST* load the sqlite extension even he/she > > use PHP5.x and v3 databases only with PDO extension behind phpsla. >=20 > Didn't know it would also work with 5.0 :-) >=20 Ah, see http://pecl.php.net/package/PDO ;-) > > IMHO that isn't suitable solution. >=20 > It seems pdo supports both sqlite2 and sqlite3... Look here: >=20 > http://www.sita.lu:82/phpinfo.php > "PDO drivers sqlite2, sqlite, odbc, mysql, firebird" >=20 >=20 > All you need is to specify the correct connection string, e.g.: >=20 > $db =3D new PDO('sqlite2:/tmp/i-man.sqlite2'); // version 2 > $db =3D new PDO('sqlite:/tmp/i-man.sqlite3'); // version 3 >=20 >=20 > I was not aware until 5 minutes ago that pdo can support both, so that > means we could drop the use of the php_sqlite extension in favor of the > pdo sqlite functions and support v2 and v3 in the same code (well apart > of sqlite sql features that differ between v2 and v3). >=20 Yeah, I never read it carefully, that made this problem goes easy. > Of course we lock out then all the users of php4 :-( >=20 No, IMHO, we should be detect the PHP version first, if it's PHP4, then we should switch to php_sqlite extension. But if it's PHP5 we can use PDO. > Now, comments! >=20 > Have a nice weekend, > Yves >=20 >=20 I hope nice weekend, I must be done the extra work at my job. :-) Have a nice weekend you too! --=20 Firman Wandayandi Never Dreamt Before (http://php.hm/~firman/) |