Gumbo_Interface_Load



Load Interface

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.

Author(s): Michael Luster <mluster79@yahoo.com>
License:New BSD License
Copyright:Copyright (c) 2007, iBayou, Michael Luster
Link:http://sourceforge.net/projects/phpgumbo
Version:0.0.1

Interface Methods

public string getDirCustom ( ) [line 123]

Returns the Custom directory


[ Top ]
public string getDirHome ( ) [line 117]

Returns the home directory


[ Top ]
public string getFullPath ( string $name, [string|array $dirs], [string $ext], [bool $stretch], [string $separator], [string $path], [string $remove] ) [line 139]

Returns a formatted file path. The parameters expect the same values as defined by Gumbo_Interface_Load_Setting.

Parameter(s):

  • (string) $name :: file name
  • (string|array) $dirs :: locations to search through (from path)
  • (string) $ext :: file extension (if null, uses the string from the last dot *.ext)
  • (bool) $stretch :: stretch the file name from the path directory
  • (string) $separator :: stretch separator character (typically "." or "_")
  • (string) $path :: path to start from (default: include) [include|home|absolute]
  • (string) $remove :: removes string pattern from the file name before file search

[ Top ]
public mix load ( string $name, [string $key], [bool $return_path] ) [line 65]

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.

Parameter(s):

  • (string) $name :: file name
  • (string) $key :: settings reference
  • (bool) $return_path :: returns the formatted path string

[ Top ]
public bool loadClass ( string $name, [string|array $dirs], [string $ext], [bool $stretch], [string $separator], [string $path], [string $remove] ) [line 82]

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.

Parameter(s):

  • (string) $name :: class name
  • (string|array) $dirs :: starting locations
  • (string) $ext :: class file extension (default: 'php')
  • (bool) $stretch :: stretch the class name as directories (default: false)
  • (string) $separator :: class name separator (default: "_")
  • (string) $path :: which path to search through (default: "include") [include|home|absolute]
  • (string) $remove :: removes string pattern from the class name when performing a file search

[ Top ]
public bool loadFile ( string $name, [string|array $dirs], [string $ext], [bool $once], [bool $use_include], [bool $stretch], [string $separator], [string $path], [string $remove] ) [line 98]

Loads a file into memory. The arguments expect the same values as defined by Gumbo_Interface_Load_Setting.

Parameter(s):

  • (string) $name :: class name
  • (string|array) $dirs :: locations to search through
  • (string) $ext :: file extension (default: 'php')
  • (bool) $once :: loads the file only once (default: false)
  • (bool) $use_include :: use include instead of require (default: false)
  • (bool) $stretch :: stretches the directory path based on the file name (default: false)
  • (string) $separator :: character separating the directory names inside the file name (default: "_")
  • (string) $path :: start path to the file (default: include) [include|home|absolute]
  • (string) $remove :: removes a string pattern from the file name when performing a file search

[ Top ]
public void setDirCustom ( string $loc ) [line 108]

Sets the Custom Class File location

Parameter(s):

  • (string) $loc
  • precondition:  is_dir ($loc)

[ Top ]