Section A.23. PHP


A.23. PHP

Classes related to the PHP language itself

A.23.1. apd

Repository: PECL - License: PHP License - By George Schlossnagle (lead)

A full-featured engine-level profiler/debugger

A.23.1.1 Description

APD is a full-featured profiler/debugger that is loaded as a zend_extension. It aims to be an analog of C's gprof or Perl's Devel::DProf.

A.23.2. bcompiler

Repository: PECL - License: PHP - By Alan Knowles (lead)

A bytecode compiler for classes

A.23.2.1 Description

bcompiler enables you to encode your scripts in phpbytecode, enabling you to protect the source code.

bcompiler could be used in the following situations

  • to create a exe file of a PHP-GTK application (in conjunction with other software)

  • to create closed source libraries

  • to provide clients with time expired software (prior to payment)

  • to deliver close source applications

  • for use on embedded systems, where disk space is a priority.

For install instructions see the manual at pear.php.net

A.23.3. ffi

Repository: PECL - License: PHP - By Wez Furlong (lead) - Ilia Alshanetsky (developer)

Foreign Function Interface

A.23.3.1 Description

FFI is a multi-platform extension for PHP 5 that allows you to bind to functions from arbitrary shared libraries and call them.

A.23.4. Inline_C

Repository: PEAR - License: PHP License - By George Schlossnagle (lead)

Allows inline inclusion of function definitions in C

A.23.4.1 Description

The Inline_C class allows for inline inclusion of C code. This code can be compiled and loaded automatically. Resulting extensions are cached to speed future loads.

A.23.5. memcache

Repository: PECL - License: PHP License - By Antony Dovgal (lead)

memcached extension

A.23.5.1 Description

Memcached is a caching daemon designed especially for dynamic web applications to decrease database load by storing objects in memory.

This extension allows you to work with memcached through handy OO and procedural interfaces.

A.23.6. mono

Repository: PECL - License: PHP License - By Sterling Hughes (lead)

Allows you to access .NET assemblies from PHP

A.23.6.1 Description

A C extension that interfaces with the mono library to allow access to .NET assemblies.

A.23.7. perl

Repository: PECL - License: PHP - By Dmitry Stogov (lead)

Embedded Perl.

A.23.7.1 Description

This extension embeds Perl Interpreter into PHP. It allows execute Perl files, evaluate Perl code, access Perl variables and instantiate Perl objects.

A.23.8. PHPDoc

Repository: PEAR - License: PHP - By Ulf Wendel (lead) - Derick Rethans (lead)

Tool to generate documentation from the source

A.23.8.1 Description

PHPDoc is an attemt to adopt Javadoc to the PHP world.

A.23.9. PHPUnit

Repository: PEAR - License: PHP License - By Sebastian Bergmann (lead)

Regression testing framework for unit tests.

A.23.9.1 Description

PHPUnit is a regression testing framework used by the developer who implements unit tests in PHP. It is based upon JUnit, which can be found at http://www.junit.org/.

A.23.10. PHPUnit2

Repository: PEAR - License: PHP License - By Sebastian Bergmann (lead)

Regression testing framework for unit tests.

A.23.10.1 Description

PHPUnit is a regression testing framework used by the developer who implements unit tests in PHP. It is based upon JUnit, which can be found at http://www.junit.org/.

A.23.11. PHP_CompatInfo

Repository: PEAR - License: PHP License - By Davey Shafik (lead)

Find out the minimum version and the extensions required for a piece of code to run

A.23.11.1 Description

PHP_CompatInfo will parse a file/folder/script/array to find out the minimum version and extensions required for it to run. Features advanced debug output which shows which functions require which version and CLI output script

A.23.12. PHP_Fork

Repository: - License: PHP License -

PHP_Fork class. Wrapper around the pcntl_fork() stuff with a API set like Java language

A.23.12.1 Description

PHP_Fork class. Wrapper around the pcntl_fork() stuff with a API set like Java language. Practical usage is done by extending this class, and re-defining the run() method. [see basic example]

This way PHP developers can enclose logic into a class that extends PHP_Fork, then execute the start() method that forks a child process. Communications with the forked process is ensured by using a Shared Memory Segment; by using a user-defined signal and this shared memory developers can access to child process methods that returns a serializable variable.

