I have the following folder structure in my project:
Withinapp
Ihavethefollowingstructure:
Andthefollowingnativefunctionofphp
togiveautoloadinclasses:
<?phprequire_once'/app/config.php';function__autoload($class_name){$folders=array('class',);foreach($foldersas$folders_files){$path=ROOT.'app'.SEPARATOR.$folders_files.SEPARATOR.$class_name.'.php';var_dump($path);if(file_exists($path)){require_once$path;}else{die('Filenotfound:'.$path);}}}
I'dliketoknowhowtoignorethetwitteroauthfolderandtheclasseswithinit.Isitpossible?
UPDATE
Itriedwithspl_autoload_register();
andgotthesameerror:
Filenotfoundin:C:\wamp64\www\twitter-login\app\class\OAuthException.php
<?phpfunctionautoload($class_name){$folders=array('class',);foreach($foldersas$folders_files){$path=ROOT.'app'.SEPARATOR.$folders_files.SEPARATOR.$class_name.'.php';if(file_exists($path)){require_once$path;}else{die('Filenotfoundin:'.$path);}}}spl_autoload_register("autoload");