• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.