Source for file fof.php
Documentation is available at fof.php
* @package FrameworkOnFramework
* @copyright Copyright (c)2010-2012 Nicholas K. Dionysopoulos
* @license GNU General Public License version 2, or later
* The main class autoloader for FOF itself
* @package FrameworkOnFramework
* An instance of this autoloader
public static $autoloader =
null;
* The path to the FOF root directory
public static $fofPath =
null;
* Initialise this autoloader
* @return FOFAutoloaderFof
public static function init()
if (self::$autoloader ==
null)
self::$autoloader =
new self;
return self::$autoloader;
* Public constructor. Registers the autoloader with PHP.
self::$fofPath =
realpath(__DIR__ .
'/../');
* @param string $class_name The name of the class to load
// Make sure the class has a FOF prefix
if (substr($class_name, 0, 3) !=
'FOF')
$class =
substr($class_name, 3);
// Change from camel cased (e.g. ViewHtml) into a lowercase array (e.g. 'view','html')
// First try finding in structured directory format (preferred)
$path =
self::$fofPath .
'/' .
implode('/', $class) .
'.php';
// Then try the duplicate last name structured directory format (not recommended)
$path =
self::$fofPath .
'/' .
implode('/', $class) .
'/' .
$lastPart .
'.php';
// If it still fails, try looking in the legacy folder (used for backwards compatibility)
$path =
self::$fofPath .
'/legacy/' .
implode('/', $class) .
'.php';
Documentation generated on Tue, 19 Nov 2013 15:03:24 +0100 by phpDocumentor 1.4.3