PHP_CompatInfo
[ class tree: PHP_CompatInfo ] [ index: PHP_CompatInfo ] [ all elements ]

Class: PHP_CompatInfo

Source Location: /PHP_CompatInfo-1.9.0a1/CompatInfo.php

Class Overview


Check Compatibility of chunk of PHP code


Author(s):

Version:

  • Release: 1.9.0a1

Copyright:

  • 2003 Davey Shafik and Synaptic Media. All Rights Reserved.

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 62]
Check Compatibility of chunk of PHP code

This class is the controller in the MVC design pattern of API 1.8.0 (since beta 2)



[ Top ]


Class Variables

$parser =

[line 71]

Instance of the parser (model in MVC desing pattern)
  • Since: 1.8.0b2
  • Access: protected

Type:   object


[ Top ]



Method Detail

__construct (Constructor)   [line 98]

PHP_CompatInfo __construct( [string $render = 'array'], [array $conf = array()])

Class constructor (ZE2) for PHP5+
  • Since: version 1.8.0b2 (2008-06-03)
  • Access: public

Parameters:

string   $render   —  (optional) Type of renderer to show results
array   $conf   —  (optional) A hash containing any additional configuration a renderer may use

[ Top ]

PHP_CompatInfo (Constructor)   [line 83]

PHP_CompatInfo PHP_CompatInfo( [string $render = 'array'], [array $conf = array()])

Class constructor (ZE1) for PHP4
  • Since: version 1.8.0b2 (2008-06-03)
  • Access: public

Parameters:

string   $render   —  (optional) Type of renderer to show results
array   $conf   —  (optional) A hash containing any additional configuration a renderer may use

[ Top ]

addListener   [line 116]

void addListener( mixed $callback, [string $nName = EVENT_DISPATCHER_GLOBAL])

Registers a new listener

Registers a new listener with the given criteria.

  • Since: version 1.8.0b3 (2008-06-07)
  • Access: public

Parameters:

mixed   $callback   —  A PHP callback
string   $nName   —  (optional) Expected notification name

[ Top ]

loadVersion   [line 155]

array loadVersion( string $min, [string|boolean $max = false], [boolean $include_const = false], [boolean $groupby_vers = false])

Load components list

Load components list for a PHP version or subset

  • Return: An array of php function/constant names history
  • Since: version 1.2.0 (2006-08-23)
  • Access: public

Parameters:

string   $min   —  PHP minimal version
string|boolean   $max   —  (optional) PHP maximal version
boolean   $include_const   —  (optional) include constants list in final result
boolean   $groupby_vers   —  (optional) give initial php version of function or constant

[ Top ]

parseArray   [line 233]

array parseArray( array $array, [array $options = array()])

Parse an Array of Files or Strings

You can parse an array of Files or Strings, to parse strings, $options['is_string'] must be set to true.

This recommandation is no more valid since version 1.8.0b2 Array my contains multiple and mixed origin (file, dir, string).


Parameters:

array   $array   —  Array of data sources
array   $options   —  Parser options (see parseData() method for details)

[ Top ]

parseData   [line 211]

array parseData( mixed $data, [array $options = array()])

Parse a data source

Parse a data source with auto detect ability. This data source, may be one of these follows: a directory, a file, a string (chunk of code), an array of multiple origin.

Each of five parsing functions support common and specifics options.

* Common options :

  • 'debug' Contains a boolean to control whether extra ouput is shown.
  • 'ignore_functions' Contains an array of functions to ignore when calculating the version needed.
  • 'ignore_constants' Contains an array of constants to ignore when calculating the version needed.
  • 'ignore_extensions' Contains an array of php extensions to ignore when calculating the version needed.
  • 'ignore_versions' Contains an array of php versions to ignore when calculating the version needed.
  • 'ignore_functions_match' Contains an array of function patterns to ignore when calculating the version needed.
  • 'ignore_extensions_match' Contains an array of extension patterns to ignore when calculating the version needed.
  • 'ignore_constants_match' Contains an array of constant patterns to ignore when calculating the version needed.
* parseArray, parseDir|parseFolder, specific options :
  • 'file_ext' Contains an array of file extensions to parse for PHP code. Default: php, php4, inc, phtml
  • 'ignore_files' Contains an array of files to ignore. File names are case insensitive.
* parseArray specific options :
  • 'is_string' Contains a boolean which says if the array values are strings or file names.
* parseDir|parseFolder specific options :
  • 'recurse_dir' Boolean on whether to recursively find files
  • 'ignore_dirs' Contains an array of directories to ignore. Directory names are case insensitive.


Parameters:

mixed   $data   —  Data source (may be file, dir, string, or array)
array   $options   —  An array of options. See above.

[ Top ]

parseDir   [line 287]

array parseDir( string $dir, [array $options = array()])

Parse a directory

Parse a directory recursively for its compatibility info


Parameters:

string   $dir   —  Path of folder to parse
array   $options   —  Parser options (see parseData() method for details)

[ Top ]

parseFile   [line 269]

array parseFile( string $file, [array $options = array()])

Parse a single file

Parse a file for its compatibility info


Parameters:

string   $file   —  Path of File to parse
array   $options   —  Parser options (see parseData() method for details)

[ Top ]

parseFolder   [line 305]

array parseFolder( string $folder, [array $options = array()])

Alias of parseDir

Alias of parseDir function


Parameters:

string   $folder   —  Path of folder to parse
array   $options   —  Parser options (see parseData() method for details)

[ Top ]

parseString   [line 251]

array parseString( string $string, [array $options = array()])

Parse a string

Parse a string for its compatibility info


Parameters:

string   $string   —  PHP Code to parse
array   $options   —  Parser options (see parseData() method for details)

[ Top ]

removeListener   [line 133]

bool removeListener( mixed $callback, [string $nName = EVENT_DISPATCHER_GLOBAL])

Removes a registered listener

Removes a registered listener that correspond to the given criteria.

  • Return: True if listener was removed, false otherwise.
  • Since: version 1.8.0b3 (2008-06-07)
  • Access: public

Parameters:

mixed   $callback   —  A PHP callback
string   $nName   —  (optional) Expected notification name

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:26:33 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.