PhpToolCase
Api Documentation Version 0.9.2
PtcHandyMan Class Reference

Static Public Member Functions

static addDir ($path)
 Alias of addDirs() More...
 
static addFile ($file)
 Alias of addFiles() More...
 
static addSeparator ($sep)
 Alias of addSeparator() More...
 
static addConvention ($conventions)
 Alias of addConventions() More...
 
static addAppPath ($path)
 Alias of addAppPaths() More...
 
static getAppPath ($type=null)
 Alias of getAppPaths() More...
 
static addDirs ($paths)
 Adds path(s) to the PtcHandyMan::$_dirs property to load classes when needed. More...
 
static addFiles ($files)
 Adds class file(s) to the autoloader. More...
 
static register ($addThisPath=true, $useHelpers=true, $registerAutoLoader=true)
 Registers the autoloader to load classes when needed. More...
 
static getSeparators ()
 Retrieves the separators used by the autoloader. More...
 
static getConventions ()
 Retrieves the naming conventions used by the autoloader. More...
 
static addSeparators ($sep)
 Adds a separator to the PtcHandyMan::$_separators property for the autoloader. More...
 
static addConventions ($conventions)
 Adds naming convention(s) to the PtcHandyMan::$_namingConventions property for the autoloader. More...
 
static getDirs ($type=null)
 Returns the current included paths for the autoloader. More...
 
static getAppPaths ($name=null)
 Helper method to retrieve paths for the application. More...
 
static addAppPaths ($paths)
 Adds paths to the PtcHandyMan::$_appPaths property for later usage. More...
 
static getProperty ($object, $propertyName)
 Retrieves inaccessible properties from a class or object. More...
 
static load ($class)
 Load classes automatically with namespaces support based on folder structure. More...
 

Static Protected Member Functions

static _loadClass ($class, $path, $namespace=null)
 Classes autoloader engine, tries various possibilities for file names. More...
 
static _guessFileName ($class, $path, $namespace=null)
 Tries to guess the filename to load based on the naming conventions and the separator properties. More...
 
static _buildAppPaths ()
 Builds application paths for the first time when PtcHandyMan::getAppPath( ) is called. More...
 
static _addDirectory ($directory)
 Adds a directory to the PtcHandyMan::$_dirs array to autoload classes. More...
 
static _addNamespaceDirectory ($namespace, $directory)
 Adds a directory to the PtcHandyMan::$_dirs array to load classes that use namespaces. More...
 
static _debug ($string, $statement=null, $category=null)
 Send messsages to the PtcDebug class if present. More...
 

Static Protected Attributes

static $_dirs = array()
 Paths for directories to autoload classes. More...
 
static $_separators = array( )
 Separators for naming conventions. More...
 
static $_namingConventions = array( )
 Naming conventions to attempt to load with the autoloader. More...
 
static $_appPaths = array( )
 Application paths property. More...
 

Member Function Documentation

static _addDirectory (   $directory)
staticprotected

Adds a directory to the PtcHandyMan::$_dirs array to autoload classes.

Parameters
string$directorythe full path to the directory
Returns
false if directory is already present, true otherwise

Definition at line 404 of file PtcHm.php.

static _addNamespaceDirectory (   $namespace,
  $directory 
)
staticprotected

Adds a directory to the PtcHandyMan::$_dirs array to load classes that use namespaces.

Parameters
string$namespacethe namespace for the path toa utoload classes
string$directorythe full path to the directory
Returns
true if directory is not present, triggers an error otherwise

Definition at line 420 of file PtcHm.php.

static _buildAppPaths ( )
staticprotected

Builds application paths for the first time when PtcHandyMan::getAppPath( ) is called.

Definition at line 391 of file PtcHm.php.

static _debug (   $string,
  $statement = null,
  $category = null 
)
staticprotected

Send messsages to the PtcDebug class if present.

Parameters
mixed$stringthe string to pass
mixed$statementsome statement if required
string$categorya category for the messages panel

Definition at line 436 of file PtcHm.php.

static _guessFileName (   $class,
  $path,
  $namespace = null 
)
staticprotected

Tries to guess the filename to load based on the naming conventions and the separator properties.

Parameters
string$classthe class name without namespaces
string$paththe full path to the file
string$namespacethe class name with namespace if present
Returns
true if a file is found, false otherwise

Definition at line 343 of file PtcHm.php.

static _loadClass (   $class,
  $path,
  $namespace = null 
)
staticprotected

