How To Include Third Party Files With "inc" Extensions?

I’ve this third party library - phpdocx

All their files are "inc" files - I put the folder inside /components/thirdparty/phpdocx

How do I include these files in my Yii project?

Short of including each and every file with a require_once, it doesn’t work. There are dozens of files to include.

Will this work?

foreach (glob("classes/*.php") as $filename)


    include $filename;


Yes, it will work (I tried it already), but isn’t there a better way?

Add your lib to vendor folder and include it in the controller.php.

Check this

Yup, that is the first thing I tried.

It didn’t work. It works separately, from a stand alone PHP script. But not within Yii. All of these files are .inc files, not .php files (well, they are php files, they are just named with the extension .inc).