Php class automatic loading method, php loading. Php class automatic loading method, php class automatic loading method phpclassinload {*** class automatic loading, the developer does not need to call the ** @ paramstring $ class file * privat php class automatic loading method. php loads
Php automatic loading method
<? Phpclass inload {/*** class automatically loaded. you do not need to call ** @ param string $ class file */private function autoload ($ class) by the developer) {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 ('file does not exist '. $ class) ;}require $ source [$ class] ['file'] ;}} /*** register or unregister an automatic class loading method ** for this method, refer to Zend Framework ** @ param string $ class to provide the class for automatic loading service * @ param boolean $ enabled or disable the 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 );}
The above is all the content of this article. I hope you will like it.
Http://www.bkjia.com/PHPjc/1011244.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1011244.htmlTechArticlephp class automatic loading method, php loaded php class automatic loading method phpclass inload {/*** class automatic loading, the developer does not need to call the ** @ param string $ class file */privat...