[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/controller/ -> resourceclassloader.class.php (sommaire)

(pas de description)

Poids: 135 lignes (4 kb)
Inclus ou requis:0 fois
Référencé: 3 fois
Nécessite: 0 fichiers

Définit 1 class

ResourceClassLoader:: (5 méthodes):
  ResourceClassLoader()
  getLoader()
  addSearchFolder()
  setClassFileSuffix()
  load()


Classe: ResourceClassLoader  - X-Ref

\ingroup Controller

This class takes care of dynamically loading classes for the controller.

This is a very simple class that keeps a list of folders where action classes can be found. Whenever
the controller requests to load an action class, this loader will go one by one through all the folders
until the class is found, or it will fail if none can be found.

New folders to be scanned can be added via the static method ResourceClassLoader::addSearchFolder(),
and the loading of classes takes place in the ResourceClassLoader::load() method.

This object should never be instantiated directly but instead, please use the
ResourceClassLoader::getLoader() method which will return a reference to an already existing instance.
ResourceClassLoader( $path = "./", $classFileSuffix = DEFAULT_CLASSFILE_SUFFIX )   X-Ref
initializes the class loader. It is advisable to use the
static ResourceClassLoader::getLoader() method

param: path The starting path where classes can be loaded. It defaults to "./"
param: classFileSuffix default suffix that each class file will have. It defaults to

getLoader( $path = null )   X-Ref
static method that returns a single instance of this class.

param: path If the object is being created for the first time, this will be passed to the constructor
return: a ResourceClassLoader object

addSearchFolder( $folder )   X-Ref
Adds a new folder to the list of folders to be searched

param: folder The new folder that will be added
return: always true

setClassFileSuffix( $suffix )   X-Ref
sets a new suffix for class files, in case our class files do not end with .class.php. Please
note that only <b>one</b> suffix can be used at the same time.

param: suffix the new suffix
return: always true

load( $actionClassName )   X-Ref
Loads classes from disk using the list of folders that has been provided
via ResourceClassLoader::addSearchFolder() The class will go through all the folders where
classes can be located and if it can be found, it will proceed to load it.
If not, an exception will be thrown

param: actionClassName name of the class that we are going to load, <b>without the class suffix</b>
return: True if successful



Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics