Skip to content
geonef edited this page Mar 19, 2012 · 1 revision

Notes

Questions about prototyping

PHP exceptions

Should errors be handled through PHP exceptions? If so, many methods can return the "real" result rather than status integer. It is quite practical, but different from GDAL/OGR model.

Constants

In GDAL/OGR, constants are "global", as preprocessor constants (#define). In PHP, the best practise would encourage these constants to belong to PHP classes, when it is logical. Again, this good practise would make the PHP API different from original GDAL/OGR's.

Implementation notes

Memory management

OGR

  • We don't use OGRSFDriverRegistrar::OpenShared, to keep things simple. Hence, we don't use OGRDataSource::Release either. Same way as PosgreSQL PHP module. Explicit Open/Close. PHP app is responsible for it, and is trusted not to access layers/features/... belonging to a closed dataSource. DataSources are closed at the end of request anyway by the module.
Clone this wiki locally