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

Class: PHP_CompatInfo

Source Location: /CompatInfo.php

Class Overview


Check Compatibility of chunk of PHP code


Author(s):

Copyright:

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

Variables

Methods


Child classes:

PHP_CompatInfo_Cli
CLI Script to Check Compatibility of chunk of PHP code

Class Details

[line 51]
Check Compatibility of chunk of PHP code



Tags:

example:  Example on using using parseArray() to parse a script
example:  Example on how to parse a string
example:  Example of using PHP_CompatInfo_Cli
example:  Example on how to parse a directory
example:  Example on how to parse a file
copyright:  Copyright 2003 Davey Shafik and Synaptic Media. All Rights Reserved.
example:  Example that shows minimum version with Constants
author:  Davey Shafik <davey@php.net>


[ Top ]


Class Variables

$latest_version =  '4.0.0'

[line 57]



Tags:

var:  Earliest version of PHP to use

Type:   string


[ Top ]

$recurse_dir =  true

[line 63]



Tags:

var:  Toggle parseDir recursion

Type:   boolean


[ Top ]



Class Methods


method parseArray [line 246]

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

Parse an Array of Files

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




Tags:

access:  public


Parameters:

array   $files   Array of file names or code strings
array   $options   An array of options where: 'file_ext' Contains an array of file extensions to parse for PHP code. Default: php, php4, inc, phtml 'debug' contains a boolean to control whether extra ouput is shown. 'is_string' contains a boolean which says if the array values are strings or file names. 'ignore_files' contains an array of files to ignore. File names are case sensitive. 'ignore_functions' contains an array of functions to ignore when calculating the version needed.

[ Top ]

method parseDir [line 142]

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

Parse a directory recursively for its Compatibility info



Tags:

usedby:  PHP_CompatInfo::parseFolder()
access:  public
see:  PHP_CompatInfo::_fileList()


Parameters:

string   $dir   Path of folder to parse
array   $options   Array of user options where: 'file_ext' Contains an array of file extensions to parse for PHP code. Default: php, php4, inc, phtml 'recurse_dir' Boolean on whether to recursively find files 'debug' contains a boolean to control whether extra ouput is shown. 'ignore_files' contains an array of files to ignore. File names are case insensitive. 'ignore_dirs' contains an array of directories to ignore. Directory names are case insensitive. 'ignore_functions' contains an array of functions to ignore when calculating the version needed.

[ Top ]

method parseFile [line 80]

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

Parse a file for its Compatibility info



Tags:

access:  public


Parameters:

string   $file   Path of File to parse
array   $options   An array of options where: '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.

[ Top ]

method parseFolder [line 214]

void parseFolder( mixed $folder, [mixed $options = array()])

Alias of parseDir



Tags:

access:  public
uses:  PHP_CompatInfo::parseDir()


[ Top ]

method parseString [line 104]

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

Parse a string for its Compatibility info



Tags:

access:  public


Parameters:

string   $string   PHP Code to parses
array   $options   An array of options where: '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.

[ Top ]

method _fileList [line 458]

array _fileList( string $directory, mixed $options)

Retrieve a listing of every file in $directory and all subdirectories. Taken from PEAR_PackageFileManager_File



Tags:

return:  list of files in a directory
access:  private


Parameters:

string   $directory   full path to the directory you want the list of

[ Top ]

method _parseTokens [line 314]

array _parseTokens( array $tokens, mixed $options, boolean $debug)

Parse the given Tokens

The tokens are those returned by token_get_all() which is nicely wrapped in PHP_CompatInfo::_tokenize




Tags:

access:  private


Parameters:

array   $tokens   Array of PHP Tokens
boolean   $debug   Show Extra Output

[ Top ]

method _tokenize [line 436]

array _tokenize( string $input, [boolean $is_string = false])

Token a file or string



Tags:

access:  private


Parameters:

string   $input   Filename or PHP code
boolean   $is_string   Whether or note the input is a string

[ Top ]


Documentation generated on Sat, 05 Mar 2005 20:00:45 -0500 by phpDocumentor 1.3.0RC3