Introduction to PHP Extensions
summary
Shows how a real geospatial PHP extension wraps a C implementation of the RDP/Douglas‑Peucker algorithm, with build files (config.m4, config.w32), phpize/configure/make steps and phpt tests; converting zvals with parse_parameters, manual memory management and module init/shutdown hooks. The C version runs Belgium simplification in 0.37s versus ~45s in PHP (>100× faster). Debugging uses gdb and Valgrind; the extension builds, passes tests, and frees memory when implemented correctly.
AI-written summary · about
chapters (37)
- 0:00Introduction
- 0:42Todays topic
- 1:13What are extensions
- 1:53Why write an extension
- 2:11Wrapping libraries
- 3:39Limitations
- 4:22Speed
- 4:49Time
- 7:06Map
- 7:37Polygons
- 7:58RaymerDouglasPecker
- 9:01C Extension
- 9:14Config Files
- 11:32Contract Files
- 12:48How to Build an Extension
- 13:41Header File
- 18:33General Information
- 22:46Parse Parameters
- 26:38Data Types
- 28:27Conversion
- 28:57GeoHash
- 31:29RTP Simplify
- 32:52PHP Return
- 35:40Return Macros
- 36:44Memory Management
- 37:37Tests
- 39:09Debugging Tools
- 40:33Any Questions
- 41:09Thank you
- 42:26PHP Extensions
- 47:00Global variables
- 48:10Exception hook
- 49:30Exception class
- 50:08Extensions API
- 51:34Publish
- 52:30Dependencies
- 54:10Conclusion








