[Mapbender_dev] PDO

Christoph Baudson christoph at baudson.de
Fri Oct 1 15:11:03 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Astrid,

Astrid Emde wrote:
> Hello Christoph,
> 
> good idea to use PDO for database access.
> 
> I only have some questions.
> 
> Are the spatial queries (area, transform, length ...) still running with
> the PDO solution?

I guess it works, as spatial operations via PostGIS are only database
functions. Of course some old scripts, like mod_evalArea.php, contain
legacy code from the MySQL days. These would need refactoring (or even
better rewriting). I have refactored mod_evalArea.php [1] as a start.

> 
> Does the PDO usage has any negative impact? Or only positive ones?

The upside is, that we can still keep the old DB wrapper. So we could
use the old wrapper database-pgsql.php for production use, and
database-pgsql-pdo.php for testing. I have added this right
now...changeset 6999 [2].

> 
> Whch are the rare functions?

For example, db_result. I have made a replacement in editElementVars
[3]. We could try to create a workaround for db_result as well...feel
free to make a suggestion.

Christoph

[1] http://trac.osgeo.org/mapbender/changeset/7002/branches
[2] http://trac.osgeo.org/mapbender/changeset/6999/branches
[3] http://trac.osgeo.org/mapbender/changeset/7001/branches

> 
> Astrid
> 
> On Wed, September 29, 2010 6:54 pm, Christoph Baudson wrote:
> 
> Hi list,
> 
> 
> yesterday Karim taught me what he knew about database unit testing in PHP,
> where PDO [1] is apparently required. As database unit testing is quite
> essential in Mapbender, I experimented a little with PDO.
> 
> I used database-pgsql.php [2] as a wrapper for PDO, and also created a
> singleton for the database handle [3].
> 
> At the moment I have trunk running with PDO. An open problem are rarely
> used db functions which can't be mapped to PDO. I will have to address
> these later on, but this should not take long.
> 
> When this is done I can merge my changes back to trunk and we can start
> building database unit tests.
> 
> Christoph
> 
> 
> [1] http://php.net/manual/de/book.pdo.php
> [2]
> http://trac.osgeo.org/mapbender/browser/branches/mapbender/lib/database-pg
> sql.php [3]
> http://trac.osgeo.org/mapbender/browser/branches/mapbender/lib/class_Mapbe
> nder_database.php 

_______________________________________________
Mapbender_dev mailing list
Mapbender_dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapbender_dev
>>
>>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkymMkIACgkQGtMIfbycMX4zTgCgy1py6eJ46HR7r9/L56+yjLWz
+zEAn2Ew4wW9IopFsbrqukzPRrogY17C
=0bHI
-----END PGP SIGNATURE-----


More information about the Mapbender_dev mailing list