yii_man
(Vijayaraghuraman)
September 16, 2013, 4:13pm
1
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.
XavierJohn
(Xavierjohn)
September 16, 2013, 4:21pm
2
Will this work?
foreach (glob("classes/*.php") as $filename)
{
include $filename;
}
yii_man
(Vijayaraghuraman)
September 16, 2013, 4:50pm
3
Yes, it will work (I tried it already), but isn’t there a better way?
x2blue
(Ayaseen2009)
September 16, 2013, 9:30pm
4
Add your lib to vendor folder and include it in the controller.php.
x2blue
(Ayaseen2009)
September 16, 2013, 9:33pm
5
yii_man
(Vijayaraghuraman)
September 17, 2013, 1:53pm
6
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).