The shared variable space can be accessed with the tho methods:

  • void setVariable($name, $value)

  • mixed getVariable($name)

$name must be a valid PHP variable name;

$value must be a variable or a serializable object.

Resources (db connections, streams, etc.) cannot be serialized and so they're not correctly handled.

Requires PHP build with --enable-cli --with-pcntl --enable-shmop.

Only runs on *NIX systems, because Windows lacks of the pcntl ext.

@example simple_controller.php shows how to attach a controller to started pseudo-threads.

@example exec_methods.php shows a workaround to execute methods into the child process.

@example passing_vars.php shows variable exchange between the parent process and started pseudo-threads.

@example basic.php a basic example, only two pseudo-threads that increment a counter simultaneously.

A.23.13. PHP_Parser

Repository: PEAR - License: PHP License - By Greg Beaver (lead) - Alan Knowles (developer)

A PHP Grammar Parser

A.23.13.1 Description

PHP_Parser is a source code analysis tool based around a real Parser generated by phpJay. The parser uses the same EBNF source that PHP uses to parse itself, and it therefore as robust as PHP itself. This version has full support for parsing out every re-usable element in PHP 5 as of beta 1:

  • classes

  • abstract classes

  • inheritance, implements

  • interfaces

  • methods

  • exception parsing directly from source

  • static variables declared

  • global and superglobal ($_GET) variables used

and declared

  • variables

  • constants

  • functions (same information as methods)

  • defines

  • global variables (with help of the Tokenizer Lexer)

  • superglobal variables used in global code

  • include statements

The output can be customized to return an array, return objects of user-specified classes, and can also be customized to publish each element as it is parsed, allowing hooks into parsing to catch information.

A.23.14. python

Repository: PECL - License: PHP - By Jon Parise (lead)

Embedded Python

A.23.14.1 Description

This extension allows the Python interpreter to be embedded inside of PHP, allowing for the instantiate and manipulation of Python objects from within PHP.

A.23.15. Validate

Repository: PEAR - License: PHP - By Tomas V.V.Cox (lead) - Pierre-Alain Joye (lead) - Stefan Neufeind (lead) - Tim Gallagher (contributor) - Brent Cook (contributor) - Dave Mertens (contributor)

Validation class

A.23.15.1 Description

Package to validate various datas. It includes :

  • numbers (min/max, decimal or not)

  • email (syntax, domain check)

  • string (predifined type alpha upper and/or lowercase, numeric,...)

  • date (min, max)

  • Credit cards

  • uri (RFC2396)

  • possibility valid multiple data with a single method call (::multiple)

  • Locale validation for AT, CH, DE, ES, FR, NL, PL, ptBR, UK, US

  • Finance (e.g. IBAN)

A.23.16. Var_Dump

Repository: - License: PHP License -

Provides methods for dumping structured information about a variable.

A.23.16.1 Description

The Var_Dump class is a wrapper for the var_dump function.

The var_dump function displays structured information about expressions that includes its type and value. Arrays are explored recursively with values indented to show structure.

The Var_Dump class captures the output of the var_dump function, by using output control functions, and then uses external renderer classes for displaying the result in various graphical ways :

  • Simple text,

  • (X)HTML text,

  • (X)HTML table,

  • XML,

  • ...

A.23.17. vld

Repository: PECL - License: BSD style By: Derick Rethans (lead)

Provides functionality to dump the internal representation of PHP scripts

A.23.17.1 Description

The Vulcan Logic Disassembler hooks into the Zend Engine and dumps all the opcodes (execution units) of a script.

A.23.18. Xdebug

Repository: PECL - License: BSD style By: Derick Rethans (lead)

Provides functions for function traces and profiling

A.23.18.1 Description

The Xdebug extension helps you debugging your script by providing a lot of valuable debug information. The debug information that Xdebug can provide includes the following:

  • stack and function traces in error messages with:

    • full parameter display for user defined functions

    • function name, file name and line indications

    • support for member functions

  • memory allocation

  • protection for infinite recursions

Xdebug also provides:

  • profiling information for PHP scripts

  • script execution analysis

  • capabilities to debug your scripts interactively with a debug client



    PHP 5 Power Programming
    PHP 5 Power Programming
    ISBN: 013147149X
    EAN: 2147483647
    Year: 2003
    Pages: 240

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