Provides helper functions for including classes and files dynamically so that Exceptions are thrown instead of PHP errors and warnings

package verysimple::IO
author Jason Hinkle
copyright 1997-2008 VerySimple, Inc.
license LGPL
version 1.0

 Methods

Handler for catching file-not-found errors and throwing an IncludeException

IncludeException($code, $string, $file, $line, $context) 

Parameters

$code

$string

$file

$line

$context

Includes a file with the given path. If PHP is unable to include the file, an IncludeException is thrown instead of a PHP warning

IncludeFile(string $path) 

Parameters

$path

string

path to file passed to the include_once statement

Ensures that a class is defined. If not, attempts to include the file using the provided path. If unable to locate the class, an IncludeException will be thrown. The path that will be used for include_once is $classpath . "/" . $classname . ".php"

RequireClass(string $classname, string $classpath) 

Parameters

$classname

string

name of class (ex Phreeze)

$classpath

string

or array [optional] the relative path(s) where the file would be found