Welcome Guest, Not a member yet? Register   Sign In
Help with Composer and CodeIgniter
#1

Hello Everyone!

Has anybody used the Composer dependency manager with CodeIgniter? I need some help as to how to get started using them together. I'm particularly curious whether Composer will corrupt my CodeIgniter installation or not?

Any advice on how to get started using these together will be greatly appreciated! Thank you.
Reply
#2

Composer and CodeIgniter should play quite well together. In fact, if you look at your application/config/config.php file, you should see this:
PHP Code:
/*
|--------------------------------------------------------------------------
| Composer auto-loading
|--------------------------------------------------------------------------
|
| Enabling this setting will tell CodeIgniter to look for a Composer
| package auto-loader script in application/vendor/autoload.php.
|
|    $config['composer_autoload'] = TRUE;
|
| Or if you have your vendor/ directory located somewhere else, you
| can opt to set a specific path as well:
|
|    $config['composer_autoload'] = '/path/to/vendor/autoload.php';
|
| For more information about Composer, please visit http://getcomposer.org/
|
| Note: This will NOT disable or override the CodeIgniter-specific
|    autoloading (application/config/autoload.php)
*/
$config['composer_autoload'] = TRUE
There's also another post in this very forum talking about this. You might try searching the forum before posting next time.

One of the post summarizes things pretty nicely:
Quote:Create a composer.json file in your application folder
Run Composer install to install the packages you need
Use the packages in your code. If you did set the $config['composer_autoload'] to TRUE, they are all loaded and ready to use.
Reply
#3

I recommend my CodeIgniter Composer Installer if you like:
https://github.com/kenjis/codeigniter-co...-installer
Reply




Theme © iAndrew 2016 - Forum software by © MyBB