Prepare _php instances using composer to build your own PHP framework

Source: Internet
Author: User
Tags coding standards php language php framework yii
"The time has come for Composer eminence!" 』

--Bai Yansong

"An era is over and another era begins. ”

Framework Interoperability Group (framework Interoperability Group), referred to as FIG, was established in 2009. The FIG was originally initiated by several well-known PHP framework developers, and after absorbing many excellent brains and strong physique, PSR-0 to PSR-4 five sets of PHP unofficial specifications:

1. PSR-0 (autoloading standard) automatic loading standards

2. PSR-1 (Basic Coding Standard) basic coding standards

3. PSR-2 (Coding style guide) Coding Style Wizard

4. PSR-3 (Logger Interface) Log interface

5. PSR-4 (improved autoloading) automatic loading optimization standard

Then, on top of this standard, composer was born! Composer constructs a thriving PHP ecosystem using PSR-0 and PSR-4 and PHP5.3 's namespaces. Composer, like the famous NPM and RubyGems, provides an exceptionally convenient collaboration channel for massive PHP packages, Composer Hub address: https://packagist.org/. Composer Chinese website: http://www.phpcomposer.com/.

At present, the Laravel and Symfony of the PHP community are directly based on Composer, we are familiar with the well-known framework CI and Yii development version CodeIgniter 3 and Yii 2 are also based on Composer (update: Beijing time 2014 1 13th Yii 2 has been released). Composer is the future of PHP framework, with it, so that the CI routing and Laravel eloquent ORM collaboration will become very simple.

PHP language itself with strong network functions, file management functions and Rich system api,composer is only a PHP script. can use

PHP Composer.phar Update

Called directly.

Create a new folder in the right place, named MFFC (My first Framework based on Composer), and create a new file Composer.json under the folder:

{"Require": {}}

The command line switches to the MFFC directory and runs:

Composer Update

Wait a moment and the following files and folders will appear:



If the above content appears successfully, congratulations, Composer initialization success!

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.