"One era is over, another era begins."
The Framework Interoperability Group, referred to as FIG, was established in 2009. FIG was originally initiated by several well-known PHP framework developers. After absorbing many excellent brains and strong physiques, FIG proposed five unofficial PHP specifications from PSR-0 to PSR-4:
1. PSR-0 (Autoloading Standard)
2. PSR-1 (Basic Coding Standard) basic coding standard
3. PSR-2 (Coding Style Guide) Coding Style Guide
4. PSR-3 (Logger Interface)
5. PSR-4 (Improved Autoloading) automatic loading optimization standard
After that, on top of this standard, Composer turned out! Composer uses PSR-0 and PSR-4 as well as the PHP5.3 namespace to construct a prosperous PHP ecosystem. Composer is similar to the famous npm and RubyGems, and provides a very convenient collaboration channel for massive PHP packages. Composer Hub address: https://packagist.org/ . Composer Chinese website: http://www.phpcomposer.com/ .
At present, Laravel and Symfony, which are in the PHP world, are directly based on Composer. Everybody is familiar with the well-known frameworks CI and Yii. The development versions of CodeIgniter 3 and Yii 2 are also based on Composer (update: Beijing time October 13, 2014 Yii 2 has been released ). Composer is the future of the PHP framework. With it, the collaboration between CI routing and Laravel's Eloquent ORM will become very simple.
The PHP language itself has powerful network functions, file management functions and rich system APIs, and Composer is just a PHP script. can use
php composer.phar update
Create a new folder in a suitable place, name it MFFC (My First Framework based on Composer), and create a new file composer.json under the folder:
Switch to the MFFC directory from the command line and run:
After a while, the following files and folders will appear:
If the above content appears successfully, congratulations, Composer has been initialized successfully!