Source for file Load.class.php
Documentation is available at Load.class.php
* Gumbo Library Framework
* This library is being released under the terms of the New BSD License. A
* copy of the license is packaged with the software (LICENSE.txt). If no
* copy is found, a copy of the license template can be found at:
* http://www.opensource.org/licenses/bsd-license.php
* @copyright Copyright (c) 2007, iBayou, Michael Luster
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @author Michael Luster <mluster79@yahoo.com>
* @link http://sourceforge.net/projects/phpgumbo
* The Load Interface provides a way for the program to easily Load various files
* into memory. It also includes a file hunter method, which is responsible for
* searching for the existence of a file and returning the full path to the file.
* The Custom Path feature is used to indicate a custom directory to search through
* first. This directory should model the structure of the Home directory, but
* contains the files to load first. The custom directory should only hold files
* with modifications, not all orinigals. This allows the programmer to make modifications
* to source code without actually replacing the orinigal source. For example, if
* using the Gumbo Library, the custom directory will hold any changes the programmer
* makes to any of the class files. In the event the Gumbo Library has a new release,
* the source can be updated without losing any modifications made by the programmer. The
* programmer will be responsible for updating any modifications to the new version.
* @copyright Copyright (c) 2007, iBayou, Michael Luster
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @author Michael Luster <mluster79@yahoo.com>
* @link http://sourceforge.net/projects/phpgumbo
* Quick load of a file using a session key
* The method will require the file name and a Load Setting key reference.
* If no key is defined, or the key doesn't exist, the default
* settings will be used. The method is a quick wrapper to the Load_File method.
* The return_path parameter, if set, will return the full file path. This
* is useful for performing direct includes of various types of files.
* @param string $name file name
* @param string $key settings reference
* @param bool $return_path returns the formatted path string
public function load ($name, $key=
null, $return_path=
false);
* Loads a Class file into memory
* The load class will load a class file into memory only once. The arguments
* expect the same values as defined by the Gumbo_Interface_Load_Setting.
* @param string $name class name
* @param string|array$dirs starting locations
* @param string $ext class file extension (default: 'php')
* @param bool $stretch stretch the class name as directories (default: false)
* @param string $separator class name separator (default: "_")
* @param string $path which path to search through (default: "include") [include|home|absolute]
* @param string $remove removes string pattern from the class name when performing a file search
public function loadClass ($name, $dirs=
null, $ext=
null, $stretch=
false, $separator=
null, $path=
"include", $remove=
null);
* Loads a file into memory. The arguments expect the same values as defined
* by Gumbo_Interface_Load_Setting.
* @param string $name class name
* @param string|array$dirs locations to search through
* @param string $ext file extension (default: 'php')
* @param bool $once loads the file only once (default: false)
* @param bool $use_include use include instead of require (default: false)
* @param bool $stretch stretches the directory path based on the file name (default: false)
* @param string $separator character separating the directory names inside the file name (default: "_")
* @param string $path start path to the file (default: include) [include|home|absolute]
* @param string $remove removes a string pattern from the file name when performing a file search
public function loadFile ($name, $dirs=
null, $ext=
null, $once=
false, $use_include=
false, $stretch=
false, $separator=
null, $path=
null, $remove=
null);
* Sets the Custom Class File location
* @precondition is_dir ($loc)
* Returns the home directory
* Returns the Custom directory
* Returns a formatted file path. The parameters expect the same values as defined
* by Gumbo_Interface_Load_Setting.
* @param string $name file name
* @param string|array$dirs locations to search through (from path)
* @param string $ext file extension (if null, uses the string from the last dot *.ext)
* @param bool $stretch stretch the file name from the path directory
* @param string $separator stretch separator character (typically "." or "_")
* @param string $path path to start from (default: include) [include|home|absolute]
* @param string $remove removes string pattern from the file name before file search
public function getFullPath ($name, $dirs=
null, $ext=
null, $stretch=
false, $separator=
null, $path=
"include", $remove=
null);