|
<? Php
Class inload
{
/**
* The class is automatically loaded and does not need to be called by the developer.
*
* @ Param string $ class file
*/
Private function autoload ($ class)
{
If (empty ($ class ))
{
Throw new QException ('loading file does not exist'. $ class );
}
Else
{
Require _ SPRING _. '/_ Core/SpringMap. php'; // framework Map
If (! File_exists ($ source [$ class] ['file'])
{
Throw new QException ('loading file does not exist'. $ class );
}
Require $ source [$ class] ['file'];
}
}
/**
* Register or unregister an automatic class Loading Method
*
* For more information about this method, see Zend Framework.
*
* @ Param string $ class: class that provides automatic loading Service
* @ Param boolean $ enabled or disabled this service
*/
Private function registerAutoload ($ class = 'interpreter', $ enabled = true)
{
If (! Function_exists ('spl _ autoload_register '))
{
Throw new QException ('spl _ autoload does not have this PHP installation ');
}
If ($ enabled = true)
{
Spl_autoload_register (array ($ class, 'autoload '));
}
Else
{
Spl_autoload_unregister (array ($ class, 'autoload '));
}
}
/**
* Destructor
*/
Public function _ destruct ()
{
Self: registerAutoload ('interpreter', false );
}
|