User Tools

Site Tools


php:composer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
php:composer [2016/07/14 20:18] mithatphp:composer [2016/07/14 20:22] (current) – [Specify your dependencies] mithat
Line 1: Line 1:
 ====== Composer ====== ====== Composer ======
-[[https://getcomposer.org/|Composer]] is a PHP dependency manager. In other words, you (the developer) specify in a configuration file what PHP packages you want to use in your project, and Composer will automagically download the package //well as any other packages needed by the packages you listed//.+[[https://getcomposer.org/|Composer]] is a PHP dependency manager. In other words, you (the developer) specify in a configuration file what PHP packages you want to use in your project, and Composer will automagically download the packages //as well as any other packages needed by the packages you listed//.
  
-It also will generate an autoload file, which when ''require''d or ''include''d in your PHP file will automagicallay load (i.e., include) all the packages Composer downloaded.+It also will generate an ''autoload.php'' file, which when ''require''d or ''include''d in your PHP script will automagicallay load all the packages it downloaded and let you refer to them using a standard namespacing scheme.
  
 ===== Init ===== ===== Init =====
  
-The starting point is a file called ''composer.json'' that exists in the root of your project. You can manually create ''composer.json'' or you can issue <code bash>$ compser init</code> to have composer scaffold out a ''composer.json'' file for you. Once the composer.json has been scaffolded out, you'll have to manually edit it to change it.((TODO: Is this true? Is there a composer command than will download a package and automatically add it to ''composer.json''?))+The starting point is a file called ''composer.json'' that exists in the root of your project. You can manually create ''composer.json'' or you can issue<code bash>$ compser init</code> to have composer scaffold out a ''composer.json'' file for you. 
 + 
 +Once the ''composer.json'' file has been scaffolded out, you'll have to manually edit it to change it.((TODO: Is this true? Is there a composer command than will download a package and automatically add it to ''composer.json''?))
  
 ===== Specify your dependencies ===== ===== Specify your dependencies =====
Line 23: Line 25:
 }</code> }</code>
  
-you specify packages you want to use (hereafter referred to as "dependencies") as follows:+you specify packages you want to use (hereafter referred to as **dependencies**) as follows:
  
 TODO TODO
php/composer.1468527512.txt.gz · Last modified: 2016/07/14 20:18 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki