Your SlideShare is downloading. ×
0
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
PHP Composer Basics
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

PHP Composer Basics

145

Published on

Explains basic of Composer (PHP).

Explains basic of Composer (PHP).

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
145
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Let Composer Do It Slides' Link: http://j.mp/composersyl
  • 2. Me? Muhammad Usman Work mostly with PHP Accounting Graduate Live in Kalighat, Sylhet, Bangladesh. http://usman.it
  • 3. Work for Vegan Cuts http://VeganCuts.com
  • 4. Working on a SAAS for Vegan Cuts too http://CreateAudience.com
  • 5. Open Source ( )http://GitHub.com/usmanhalalit
  • 6. What is Composer? Composer is a dependency manager for PHP. You use many PHP libraries in your project, right? These are your project's dependencies. Bundler is for ruby, npm is for node.js, Composer is for PHP.
  • 7. Didn't understand? No problem, all do have problems understanding for the first time, including me.
  • 8. How would I explain Composer to my wife? You're going to cook delicious Biryani. So you need rice, spices, onions, ...? These are dependencies of Biryani. You want me to buy and manage these dependencies for you? So now you can just call these dependencies when needed. Congrats! I am your Composer.
  • 9. Theory behind package managers Lets not always reinvent the wheel. I depend on you, someone else depends on me and the nesting goes further. We can use bits and pieces.
  • 10. Enough with theories.
  • 11. Installation (requires Git mostly) https://getcomposer.org/ *nix curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer Windows Download and run and set up your PATH so that you can just call composer from any directory in your command line. https://getcomposer.org/Composer-Setup.exe
  • 12. Packagist https://packagist.org/ The store for Biryani materials :D Search for packages/libraries. Select the version you want.
  • 13. Install a package (go to your project root) composer require monolog/monolog Basic composer.json file Update or install dependencies composer update
  • 14. The vendor directory
  • 15. autoload.php require 'vendor/autoload.php'; All library files are loaded*, they can be used now. Performance issues? Nope. *Files are lazy loaded.
  • 16. You can use autoload for you own classes/files PSR-4 autoload Classmap autoload. Files autoload
  • 17. Exhausted?
  • 18. Your questions please! Peace! Slides Link: http://j.mp/composersyl

×