Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define custom autoloader in composer?

I am using Nette Framework which uses its own autoloader. How can I define custom autoloader or just exclude the standard one from composer so I can use my own?

like image 754
Peter Krejci Avatar asked Oct 08 '12 11:10

Peter Krejci


1 Answers

Alternatively, if you want an additional autoloader, you can update composer.json with:

{
    "autoload": {
        "files": ["src/extra/autoloader.php"]
    }
}

Then run composer dump-autoload to rebuild it. Now when you include vendor/autoload.php it will also load your autoloader.

like image 158
mpen Avatar answered Oct 05 '22 12:10

mpen