.NODE

Appendix C. Extending and Embedding Cookbook

C Extending and Embedding Cookbook

LIKE A WELL APPOINTED KITCHEN, PHP OFFERS THE ENVIRONMENT and ingredients necessary to create any masterpiece that accomplished chefs puts their mind to. As anyone who has spent time over a stove knows, however, it's not enough to simply toss some ingredients into a blender at random and pop the resulting glop into the microwave. An enjoyable meal, much like a usable extension, requires a recipe. In the preceding chapters, you learned the basic skills you need to create some of these recipes from scratch, but there's no reason to start from square one on most tasks. This appendix offers some examples of common use code that you can reuse in your own extension or embedding projects.


Skeletons

The PHP Life Cycle

Variables from the Inside Out

Memory Management

Setting Up a Build Environment

Your First Extension

Returning Values

Accepting Parameters

Working with Arrays and HashTables

The Resource Data Type

PHP4 Objects

PHP5 Objects

Startup, Shutdown, and a Few Points in Between

INI Settings

Accessing Streams

Implementing Streams

Diverting the Stream

Configuration and Linking

Extension Generators

Setting Up a Host Environment

Advanced Embedding

Appendix A. A Zend API Reference

Appendix B. PHPAPI

Appendix C. Extending and Embedding Cookbook

Appendix D. Additional Resources





Extending and Embedding PHP
Extending and Embedding PHP
ISBN: 067232704X
EAN: 2147483647
Year: 2007
Pages: 175
Authors: Sara Golemon
Similar book on Amazon

Flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net