[Pseudo] automatic class loading

Source: Internet
Author: User
The class used to automatically load the PPPHP *** load the class library *** will first load the class * @ paramstr $ lib class name * @ paramstr $ dirlikeCorelib * @ returnobj * protectedfunctionb ($ lib) in the lib of the project directory) {$ systempathCORE. lib. $ lib .. class. php; $ apppathAPP. lib. $ lib

The class used to automatically load the PPPHP/*** load the class library *** will first load the class * @ param str $ lib class name * @ param str $ dir like/Core/lib/ * @ return obj */protected function B ($ lib) {$ systempath = CORE. '/lib /'. $ lib. '. class. php'; $ apppath = APP. '/lib /'. $ lib

Used to automatically load PPPHP
/* ** Loading the class library * @ param str $ lib class name * @ param str $ dir like/Core/lib/* @ return obj * /protected function B ($ lib) {$ systempath = CORE. '/lib /'. $ lib. '. class. php'; $ apppath = APP. '/lib /'. $ lib. '. class. php '; // introduce libif (file_exists ($ apppath) {include_once $ apppath;} else {if (file_exists ($ systempath) {include_once $ systempath ;} else {show_error ('library '. $ lib. 'nonexistent') ;}$ lib = new $ lib (); return $ lib; // returns OBJ}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.