This loader loads files from the file system.
Sounds simple huh? The trick is that the files are loaded when needed, so that unnecessary include_once and require_once calls can be avoided.
The files are searched from the configured folder and an optional prefix and postfix might be added to the beginning of the file name.
Located in /Loaders/FileSystem.php (line 40)
The file extension to add to the requested file when searching in the file system for it.
This is by default php (the . will be added automatically) as that's the most common file search for. But one might also use this class to load .ini files for example.
The path to the direction from where the files will be searched from.
If this is not changed the file will be searched from the application's directory. I.e. the directory in which the file making the Ismo_Core_Application instance is located.
The postfix which will be appended to the end of the requested file when searching in the file system.
This should not include the extension nor the dot.
The prefix which will be added in front of the requested file when searching in the file system.
The constructor.
Returns the full path to a file from the configured path using possible set prefix, postfix and extension if it exists.
This method needs to be implemented
Loads, creates and returns an instance of the requested class.
Tries to load the class from the configured location in the file system and then creates and instance of the class.
Tries to open a file from the configured path using possible set prefix, postfix and extension.
Note It's the callers responsibility to close the returned file handle.
This method needs to be implemented
Sets the file extension to use.
Example:
- $loader = new Ismo_Core_Loaders_FileSystem();
- $loader->setExtension('ini');
Sets the path which controls in which directory in the file system the files are looked for.
Example:
- $loader = new Ismo_Core_Loaders_FileSystem();
- $loader->setPath('./states/');
- $loader = new Ismo_Core_Loaders_FileSystem();
- $loader->setPath('./configs/');
Sets the postfix.
Example:
- $loader = new Ismo_Core_Loaders_FileSystem();
- $loader->setPostfix('_MySpecialPostfix');
Sets the prefix.
Example:
- $loader = new Ismo_Core_Loaders_FileSystem();
- $loader->setPrefix('MySpecialPrefix_');
Documentation generated on Mon, 14 Jun 2004 11:59:19 +0200 by phpDocumentor 1.3.0RC3