Class Io

Description

Class to handle file and user io opperations

Located in /phpDocumentor/Io.inc (line 50)


	
			
Variable Summary
 false|array $ignore
Method Summary
 Io Io ()
 bool checkIgnore (string $file, string $path, array $ignore, [bool $ignore_no_ext = true], [bool $ignoresymlinks = false])
 array dirList ( $orig_directory, [bool $hidden = false], [bool $ignore_symlinks = false], string $directory)
 string displayHelpMsg ()
 mixed getAllFiles (string $file)
 void getBase (array $filelist)
 void getDirTree (string $dir, string $base_dir, [array $ignore = array()], [boolean $hidden = false], [boolean $ignoresymlinks = false])
 array getReadmeInstallChangelog (string $base, array $filelist)
 string getRegExpableSearchString (string $s)
 array getTutorials (array $filelist)
 boolean isIncludeable (string $filename)
 array parseArgv ()
 void readPhpFile (string $path, [ $quietMode = false])
 string|array removeNonMatches (array $dir, string $match)
 void _setupIgnore (array $ignore)
Variables
false|array $ignore (line 63)

Format: array(array(regexp-ready string to search for whole path,

regexp-ready string to search for basename of ignore strings),...)

mixed $phpDocOptions (line 57)

Holds all the options that are avaible to the cmd line interface

and to the different web interfaces

array $valid_booleans = array
(
'', ' ', 'on', 'y', 'yes', 'true', '1',
'off', 'n', 'no', 'false', '0'

)
(line 71)

A specific array of values that boolean-based arguments can understand, aided by the decideOnOrOff() helper method.

Use lowercase letters always, to simplify string comparisons

Methods
Constructor Io (line 87)

creates an array $this->phpDocOptions and sets program options in it.

Array is in the format of:

 [filename][tag][] = "f";
 [filename][tag][] = "-file";
 [filename][desc] "name of file to parse"

Io Io ()
checkIgnore (line 717)

Tell whether to ignore a file or a directory allows * and ? wildcards

bool checkIgnore (string $file, string $path, array $ignore, [bool $ignore_no_ext = true], [bool $ignoresymlinks = false])
  • string $file: just the file name of the file or directory, in the case of directories this is the last dir
  • string $path: the path to consider (should be checked by realpath() before, and may be relative)
  • array $ignore
  • bool $ignore_no_ext
  • bool $ignoresymlinks: Ignore symlinks?
dirList (line 377)
array dirList ( $orig_directory, [bool $hidden = false], [bool $ignore_symlinks = false], string $directory)
  • string $directory: full path to the directory you want the list of
  • bool $hidden: whether to list files that begin with . like .bash_history
  • bool $ignore_symlinks: whether to ignore symlinks
  • $orig_directory
displayHelpMsg (line 204)

create the help message for display on the command-line

  • return: a string containing a help message
string displayHelpMsg ()
getAllFiles (line 888)

Take a filename with wildcards and return all files that match the

wildcards

mixed getAllFiles (string $file)
  • string $file: a full path from the -f command-line parameter, with potential * and ? wildcards.
getBase (line 444)

Retrieve common directory (case-insensitive in windows)

takes the list of files, and returns the subdirectory they share in common, so in this list:

  1.  array(
  2.  "/dir1/dir2/subdir/dir3/filename.ext",
  3.  "/dir1/dir2/subdir/dir4/filename.ext",
  4.  "/dir1/dir2/mydir/dir5/filename.ext");

getBase will return "/dir1/dir2"

void getBase (array $filelist)
  • array $filelist: array of strings
getDirTree (line 564)
void getDirTree (string $dir, string $base_dir, [array $ignore = array()], [boolean $hidden = false], [boolean $ignoresymlinks = false])
  • string $dir: directory
  • string $base_dir: base directory
  • array $ignore: array of ignored items
  • boolean $hidden: the "hidden" flag
  • boolean $ignoresymlinks: the "ignoresymlinks" flag
getReadmeInstallChangelog (line 537)
  • return: array(filelist - README/INSTALL/CHANGELOG, README/INSTALL/CHANGELOG)
array getReadmeInstallChangelog (string $base, array $filelist)
getRegExpableSearchString (line 832)

Converts $s into a string that can be used with preg_match

string getRegExpableSearchString (string $s)
  • string $s: string with wildcards ? and *
getTutorials (line 493)

Retrieve tutorial subdirectories and their contents from the list of

files to parse

  • return: array(filelist - tutorials, tutorials)
array getTutorials (array $filelist)
  • array $filelist: array of paths (strings)
isIncludeable (line 245)

calls http://www.php.net/file_exists for each value in include_path,

then calls http://www.php.net/is_readable when it finds the file

boolean isIncludeable (string $filename)
  • string $filename
parseArgv (line 277)

Parses $_SERVER['argv'] and creates a setup array

  • return: a setup array
  • global: array $argv: command-line arguments
  • todo: replace with Console_* ?
array parseArgv ()
readPhpFile (line 648)

Reads a file and returns it as a string Does basic error checking

file extensions are set in phpdoc.inc

  • global: array $_phpDocumentor_cvsphpfile_exts: PHP File extensions, used to validate that $path is a PHP File
  • global: array $_phpDocumentor_phpfile_exts: PHP File extensions in a CVS repository, used to validate that $path is a PHP File
void readPhpFile (string $path, [ $quietMode = false])
  • string $path
  • $quietMode
removeNonMatches (line 859)

Removes files from the $dir array that do not match the search string in

$match

string|array removeNonMatches (array $dir, string $match)
  • array $dir: array of filenames (full path)
  • string $match: search string with wildcards
_setupIgnore (line 796)

Construct the $ignore array

void _setupIgnore (array $ignore)
  • array $ignore: strings of files/paths/wildcards to ignore

Documentation generated on Mon, 05 Dec 2011 21:06:10 -0600 by phpDocumentor 1.4.4