using composer with wordpress
DESCRIPTION
Composer is a command line dependency management tool designed for PHP. Come learn how Composer can help you: - Simplify new project creation - Minimize duplication of code in your project repositories - Quickly install and update plugins and themes in bulk - Manage versioning within your project - Follow best practices when managing code for your projects http://wpscholar.com/wcraleigh2014TRANSCRIPT
![Page 1: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/1.jpg)
Using Composer with WordPress
Micah Wood @wpscholar
wpscholar.com/wcraleigh2014
![Page 2: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/2.jpg)
What is ?
![Page 3: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/3.jpg)
Manages Dependencies
![Page 4: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/4.jpg)
Manages Project Dependencies
![Page 5: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/5.jpg)
Manages Project Dependencies and Versions
![Page 6: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/6.jpg)
Simplifies reusing and sharing of code
![Page 7: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/7.jpg)
Why Use Composer?
![Page 8: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/8.jpg)
Automatic Package Installation
![Page 9: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/9.jpg)
Consistent !Versioning
![Page 10: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/10.jpg)
Bulk Package Updates
![Page 11: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/11.jpg)
Class and File Autoloading
![Page 12: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/12.jpg)
Documentation of Dependencies
![Page 13: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/13.jpg)
Recursive Dependencies
![Page 14: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/14.jpg)
Eliminates !Duplication
![Page 15: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/15.jpg)
Package !Discovery
![Page 16: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/16.jpg)
Installing Composer
![Page 17: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/17.jpg)
Local Install!$ curl -sS https://getcomposer.org/installer | php !
Make install global!$ mv composer.phar /usr/local/bin/composer
![Page 18: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/18.jpg)
$ composer diagnoseCheck system for common errors
![Page 19: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/19.jpg)
How Composer Works
![Page 20: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/20.jpg)
composer.jsonHow you declare your dependencies
![Page 21: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/21.jpg)
composer.lockHow Composer stores
your dependencies
![Page 22: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/22.jpg)
vendor directoryWhere composer installs your packages
![Page 23: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/23.jpg)
Specifying Versions
![Page 24: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/24.jpg)
Exact Version 1.0.2
![Page 25: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/25.jpg)
Range of Versions >=1.0,<2.0
![Page 26: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/26.jpg)
Wildcard Version 1.0.*
![Page 27: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/27.jpg)
Next Significant Release Version ~1.2
![Page 29: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/29.jpg)
2.3.1Increment when you make breaking changes
Major Version
![Page 30: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/30.jpg)
2.3.1Increment when you add backwards compatible features
Minor Version
![Page 31: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/31.jpg)
2.3.1Increment when you make backwards compatible bug fixes
Patch Version
![Page 32: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/32.jpg)
Using Composer
![Page 33: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/33.jpg)
$ composer initCreate a new composer.json file
![Page 34: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/34.jpg)
$ composer validateValidate your composer.json file
![Page 35: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/35.jpg)
$ composer installDownloads and installs all dependencies
![Page 36: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/36.jpg)
$ composer updateChecks for and installs package updates
![Page 37: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/37.jpg)
$ composer require packageAdds package to composer.json and installs
![Page 38: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/38.jpg)
$ composer remove packageRemoves package from composer.json and uninstalls
![Page 39: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/39.jpg)
$ composer create-project packageDownloads project and runs `composer install`
![Page 41: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/41.jpg)
Using Composer with WordPress
![Page 42: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/42.jpg)
$ composer require johnpbloch/wordpressAdd WordPress as a dependency
![Page 43: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/43.jpg)
$ composer require composer/installersEnables WordPress themes and plugins to be put in their respective directories
![Page 44: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/44.jpg)
Setup WordPress PathsPlaces WordPress and its themes and plugins in their respective directories
![Page 45: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/45.jpg)
$ composer create-project wpscholar/wp-skeletonSetup a new WordPress project
![Page 46: Using composer with WordPress](https://reader033.vdocuments.mx/reader033/viewer/2022052600/557e7f3cd8b42acf658b46e1/html5/thumbnails/46.jpg)
Live Demo