SlideShare una empresa de Scribd logo
1 de 133
Descargar para leer sin conexión
C!"p#$rPutting your dependencies on the score
Rafael Dohms / @rdohms
photocredit:EliWhite
Evangelist, Speaker and
Contributor.
Developer at WEBclusive.
Enabler at AmsterdamPHP.
Rafael Dohms
@rdohms
photocredit:EliWhite
Evangelist, Speaker and
Contributor.
Developer at WEBclusive.
Enabler at AmsterdamPHP.
Rafael Dohms
@rdohms
%$ E&$v'(!r P)(*+
a general introduction to Composer
Ev$r,-', *!"p#)./
the basic stuff you need to know
Up/r'-)./ (! ' M'$0(r!
advanced features for more complex scenarios
1.-)./ ,!2r (2.$
discovering and sharing libraries
%$ E&$v'(!r P)(*+
per project system wide
central repository
open acceptance
spread out channels
strict standards
Pr!b&$":
I need my team and my deployments to use consistent
versions of the dependencies of my project
Pr!b&$":
I need my team and my deployments to use consistent
versions of the dependencies of my project
S!&2()!.:
Pr!b&$":
I need my team and my deployments to use consistent
versions of the dependencies of my project
S!&2()!.:
PEAR
Pr!b&$":
I need my team and my deployments to use consistent
versions of the dependencies of my project
S!&2()!.:
PEAR
SVN Externals
Pr!b&$":
I need my team and my deployments to use consistent
versions of the dependencies of my project
S!&2()!.:
PEAR
SVN Externals
Git Submodules
Pr!b&$":
I need my team and my deployments to use consistent
versions of the dependencies of my project
S!&2()!.:
PEAR
SVN Externals
Git Submodules
vendor management script
Pr!b&$":
I need my team and my deployments to use consistent
versions of the dependencies of my project
S!&2()!.:
PEAR
SVN Externals
Git Submodules
vendor management script
C!"p#$r!
A per-project dependency
manager that allows you to
declare a consistent list of
dependencies and versions for
your application, as well as a
consistent way of sharing your
libraries and making them
discoverable using
packagist.org
Ev$r,-', C!"p#)./
I.0('&&)./ C!"p#$r
$ curl -s http://getcomposer.org/installer | php
$ curl -s http://getcomposer.org/installer | php -- --install-dir=bin
Local (embed)
Global
I.0('&&)./ C!"p#$r
$ curl -s http://getcomposer.org/installer | php
$ curl -s http://getcomposer.org/installer | php -- --install-dir=bin
Local (embed)
Global
$ ln -s /usr/bin/composer.phar /usr/bin/composer3p:
I.0('&&)./ C!"p#$r
I.0('&&)./ C!"p#$r
$ composer.phar --version
Composer version 7073d38
I.0('&&)./ C!"p#$r
$ composer.phar --version
Composer version 7073d38
php
K$$p )( 2p-'($-!
K$$p )( 2p-'($-!
$ composer.phar self-update
Updating to version 7073d38.
Downloading: 100%
I’" b2)&-)./ ' Pr!4$*(
How can composer manage your dependencies
C!"p#$r 101
G$(()./ (+$ -$p$.-$.*)$0
C!"p#$r 101
G$(()./ (+$ -$p$.-$.*)$0
$ cd ~/dev/myproject
C!"p#$r 101
G$(()./ (+$ -$p$.-$.*)$0
$ cd ~/dev/myproject
$ vim composer.json
{
"require": {
"silex/silex": "~1.0"
}
}
C!"p#$r 101
G$(()./ (+$ -$p$.-$.*)$0
$ cd ~/dev/myproject
$ vim composer.json
{
"require": {
"silex/silex": "~1.0"
}
}
put this in your project root
C!"p#$r 101
G$(()./ (+$ -$p$.-$.*)$0
$ cd ~/dev/myproject
$ vim composer.json
{
"require": {
"silex/silex": "~1.0"
}
}
put this in your project root
“require”: required packages and
versions
adv. ex.: >=1.0.0,<1.2-dev or ~1.1
C!"p#$r 101
G$(()./ (+$ -$p$.-$.*)$0
$ cd ~/dev/myproject
$ vim composer.json
{
"require": {
"silex/silex": "~1.0"
}
}
put this in your project root
“require”: required packages and
versions
adv. ex.: >=1.0.0,<1.2-dev or ~1.1
C!"p#$r 101
G$(()./ (+$ -$p$.-$.*)$0
$ cd ~/dev/myproject
$ vim composer.json
$ composer.phar install
{
"require": {
"silex/silex": "~1.0"
}
}
put this in your project root
“require”: required packages and
versions
adv. ex.: >=1.0.0,<1.2-dev or ~1.1
Loading composer repositories with package information
Installing dependencies
- Installing psr/log (1.0.0)
Loading from cache
- Installing symfony/routing (v2.2.1)
Downloading: 100%
- Installing symfony/http-foundation (v2.2.1)
Downloading: 100%
- Installing symfony/event-dispatcher (v2.2.1)
Loading from cache
- Installing symfony/http-kernel (v2.2.1)
Downloading: 100%
- Installing pimple/pimple (v1.0.2)
Downloading: 100%
- Installing silex/silex (v1.0.0)
Downloading: 100%
symfony/routing suggests installing symfony/config (2.2.*)
symfony/routing suggests installing symfony/yaml (2.2.*)
[...]
silex/silex suggests installing symfony/dom-crawler (>=2.1,<2.4-dev)
silex/silex suggests installing symfony/form (>= 2.1.4,<2.4-dev)
Writing lock file
Generating autoload files
Loading composer repositories with package information
Installing dependencies
- Installing psr/log (1.0.0)
Loading from cache
- Installing symfony/routing (v2.2.1)
Downloading: 100%
- Installing symfony/http-foundation (v2.2.1)
Downloading: 100%
- Installing symfony/event-dispatcher (v2.2.1)
Loading from cache
- Installing symfony/http-kernel (v2.2.1)
Downloading: 100%
- Installing pimple/pimple (v1.0.2)
Downloading: 100%
- Installing silex/silex (v1.0.0)
Downloading: 100%
symfony/routing suggests installing symfony/config (2.2.*)
symfony/routing suggests installing symfony/yaml (2.2.*)
[...]
silex/silex suggests installing symfony/dom-crawler (>=2.1,<2.4-dev)
silex/silex suggests installing symfony/form (>= 2.1.4,<2.4-dev)
Writing lock file
Generating autoload files
your dependency’s
dependencies
Loading composer repositories with package information
Installing dependencies
- Installing psr/log (1.0.0)
Loading from cache
- Installing symfony/routing (v2.2.1)
Downloading: 100%
- Installing symfony/http-foundation (v2.2.1)
Downloading: 100%
- Installing symfony/event-dispatcher (v2.2.1)
Loading from cache
- Installing symfony/http-kernel (v2.2.1)
Downloading: 100%
- Installing pimple/pimple (v1.0.2)
Downloading: 100%
- Installing silex/silex (v1.0.0)
Downloading: 100%
symfony/routing suggests installing symfony/config (2.2.*)
symfony/routing suggests installing symfony/yaml (2.2.*)
[...]
silex/silex suggests installing symfony/dom-crawler (>=2.1,<2.4-dev)
silex/silex suggests installing symfony/form (>= 2.1.4,<2.4-dev)
Writing lock file
Generating autoload files
your dependency
your dependency’s
dependencies
Loading composer repositories with package information
Installing dependencies
- Installing psr/log (1.0.0)
Loading from cache
- Installing symfony/routing (v2.2.1)
Downloading: 100%
- Installing symfony/http-foundation (v2.2.1)
Downloading: 100%
- Installing symfony/event-dispatcher (v2.2.1)
Loading from cache
- Installing symfony/http-kernel (v2.2.1)
Downloading: 100%
- Installing pimple/pimple (v1.0.2)
Downloading: 100%
- Installing silex/silex (v1.0.0)
Downloading: 100%
symfony/routing suggests installing symfony/config (2.2.*)
symfony/routing suggests installing symfony/yaml (2.2.*)
[...]
silex/silex suggests installing symfony/dom-crawler (>=2.1,<2.4-dev)
silex/silex suggests installing symfony/form (>= 2.1.4,<2.4-dev)
Writing lock file
Generating autoload files
your dependency
your dependency’s
dependencies
suggestions of other
packages, for further
features
“~1.0”
V$r0)!.)./
G$( (+$ -!(0 ). ' r!w
“>=1.0”
“>=1.0, <=1.1”
“1.0.*”
“~1.0”
V$r0)!.)./
G$( (+$ -!(0 ). ' r!w
“>=1.0”
“>=1.0, <=1.1”
“1.0.*”
>=1.0, <=2.0: BC Compatible releases
V$r0)!.)./: D$v
G$(()./ 0('b&$ !r -$v v$r0)!.0
V$r0)!.)./: D$v
G$(()./ 0('b&$ !r -$v v$r0)!.0
“minimum-stability”: “stable”
V$r0)!.)./: D$v
G$(()./ 0('b&$ !r -$v v$r0)!.0
“minimum-stability”: “stable”
No dev versions in dependency tree
V$r0)!.)./: D$v
G$(()./ 0('b&$ !r -$v v$r0)!.0
“minimum-stability”: “stable”
No dev versions in dependency tree
“dms/dms”: “1.0.0@dev”
V$r0)!.)./: D$v
G$(()./ 0('b&$ !r -$v v$r0)!.0
“minimum-stability”: “stable”
No dev versions in dependency tree
“dms/dms”: “1.0.0@dev”
Allow this package to use unstable versions
Q2)*5! I +'v$ '. )-$'!
B!#(r'pp)./ Pr!4$*(0
Q2)*5! I +'v$ '. )-$'!
B!#(r'pp)./ Pr!4$*(0
$ composer.phar create-project fabpot/silex-skeleton ~/dev/myproject
Q2)*5! I +'v$ '. )-$'!
B!#(r'pp)./ Pr!4$*(0
$ composer.phar create-project fabpot/silex-skeleton ~/dev/myproject
Installing fabpot/silex-skeleton (v1.0.0)
- Installing fabpot/silex-skeleton (v1.0.0)
Downloading: 100%
Created project in project
Loading composer repositories with package information
Installing dependencies
- Installing pimple/pimple (dev-master)
Cloning d2cfa2f02f50abef65c238747c753a5f6786f6be
[...]
symfony/routing suggests installing symfony/yaml (dev-master)
[...]
Writing lock file
Generating autoload files
Q2)*5! I +'v$ '. )-$'!
B!#(r'pp)./ Pr!4$*(0
$ composer.phar create-project fabpot/silex-skeleton ~/dev/myproject
Installing fabpot/silex-skeleton (v1.0.0)
- Installing fabpot/silex-skeleton (v1.0.0)
Downloading: 100%
Created project in project
Loading composer repositories with package information
Installing dependencies
- Installing pimple/pimple (dev-master)
Cloning d2cfa2f02f50abef65c238747c753a5f6786f6be
[...]
symfony/routing suggests installing symfony/yaml (dev-master)
[...]
Writing lock file
Generating autoload files
myproject/
composer.jsoncomposer.lockconfig/
console/
src/
templates/
vendor/
web/
A--)./ .$w R$q2)r$"$.(0
$ composer.phar require symfony/yaml=~2.1.0
A--)./ .$w R$q2)r$"$.(0
$ composer.phar require symfony/yaml=~2.1.0
composer.json has been updated
Loading composer repositories with package information
Updating dependencies
- Installing symfony/yaml (v2.1.8)
Downloading: 100%
Writing lock file
Generating autoload files
H!w -! I 6.-/&!'- (+$ 6&$0?
PSR-0 and the modern autoloader
Composer generates an
autoload file for all your
dependencies
Composer generates an
autoload file for all your
dependencies
vendor/autoload.php
"autoload": {
    "psr-0": { "MyNamespace": "<root>" },
"classmap": ["src/", "lib/", "Something.php"],
"files": ["src/MyLibrary/functions.php"]
},
"autoload": {
    "psr-0": { "MyNamespace": "<root>" },
"classmap": ["src/", "lib/", "Something.php"],
"files": ["src/MyLibrary/functions.php"]
},
“autoload”: describes the autoloading needed for your library
"autoload": {
    "psr-0": { "MyNamespace": "<root>" },
"classmap": ["src/", "lib/", "Something.php"],
"files": ["src/MyLibrary/functions.php"]
},
“autoload”: describes the autoloading needed for your library
“psr-0”: PSR-0 Compatible libraries
"autoload": {
    "psr-0": { "MyNamespace": "<root>" },
"classmap": ["src/", "lib/", "Something.php"],
"files": ["src/MyLibrary/functions.php"]
},
“autoload”: describes the autoloading needed for your library
“classmap”: Old PEAR packages and other
libraries
“psr-0”: PSR-0 Compatible libraries
"autoload": {
    "psr-0": { "MyNamespace": "<root>" },
"classmap": ["src/", "lib/", "Something.php"],
"files": ["src/MyLibrary/functions.php"]
},
“autoload”: describes the autoloading needed for your library
“classmap”: Old PEAR packages and other
libraries
“files”: for php functions or initializations
“psr-0”: PSR-0 Compatible libraries
I .$$- ,!2r 0$rv$r (! +'v$ (+$0$..
C+$*5)./ 0,0($" -$p$.-$.*)$0
{
"require": {
"php": ">=5.3.3",
"ext-ldap": "*"
}
}
I .$$- ,!2r 0$rv$r (! +'v$ (+$0$..
C+$*5)./ 0,0($" -$p$.-$.*)$0
{
"require": {
"php": ">=5.3.3",
"ext-ldap": "*"
}
}
“php”: PHP version.
I .$$- ,!2r 0$rv$r (! +'v$ (+$0$..
C+$*5)./ 0,0($" -$p$.-$.*)$0
{
"require": {
"php": ">=5.3.3",
"ext-ldap": "*"
}
}
“php”: PHP version.
“ext-*”: Presence of selected
extension
I .$$- ,!2r 0$rv$r (! +'v$ (+$0$..
C+$*5)./ 0,0($" -$p$.-$.*)$0
I.0('&&)./, 2p-'()./ '.- "!v)./ !.
how does Composer guarantee consistency
composer.json
“composer.json”: metadata and list of your
dependencies.
composer.json
“composer.json”: metadata and list of your
dependencies.
composer.lock
composer.json
“composer.json”: metadata and list of your
dependencies.
“composer.lock”: existing dependencies and
current commit hashes.
composer.lock
composer.json
composer.lock
composer.json
update
composer.lock
composer.json
update install
composer.lock
composer.json
update install
reads
composer.lock
composer.json
update install
reads
gets latest
composer.lock
composer.json
update install
reads
gets latest
writes
composer.lock
composer.json
update install
reads
gets latest
writes
reads
composer.lock
composer.json
update install
reads
gets latest
writes
reads
compares
composer.lock
composer.json
update install
reads
gets latest
writes
reads
gets locked version
compares
composer.lock
composer.json
K$$p (+$ ($'" !. (+$ 0'"$ p'/$
Commit you composer.lock file
into the repository, and use
composer install.
I’" -$v$&!p)./ ' &)br'r,, +$&p!
how can composer spread my library around?
{
"name": "vendor-namespace/package-name",
"type": "symfony-bundle",
"description": "A sample package for examples",
"keywords": ["php", "package"],
"homepage": "http://doh.ms",
"license": "MIT",
"support": {
"email": "support@mylib.com",
"issues": "http://issues.lib.com"
}
"target-dir": "/folder/to/install",
}
{
"name": "vendor-namespace/package-name",
"type": "symfony-bundle",
"description": "A sample package for examples",
"keywords": ["php", "package"],
"homepage": "http://doh.ms",
"license": "MIT",
"support": {
"email": "support@mylib.com",
"issues": "http://issues.lib.com"
}
"target-dir": "/folder/to/install",
}
“name”: this should be unique, pick a
good one!
{
"name": "vendor-namespace/package-name",
"type": "symfony-bundle",
"description": "A sample package for examples",
"keywords": ["php", "package"],
"homepage": "http://doh.ms",
"license": "MIT",
"support": {
"email": "support@mylib.com",
"issues": "http://issues.lib.com"
}
"target-dir": "/folder/to/install",
}
“name”: this should be unique, pick a
good one!
“type”: will be used for more
advanced “custom”installs
{
"name": "vendor-namespace/package-name",
"type": "symfony-bundle",
"description": "A sample package for examples",
"keywords": ["php", "package"],
"homepage": "http://doh.ms",
"license": "MIT",
"support": {
"email": "support@mylib.com",
"issues": "http://issues.lib.com"
}
"target-dir": "/folder/to/install",
}
“name”: this should be unique, pick a
good one!
“type”: will be used for more
advanced “custom”installs
“license”: very important!
{
"name": "vendor-namespace/package-name",
"type": "symfony-bundle",
"description": "A sample package for examples",
"keywords": ["php", "package"],
"homepage": "http://doh.ms",
"license": "MIT",
"support": {
"email": "support@mylib.com",
"issues": "http://issues.lib.com"
}
"target-dir": "/folder/to/install",
}
“name”: this should be unique, pick a
good one!
“type”: will be used for more
advanced “custom”installs
“license”: very important!
“support”: point people the right
way.
{
"name": "vendor-namespace/package-name",
"type": "symfony-bundle",
"description": "A sample package for examples",
"keywords": ["php", "package"],
"homepage": "http://doh.ms",
"license": "MIT",
"support": {
"email": "support@mylib.com",
"issues": "http://issues.lib.com"
}
"target-dir": "/folder/to/install",
}
“name”: this should be unique, pick a
good one!
“type”: will be used for more
advanced “custom”installs
“license”: very important!
“support”: point people the right
way.
“target-dir”: great for installing sub-dir splits repositories
ex: Symfony Bundles: /Acme/Bundle/MyBundle
Q2)*5! I w'..' p'(*+ (+)0!
B!!(0(r'pp)./ L)br'r, C!.(r)b2()!.
$ composer.phar create-project dms/dms --dev ~/dev/oss/dms
Q2)*5! I w'..' p'(*+ (+)0!
B!!(0(r'pp)./ L)br'r, C!.(r)b2()!.
$ composer.phar create-project dms/dms --dev ~/dev/oss/dms
Q2)*5! I w'..' p'(*+ (+)0!
B!!(0(r'pp)./ L)br'r, C!.(r)b2()!.
gimme dev packages
$ composer.phar create-project dms/dms --dev ~/dev/oss/dms
Q2)*5! I w'..' p'(*+ (+)0!
B!!(0(r'pp)./ L)br'r, C!.(r)b2()!.
gimme dev packages
    "require-dev": {
        "symfony/symfony": ">=2.1-dev",
        "doctrine/orm": "dev-master"
    },
$ composer.phar create-project dms/dms --dev ~/dev/oss/dms
Q2)*5! I w'..' p'(*+ (+)0!
B!!(0(r'pp)./ L)br'r, C!.(r)b2()!.
gimme dev packages
    "require-dev": {
        "symfony/symfony": ">=2.1-dev",
        "doctrine/orm": "dev-master"
    },
“require-dev”: only needed if you are
going to contribute/develop the library
T'/ ,!2r r$&$'0$0!
use semver and always make tags for releases
T'/ ,!2r r$&$'0$0!
use semver and always make tags for releases
X.Y.Z
Up/r'-)./ (! ' M'$0(r!
B2( I .$$- ' 0p$*)6* v$r0)!.
version modifiers to the rescue!
"acme/foo": "1.0.x-dev#3ebbe75"
"acme/foo": "1.0.x-dev#3ebbe75"
“#<ref>”: Get this specific commit
"acme/foo": "1.0.x-dev#3ebbe75"
"acme/foo": "@dev"
"acme/foo": "1.0.*@beta"
“#<ref>”: Get this specific commit
"acme/foo": "1.0.x-dev#3ebbe75"
"acme/foo": "@dev"
"acme/foo": "1.0.*@beta"
“#<ref>”: Get this specific commit
“@<state>”: Get a version outside
your default stability
I .$$- (! 7$*2($ ' f$w 0*r)p(0
how to automate tasks with Composer
    "scripts": {
        "post-install-cmd": [
            "Sensio...ComposerScriptHandler::buildBootstrap",
            "Sensio...ComposerScriptHandler::clearCache",
            "Sensio...ComposerScriptHandler::installAssets",
            "Sensio...ComposerScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Sensio...ComposerScriptHandler::buildBootstrap",
            "Sensio...ComposerScriptHandler::clearCache",
            "Sensio...ComposerScriptHandler::installAssets",
            "Sensio...ComposerScriptHandler::installRequirementsFile"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "Sensio...ComposerScriptHandler::buildBootstrap",
            "Sensio...ComposerScriptHandler::clearCache",
            "Sensio...ComposerScriptHandler::installAssets",
            "Sensio...ComposerScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Sensio...ComposerScriptHandler::buildBootstrap",
            "Sensio...ComposerScriptHandler::clearCache",
            "Sensio...ComposerScriptHandler::installAssets",
            "Sensio...ComposerScriptHandler::installRequirementsFile"
        ]
    },
“scripts”: allows you to run scripts at given
moments
C20(!" R$p#)(!r)$0 !r .!
C!"p#$r, w+'( .!w?
Injecting Composer into wild packages
“hero/superpackage”: “dev-master”
“hero/superpackage”: “dev-master”
“hero/superpackage”: “dev-master”
“hero/superpackage”: “dev-master”
“hero/superpackage”: “dev-master”
    "repositories": [
{
"type": "vcs",
"url": "https://github.com/rdohms/hero-superpackage"
}       
]
“hero/superpackage”: “dev-master”
    "repositories": [
{
"type": "vcs",
"url": "https://github.com/rdohms/hero-superpackage"
}       
]
my fork
“hero/superpackage”: “dev-master”
    "repositories": [
{
"type": "vcs",
"url": "https://github.com/rdohms/hero-superpackage"
}       
]
“repositories”: point to non-indexed,
override existing or on-the-fly packages
my fork
{
"repositories": [
{
"type": "package",
"package": {
"name": "smarty/smarty",
"version": "3.1.7",
"dist": {
"url": "http://www.smarty.net/files/Smarty-3.1.7.zip",
"type": "zip"
},
"source": {
"url": "http://smarty-php.googlecode.com/svn/",
"type": "svn",
"reference": "tags/Smarty_3_1_7/distribution/"
}
}
}
]
}
N!.-C!"p#$r P'*5'/$
{
"repositories": [
{
"type": "package",
"package": {
"name": "smarty/smarty",
"version": "3.1.7",
"dist": {
"url": "http://www.smarty.net/files/Smarty-3.1.7.zip",
"type": "zip"
},
"source": {
"url": "http://smarty-php.googlecode.com/svn/",
"type": "svn",
"reference": "tags/Smarty_3_1_7/distribution/"
}
}
}
]
}
“package”: on-the-fly package, injecting a
composer.json
N!.-C!"p#$r P'*5'/$
{
"repositories": [
{
"type": "package",
"package": {
"name": "smarty/smarty",
"version": "3.1.7",
"dist": {
"url": "http://www.smarty.net/files/Smarty-3.1.7.zip",
"type": "zip"
},
"source": {
"url": "http://smarty-php.googlecode.com/svn/",
"type": "svn",
"reference": "tags/Smarty_3_1_7/distribution/"
}
}
}
]
}
SVN / Git
“package”: on-the-fly package, injecting a
composer.json
N!.-C!"p#$r P'*5'/$
I .$$- (+)0 PEAR p'*5'/$...
No Problem!
{
"repositories": [
{
"type": "pear",
"url": "http://pear2.php.net"
}
],
"require": {
"pear-pear2.php.net/PEAR2_Text_Markdown": "*",
"pear-pear2/PEAR2_HTTP_Request": "*"
}
}
{
"repositories": [
{
"type": "pear",
"url": "http://pear2.php.net"
}
],
"require": {
"pear-pear2.php.net/PEAR2_Text_Markdown": "*",
"pear-pear2/PEAR2_HTTP_Request": "*"
}
}
“pear”: official PEAR and custom PEAR
channels
{
"repositories": [
{
"type": "pear",
"url": "http://pear2.php.net"
}
],
"require": {
"pear-pear2.php.net/PEAR2_Text_Markdown": "*",
"pear-pear2/PEAR2_HTTP_Request": "*"
}
}
“pear”: official PEAR and custom PEAR
channels
Remember the prefix!
{
"repositories": [
{
"type": "pear",
"url": "http://pear2.php.net"
}
],
"require": {
"pear-pear2.php.net/PEAR2_Text_Markdown": "*",
"pear-pear2/PEAR2_HTTP_Request": "*"
}
}
“pear”: official PEAR and custom PEAR
channels
Remember the prefix!
Warning: PEAR causes a overhead of requests!!
1.-)./ ,!2r (2.$
I .$$- ' &)br'r, (+'( -!$0..
Let me get that for you
http://packagist.org/
versions
package info
usage info
$ composer.phar search filter
dms/dms-filter-bundle : DMS Filter Bundle, makes Annotation
based ...
lexik/form-filter-bundle : This bundle aim to provide classes to
build...
rollerworks/recordfilter-bundle : Record search-filtering bundle for
Symfony
brikou/zend_filter : Zend Framework Filter Library
ext-filter : The filter PHP extension
dms/dms-filter : DMS Library, includes various bundles
and ...
shtumi/useful-bundle : Symfony ShtumiUsefulBundle
$ composer.phar search filter
$ composer.phar show dms/dms-filter-bundle
name : dms/dms-filter-bundle
descrip. : DMS Filter Bundle, makes Annotation based entity filtering
available in Symfony
keywords : symfony, bundle, filter, dms
versions : dev-master, v1.1.1, v1.1, 1.0.2, 1.0.1, 1.0.0
type : symfony-bundle
license : MIT
source : [git] https://github.com/rdohms/DMSFilterBundle v1.1.1
dist : [zip] https://github.com/rdohms/DMSFilterBundle/zipball/
v1.1.1 v1.1.1
names : dms/dms-filter-bundle
autoload
psr-0
DMSBundleFilterBundle => .
requires
php >=5.3.2
dms/dms-filter >=1.0.2
$ composer.phar show dms/dms-filter-bundle
B2( ", r$p#)(!r, )0 pr)v'($!
Get your own package repository
S'()0!
$ composer.phar create-project composer/satis
R!""!#$ %!#r !w& S'$()
$ composer.phar create-project composer/satis
$ vi packages.json
{
"name": "My Repository",
"homepage": "http://packages.example.org",
"repositories": [
{ "type": "vcs", "url": "http://github.com/mycompany/privaterepo" },
{ "type": "vcs", "url": "http://svn.example.org/private/repo" },
{ "type": "vcs", "url": "http://github.com/mycompany/privaterepo2" }
],
"require-all": true
}
R!""!#$ %!#r !w& S'$()
$ composer.phar create-project composer/satis
$ vi packages.json
$ php bin/satis build config.json web/
{
"name": "My Repository",
"homepage": "http://packages.example.org",
"repositories": [
{ "type": "vcs", "url": "http://github.com/mycompany/privaterepo" },
{ "type": "vcs", "url": "http://svn.example.org/private/repo" },
{ "type": "vcs", "url": "http://github.com/mycompany/privaterepo2" }
],
"require-all": true
}
R!""!#$ %!#r !w& S'$()
{
"repositories": [
{
"type": "composer",
"url": "http://packages.yourdomain.net"
}
],
“require”: {
“myvendor/mypackage”: “dev-master”
}
}
U)(&* %!#r !w& S'$()
{
"repositories": [
{
"type": "composer",
"url": "http://packages.yourdomain.net"
}
],
“require”: {
“myvendor/mypackage”: “dev-master”
}
}
U)(&* %!#r !w& S'$()
“composer”: use this just like it was
Packagist
W+$r$ 0+!2&- I /$( +$&p?
http://getcomposer.org
#composer on irc.freenode.org
%$ E&$v'(!r P)(*+
Dependency Manager, consistent versions, per-project
Ev$r,-', *!"p#)./
install, update, lock and autoload
Up/r'-)./ (! ' M'$0(r!
post-install, overriding, PEAR integration, developer environment
1.-)./ ,!2r (2.$
Satis and Packagist
Q2$0()!.0?
http://slides.doh.ms
http://doh.ms
@rdohms
https://joind.in/8178

Más contenido relacionado

La actualidad más candente

Php psr standard 2014 01-22
Php psr standard 2014 01-22Php psr standard 2014 01-22
Php psr standard 2014 01-22
Võ Duy Tuấn
 

La actualidad más candente (20)

Composer the right way
Composer the right wayComposer the right way
Composer the right way
 
Composer the Right Way - MM16NL
Composer the Right Way - MM16NLComposer the Right Way - MM16NL
Composer the Right Way - MM16NL
 
Dependency Management with Composer
Dependency Management with ComposerDependency Management with Composer
Dependency Management with Composer
 
Composer the Right Way - PHPSRB16
Composer the Right Way - PHPSRB16Composer the Right Way - PHPSRB16
Composer the Right Way - PHPSRB16
 
Composer the right way - DPC15
Composer the right way - DPC15Composer the right way - DPC15
Composer the right way - DPC15
 
Create your own composer package
Create your own composer packageCreate your own composer package
Create your own composer package
 
Composer The Right Way
Composer The Right WayComposer The Right Way
Composer The Right Way
 
Composer The Right Way - PHPUGMRN
Composer The Right Way - PHPUGMRNComposer The Right Way - PHPUGMRN
Composer The Right Way - PHPUGMRN
 
Composer the right way - NomadPHP
Composer the right way - NomadPHPComposer the right way - NomadPHP
Composer the right way - NomadPHP
 
Composer the right way [SweetlakePHP]
Composer the right way [SweetlakePHP]Composer the right way [SweetlakePHP]
Composer the right way [SweetlakePHP]
 
Composer | PHP Dependency Manager
Composer | PHP Dependency ManagerComposer | PHP Dependency Manager
Composer | PHP Dependency Manager
 
Maven 3.0 at Øredev
Maven 3.0 at ØredevMaven 3.0 at Øredev
Maven 3.0 at Øredev
 
Php psr standard 2014 01-22
Php psr standard 2014 01-22Php psr standard 2014 01-22
Php psr standard 2014 01-22
 
Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2
 
Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Composer
ComposerComposer
Composer
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
 
Asynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowAsynchronous Systems with Fn Flow
Asynchronous Systems with Fn Flow
 
Composer for busy developers - DPC13
Composer for busy developers - DPC13Composer for busy developers - DPC13
Composer for busy developers - DPC13
 

Destacado

The Monthly Lekhapara, July 2015
The Monthly Lekhapara, July 2015The Monthly Lekhapara, July 2015
The Monthly Lekhapara, July 2015
Shahida Akhter
 
Afstuderen eindverslag final
Afstuderen eindverslag finalAfstuderen eindverslag final
Afstuderen eindverslag final
hanskanns
 
Hisham Muhamed Tilbete - Mrekullia e Kur'anit në çështje të astronomisë
Hisham Muhamed Tilbete - Mrekullia e Kur'anit në çështje të astronomisëHisham Muhamed Tilbete - Mrekullia e Kur'anit në çështje të astronomisë
Hisham Muhamed Tilbete - Mrekullia e Kur'anit në çështje të astronomisë
Libra Islame
 

Destacado (20)

Mocking Dependencies in PHPUnit
Mocking Dependencies in PHPUnitMocking Dependencies in PHPUnit
Mocking Dependencies in PHPUnit
 
Baala bhaavana (neethi satakamu) బాల భావన ( నీతి శతకము.)
Baala bhaavana (neethi satakamu) బాల భావన ( నీతి శతకము.)Baala bhaavana (neethi satakamu) బాల భావన ( నీతి శతకము.)
Baala bhaavana (neethi satakamu) బాల భావన ( నీతి శతకము.)
 
Letter s presentatie
Letter s presentatieLetter s presentatie
Letter s presentatie
 
The Monthly Lekhapara, July 2015
The Monthly Lekhapara, July 2015The Monthly Lekhapara, July 2015
The Monthly Lekhapara, July 2015
 
Jongerenparticipatie Sensoa - Inspiratiedag Kansengroepen van Ambrassade op ...
Jongerenparticipatie Sensoa -  Inspiratiedag Kansengroepen van Ambrassade op ...Jongerenparticipatie Sensoa -  Inspiratiedag Kansengroepen van Ambrassade op ...
Jongerenparticipatie Sensoa - Inspiratiedag Kansengroepen van Ambrassade op ...
 
Afstuderen eindverslag final
Afstuderen eindverslag finalAfstuderen eindverslag final
Afstuderen eindverslag final
 
islam & art
islam & artislam & art
islam & art
 
Seo conference 2015 google my business & for business
Seo conference 2015 google my business & for businessSeo conference 2015 google my business & for business
Seo conference 2015 google my business & for business
 
cv pdf
cv pdfcv pdf
cv pdf
 
Go言語
Go言語Go言語
Go言語
 
ספר וטהר לבנו השלם.
ספר וטהר לבנו השלם.ספר וטהר לבנו השלם.
ספר וטהר לבנו השלם.
 
Empower Teollisuus IoT
Empower Teollisuus IoTEmpower Teollisuus IoT
Empower Teollisuus IoT
 
Plan de clase
Plan de clasePlan de clase
Plan de clase
 
Proform 505 cst Treadmill Buying Guide
Proform 505 cst Treadmill Buying GuideProform 505 cst Treadmill Buying Guide
Proform 505 cst Treadmill Buying Guide
 
List Down Your Expectations
List Down Your ExpectationsList Down Your Expectations
List Down Your Expectations
 
Is brief illustrated guide الدليل المصور الموجز لفهم الإسلام آيسلندي
Is brief illustrated guide   الدليل المصور الموجز لفهم الإسلام   آيسلنديIs brief illustrated guide   الدليل المصور الموجز لفهم الإسلام   آيسلندي
Is brief illustrated guide الدليل المصور الموجز لفهم الإسلام آيسلندي
 
Psych 100B
Psych 100BPsych 100B
Psych 100B
 
National hero
National heroNational hero
National hero
 
Hisham Muhamed Tilbete - Mrekullia e Kur'anit në çështje të astronomisë
Hisham Muhamed Tilbete - Mrekullia e Kur'anit në çështje të astronomisëHisham Muhamed Tilbete - Mrekullia e Kur'anit në çështje të astronomisë
Hisham Muhamed Tilbete - Mrekullia e Kur'anit në çështje të astronomisë
 
Design persuasivo: alcuni esempi
Design persuasivo: alcuni esempiDesign persuasivo: alcuni esempi
Design persuasivo: alcuni esempi
 

Similar a Composer for Busy Developers - php|tek13

Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011
tobiascrawley
 

Similar a Composer for Busy Developers - php|tek13 (20)

Composer: putting dependencies on the score
Composer: putting dependencies on the scoreComposer: putting dependencies on the score
Composer: putting dependencies on the score
 
Composer, putting dependencies on the score
Composer, putting dependencies on the scoreComposer, putting dependencies on the score
Composer, putting dependencies on the score
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Torquebox Asheville.rb April 2011
Torquebox Asheville.rb April 2011Torquebox Asheville.rb April 2011
Torquebox Asheville.rb April 2011
 
Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011
 
May The Nodejs Be With You
May The Nodejs Be With YouMay The Nodejs Be With You
May The Nodejs Be With You
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
A General Purpose Docker Image for PHP
A General Purpose Docker Image for PHPA General Purpose Docker Image for PHP
A General Purpose Docker Image for PHP
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environment
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
Usando o Cloud
Usando o CloudUsando o Cloud
Usando o Cloud
 
Elixir on Containers
Elixir on ContainersElixir on Containers
Elixir on Containers
 
Plug-ins: Building, Shipping, Storing, and Running - Nandhini Santhanam and T...
Plug-ins: Building, Shipping, Storing, and Running - Nandhini Santhanam and T...Plug-ins: Building, Shipping, Storing, and Running - Nandhini Santhanam and T...
Plug-ins: Building, Shipping, Storing, and Running - Nandhini Santhanam and T...
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
 
Laravel Day / Deploy
Laravel Day / DeployLaravel Day / Deploy
Laravel Day / Deploy
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014
 

Más de Rafael Dohms

Más de Rafael Dohms (20)

The Individual Contributor Path - DPC2024
The Individual Contributor Path - DPC2024The Individual Contributor Path - DPC2024
The Individual Contributor Path - DPC2024
 
Application Metrics - IPC2023
Application Metrics - IPC2023Application Metrics - IPC2023
Application Metrics - IPC2023
 
How'd we get here? A guide to Architectural Decision Records
How'd we get here? A guide to Architectural Decision RecordsHow'd we get here? A guide to Architectural Decision Records
How'd we get here? A guide to Architectural Decision Records
 
Architectural Decision Records - PHPConfBR
Architectural Decision Records - PHPConfBRArchitectural Decision Records - PHPConfBR
Architectural Decision Records - PHPConfBR
 
Application Metrics (with Prometheus examples)
Application Metrics (with Prometheus examples)Application Metrics (with Prometheus examples)
Application Metrics (with Prometheus examples)
 
Application metrics - Confoo 2019
Application metrics - Confoo 2019Application metrics - Confoo 2019
Application metrics - Confoo 2019
 
Writing code you won’t hate tomorrow - PHPCE18
Writing code you won’t hate tomorrow - PHPCE18Writing code you won’t hate tomorrow - PHPCE18
Writing code you won’t hate tomorrow - PHPCE18
 
Application Metrics (with Prometheus examples) #PHPDD18
Application Metrics (with Prometheus examples) #PHPDD18Application Metrics (with Prometheus examples) #PHPDD18
Application Metrics (with Prometheus examples) #PHPDD18
 
Application metrics with Prometheus - DPC18
Application metrics with Prometheus - DPC18Application metrics with Prometheus - DPC18
Application metrics with Prometheus - DPC18
 
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
 
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
 
Writing Code That Lasts - #Magento2Seminar, Utrecht
Writing Code That Lasts - #Magento2Seminar, UtrechtWriting Code That Lasts - #Magento2Seminar, Utrecht
Writing Code That Lasts - #Magento2Seminar, Utrecht
 
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16
 
“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.
 
A Journey into your Lizard Brain - PHP Conference Brasil 2015
A Journey into your Lizard Brain - PHP Conference Brasil 2015A Journey into your Lizard Brain - PHP Conference Brasil 2015
A Journey into your Lizard Brain - PHP Conference Brasil 2015
 
“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.
 
“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.
 
“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.
 
Journey into your Lizard Brain - PHPJHB15
Journey into your Lizard Brain - PHPJHB15Journey into your Lizard Brain - PHPJHB15
Journey into your Lizard Brain - PHPJHB15
 
A journey into your Lizard Brain
A journey into your Lizard BrainA journey into your Lizard Brain
A journey into your Lizard Brain
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Composer for Busy Developers - php|tek13