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
.
What is missing from his post?
My controller or application isn't namespaced. I was hoping to just be able to use that one package in one controller's action in a non-namespaced framework.
You can download the latest version from the CodeIgniter website, or you can use composer to automate the installation. The composer is a package management system for PHP. A composer can be used for: Install individual packages, Update existing packages remove installed packages.
To segment these third party libraries with your own libraries, CodeIgniter has brought a new segmented folder i.e. third party folder. So, if you are using CodeIgniter then you have to put that third party API libraries within the same library folder where you have kept or created your own application libraries.
For CodeIgniter 3.x and composer, it's suggested to just set $config['composer_autoload']
to TRUE
or a custom path in application/config/config.php
.
It seems that CI assumes the vendor
directory is within the application
directory. That wasn't my case. I did the following:
$config['composer_autoload'] = 'vendor/autoload.php';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With