Classes autoloader engine, tries various possibilities for file names.

Parameters
string$classthe class name without namespaces
string$paththe full path to the file
string$namespacethe class name with namespace if present
Returns
true if a file is found, false otherwise

Definition at line 315 of file PtcHm.php.

static addAppPath (   $path)
static

Alias of addAppPaths()

Definition at line 37 of file PtcHm.php.

static addAppPaths (   $paths)
static

Adds paths to the PtcHandyMan::$_appPaths property for later usage.

See Adding Paths

Parameters
array$pathsarray of paths to add

Definition at line 201 of file PtcHm.php.

static addConvention (   $conventions)
static

Alias of addConventions()

Definition at line 30 of file PtcHm.php.

static addConventions (   $conventions)
static

Adds naming convention(s) to the PtcHandyMan::$_namingConventions property for the autoloader.

See Using Separators

Parameters
array | string$conventionsthe naming convention(s) to be added

Definition at line 151 of file PtcHm.php.

static addDir (   $path)
static

Alias of addDirs()

Definition at line 18 of file PtcHm.php.

static addDirs (   $paths)
static

Adds path(s) to the PtcHandyMan::$_dirs property to load classes when needed.

See Adding Directories and Adding Namespace Directories

Parameters
string | array$pathsfull path(s) to directories with classes

Definition at line 47 of file PtcHm.php.

static addFile (   $file)
static

Alias of addFiles()

Definition at line 22 of file PtcHm.php.

static addFiles (   $files)
static

Adds class file(s) to the autoloader.

See Adding Files

Parameters
string$filesfull path of the class file

Definition at line 74 of file PtcHm.php.

static addSeparator (   $sep)
static

Alias of addSeparator()

Definition at line 26 of file PtcHm.php.

static addSeparators (   $sep)
static

Adds a separator to the PtcHandyMan::$_separators property for the autoloader.

See Using Separators

Parameters
array | string$septhe separator(s) to be added

Definition at line 133 of file PtcHm.php.

static getAppPath (   $type = null)
static

Alias of getAppPaths()

Definition at line 41 of file PtcHm.php.

static getAppPaths (   $name = null)
static

Helper method to retrieve paths for the application.

See Retrieving Added Paths

Parameters
string$namethe path to return stored in the PtcHandyMan::$_appPaths property
Returns
the PtcHandyMan::$_appPaths property based on the $name argument

Definition at line 186 of file PtcHm.php.

static getConventions ( )
static

Retrieves the naming conventions used by the autoloader.

Definition at line 127 of file PtcHm.php.

static getDirs (   $type = null)
static

Returns the current included paths for the autoloader.

See Retrieving Autoloader Directories

Parameters
string$typedirectories , ns , files
Returns
the PtcHandyMan::$_dirs property based on the $type argument

Definition at line 169 of file PtcHm.php.

static getProperty (   $object,
  $propertyName 
)
static

Retrieves inaccessible properties from a class or object.

See Reading Inaccessible Properties

Parameters
mixed$objectthe name of the class or the initialized object
string$propertyNamethe name of the property
Returns
the value of the property if found.

Definition at line 222 of file PtcHm.php.

static getSeparators ( )
static

Retrieves the separators used by the autoloader.

Definition at line 123 of file PtcHm.php.

static load (   $class)
static

Load classes automatically with namespaces support based on folder structure.

See Pointing The Autoloader To Files

Parameters
string$classthe name of the class to autoload
Returns
true if a file has been loaded, false otherwise.

Definition at line 251 of file PtcHm.php.

static register (   $addThisPath = true,
  $useHelpers = true,
  $registerAutoLoader = true 
)
static

Registers the autoloader to load classes when needed.

See Getting Started

Parameters
bool$addThisPathadds the path where the class resides as a directory
bool$useHelpersload the ptc-helpers.php file if found, and registers the event class
bool$registerAutoLoaderregisters the load method with the spl utilities

Definition at line 103 of file PtcHm.php.

Field Documentation

$_appPaths = array( )
staticprotected

Application paths property.

Definition at line 307 of file PtcHm.php.

$_dirs = array()
staticprotected

Paths for directories to autoload classes.

Definition at line 295 of file PtcHm.php.

$_namingConventions = array( )
staticprotected

Naming conventions to attempt to load with the autoloader.

Definition at line 303 of file PtcHm.php.

$_separators = array( )
staticprotected

Separators for naming conventions.

Definition at line 299 of file PtcHm.php.


The documentation for this class was generated from the following file: