Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End spl_autoload_register custom classes and PECL installed extensions

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #195390
    fooman
    Participant

    Hi!
    I watched a video on the ol’ YouTube and someone described why to use PHP’s ability to autload classes.

    So I have the following in an init file:

    spl_autoload_register(function($class){
        include 'classes/'.$class.'.php';
    });
    

    It loads my classes just fine. But when I went to use finfo_open(), for example, I got the error that the file was not found because it attempted to look in my ‘classes’ folder.
    Am I incorrectly using the autoload function? If not, how do I allow installed extensions to be included without issue?

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.