thephpleague / html-to-markdown

Convert HTML to Markdown with PHP
MIT License
1.77k stars 205 forks source link

Autoloader not defined #167

Closed andreamoro closed 5 years ago

andreamoro commented 5 years ago

Appreciate this is not a "real" issue, but having used in the past the v. 2.8.x that was all in one file, I now struggle to update to the most recent version not being able to use composer.

Any chance to add the __autoload method in each files or as in a general routine so to save the hassle to everybody willing to play with the class quickly?

colinodell commented 5 years ago

Unfortunately, Composer is the only supported installation method (#95). We do not have any plans to create a dedicated autoload file for non-Composer installations.

In my personal experience, it should be possible to use Composer to install libraries like this into legacy projects. You may need to customize things like where the vendor dir is placed, or update your code to use spl_autoload_register instead of __autoload to support multiple autoloaders, but it should be doable. I'd be more than happy to offer any further advice on making that change so you can successfully use Composer with your project - just let me know! :smiley:

andreamoro commented 5 years ago

Well, i need this for an export exercise that one finished it will thrown away. Anything easier I can do?

colinodell commented 5 years ago

Using an autoloader would be the easiest approach. Otherwise, you could try a workaround like running require_once for all files in this library (maybe even automate that with some additional PHP?)