Showing posts with label composer. Show all posts
Showing posts with label composer. Show all posts
Tuesday, 6 November 2012

Zend Framework 2 : Use Composer & Packagist PHP

Introduction

Composer is a tool for depedency management in PHP. It allows you to declare the dependent libraries in your project needs and it will install them in your project.

Composer is not a package manager but composer manages them (packages or libary) on a per-project basis, installing them in a directory (e.g vendor) inside your project. By default it will never install anything globally. thus , it's a dependency manager.

The problem that composer can solve are :

a) You have a project that depends on a number of libraries.
b) Some of those libraries depend on other libraries.
c) You declare the things you depend on.
d) Composer finds out which versions of which packages need to be installed, and installs them (meaning it download them into your project like apt-get command in ubuntu).

Installation

First, you have to install curl on your pc by type command on your terminal :
 sudo apt-get install curl 
Then type command to get executetable composer.phar
 $ curl -s https://getcomposer.org/installer | php
This will just check a few PHP settings and then download composer.phar to your working directory. This file is the Composer binary. It is a PHAR (PHP archive), which is an archive format for PHP which can be run on the command line, amongst other things.
Copyright © 2012 Clighter | Powered by Blogger