Advertisement
MONAROL

Simple Class AutoLoader

Aug 19th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.22 KB | None | 0 0
  1. function __autoload($className){
  2.     $file = str_replace('\\', '/', 'ROOTDIR OF PROJECT'.$className.'.php');
  3.     if(!file_exists($file)){
  4.         print 'Connot find class file in "'.$file.'"';
  5.         exit;
  6.     }else{
  7.         include $file;
  8.     }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement