Extensions design¶
In this chapter you’ll learn how to design PHP extensions. You’ll learn about the PHP lifecycle, how and when to manage memory, the different hooks you can use or the different function pointers you can replace to actively change PHP’s internal machinery. You’ll design PHP functions and classes to provide them through your extension, and you’ll play with INI settings.
Contents:
- Learning the PHP lifecycle
- A look into a PHP extension and extension skeleton
- Registering and using PHP functions
- Managing global state
- Publishing extension information
- Hooks provided by PHP
- Hooking into the execution of functions
- Overwriting an Internal Function
- Modifying the Abstract Syntax Tree (AST)
- Hooking into Script/File Compilation
- Notification when Error Handler is called
- Notification when Exception is thrown
- Hooking into eval()
- Hooking into the Garbage Collector
- Overwrite Interrupt Handler
- Replacing Opcode Handlers
- Declaring and using INI settings
- Zend Extensions