Does anyone know how much trouble it would be to modify ZP to work with pgsql instead of mysql? Database functions seem to be located in functions-db.php.
Alternatively, can I run without a DB? As far as I can tell, the basic functionality of ZP is filesystem-based. The DB stuff is only used for caching certain meta-data, right?
Thanks
Comments
Alternatively, yes, you could actually run without a database. Just make the connection/query functions always return true or something. Oh, I take it back, it needs some heavy hacking of classes.php not to look for data in the db... but that's fairly easily done as well.
I've thought about adding the option, just for simplicity's sake. Maybe sometime in the future...
Thanks.
classes.php line 352:
`$entry = query_single_row("SELECT *, (date + 0) AS date FROM ".prefix("albums").
" WHERE folder=".mysql_escape_string($folder)." LIMIT 1;");`
doesn't make postgres happy: but damned if I know why.
If you finish all this and get it working, go ahead and send me the code and I'll see about adding it with a switch.
The better way is still to use a database abstraction layer though, so I'll still plan that for 2.0.
SQLite would be a hit as well I think
There's no real need to write your own db abstraction layer by the way - several other GPL projects use similar things to allow usage with multiple databases. FluxBB / PunBB for example has one for Mysql, Mysqli, Postgresql and Sqlite (http://fluxbb.org/trac/browser/fluxbb/branches/fluxbb-1.3-dev/upload/include/dblayer)
Generally, pretty much any time I build a PHP site from scratch instead of using an available open-source CMS or something, I go with PostgreSQL instead of MySQL because I like working with it a lot better... But that does pose problems if it becomes necessary to add on a feature later that ends up requiring MySQL, as in this case.
I too would love to have PostgreSQL support in Zenphoto. Any news here?
Yours,
Alex
In any case to be considered at all it would require a ticket on the issue tracker but no guarantee. We once tried to support SQLite but that being to limited in functionality to cover what we need we had to skip it.
Also if you would like to contribute on that take a look at /zp-core and the file named functions-db-xxxx.php. Since we are set for MySQL we of course use MySQL queries all over the place in the core.
Unfortunately, as acrylian has said, SQLite was simply too "lite" to support Zenphoto functionality.