Transferred from: http://www.aichengxu.com/view/14872First, some smelly history of PHPDependency Manager for Php,composer. PHP's code was difficult to manage before composer was born. Although Pear Community support, many reusable code can be obtained through pear, but pear is very poor in dealing with code associativity, of course, there are many problems. The J
This article mainly introduces the basic preparations for using Composer to build your PHP framework. It is actually a variety of basic knowledge. If you want to build your own php framework, take a closer look.
This article mainly introduces the basic preparations for using Composer to build your
Use ORM and composerorm to build your own PHP framework with Composer. Using Composer to build your own PHP framework using ORM, composerorm review after the basic preparation of the first three articles, build routing and design MVC, we have obtained a structure comparison using C
PHP dependency management tool Composer autoload and dependencyautoload
For example, if our project wants to use the monolog log tool, we need to tell composer in composer. json that we need it:
{ "require": { "monolog/monolog": "1.*" }}
Then run:
php composer.phar install
composer-php for managing dependencies (dependency)
Defined
Composer is a tool used in PHP to manage dependency (dependency) relationships. You can declare your dependencies on the External tool Library (libraries) in your project, and composer will help you install these
Preface:
This blog is mainly to introduce composer installation and use, and load Phpmailer code library as an example for everyone to do a demo.
Environment: Centos7 + LAMP
Because of the example involved in PHP email, so before starting this blog, we suggest that you first read my previous blog: "PHP use Phpmailer with QQ mailbox implementation of email ," A,
PHP Management Dependency (dependency) Relationship Tool Composer Auto-load (autoload), dependencyautoload
For example, assuming that our project wants to use the Monolog log tool, we need to tell composer in Composer.json that we need it:
{"Require": { "Monolog/monolog": "1.*"}}
After execution:
PHP Composer.phar In
Install the php package management tool composer and use the domestic image method to describe how to install composer
Download the composer. phar file from the official website.Mac or Linux:
Open the command line window and run the following command to move the previously downloaded
In the absence of a global Composer, if you run the Composer command in a directory that does not have Composer installed, such as: The Create-project system will return:
Could not open input File:composer.phar
Well, come and find out why, take a look at Composer's documentation says to move the Comp
This article mainly introduces how to install the Yii framework using Composer, and analyzes the usage skills of Composer based on specific examples, for more information about how to use Composer to install the Yii framework, see the following example. We will share this with you for your reference. The details are as follows:
Currently,
PHP Composer What is the application scenario is what to read the document is not read
Reply content:
PHP Composer What is the application scenario is what to read the document is not read
Composer is a PHP package manageme
ObjectiveAfter contact Laravel, only then know has psr,composer such things, PHP is no longer a grassroots language. Recently trying to play thrift, need to install PHP Thrift dependent Library, using composer install apache/thrift will prompt Composer.json file does not exist, this file does not exist, can't install i
Composer is a PHP-dependent management tool that gives PHP a new lease of life, a modern web development specification, packagist a library of PHP components, and other mirrors.
Submitted a PHP component of its own development on packagist so that other developers could use
What is the Application Scenario of php Composer? I have read the documentation, but I have not understood the php Composer. I have not read the documentation.
Reply content:
Php Composer does not understand the Application Scen
,?]?preparing for the production environmentFinally, when deploying the code to the production environment, don't forget to optimize the automatic loading:Composer Dump-autoload--optimizeThe same can be used when installing packages --optimize-autoloader . Without this option, you may find a performance penalty of 20% to 25%.If you need help, or want to know the details of a command, you can read an official document or a Chinese document, or you can view this interactive cheat sheet made by Jol
"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
Recently, after seeing the composer, do I need to write the autoload method myself after I struggle to use composer in php? Or are all loaded with composer? In fact, I don't know much about composer. Please advise. Recently, after seeing the
"The Age of Composer eminence has come!" 』
--Bai
"An era has come to an end, another time has begun." ”
The Framework interoperability Group (frame Interoperability Group), referred to as FIG, was founded in 2009. The FIG was originally initiated by several well-known PHP framework developers, and after absorbing many excellent brains and strong physique, it presented the PSR-0 to PSR-4 five sets of
We are developing a blog plug-in. we need to use this project Parser. how can we reference this project in the PHP file in an environment without composer, or directly install composer and this library in the PHP file? We are developing a blog plug-in. we need to use this project Parser. how can we reference this proje
"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
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.