How to use composer packages in codeigniter?

后端 未结 7 1712
逝去的感伤
逝去的感伤 2020-12-02 17:38

I\'ve followed this article: http://philsturgeon.co.uk/blog/2012/05/composer-with-codeigniter

But I get Fatal error: Class \'Buzz\\Browser\' not found.<

7条回答
  •  被撕碎了的回忆
    2020-12-02 18:25

    I'm using Kenjis codeigniter composer package, and it puts the vendor directory off of the root. Since there is no predefined constant (that I know of) for the root, I used the following:

    $root = getcwd();
    $config['composer_autoload'] = "$root/vendor/autoload.php";
    

提交回复
热议问题