05.05.2013 Views

Programming PHP

Programming PHP

Programming PHP

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

int<br />

Integer/long<br />

long<br />

Same as int<br />

array<br />

An array<br />

float<br />

Floating point<br />

double<br />

Same as float<br />

object<br />

An object<br />

resource<br />

A <strong>PHP</strong> resource<br />

mixed<br />

Any of the above<br />

Let’s look at the basic structure of a <strong>PHP</strong> extension. Create one for yourself and follow<br />

along:<br />

% cd php4/ext<br />

% ./ext_skel --extname=rot13 --proto=rot13.def<br />

% cd rot13<br />

Running ext_skel like this creates the following files:<br />

config.m4<br />

The configuration rules<br />

CREDITS<br />

Put your extension name and your name here<br />

EXPERIMENTAL<br />

Indicates the extension is still experimental<br />

rot13.c<br />

The actual C code for the extension<br />

rot13.php<br />

The test script<br />

Makefile.in<br />

The makefile template for autoconf/automake<br />

php_rot13.h<br />

The C header file for the extension<br />

tests/<br />

The directory for regression tests<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2002 O’Reilly & Associates, Inc. All rights reserved.<br />

Building Your First Extensions | 321

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!