SlideShare une entreprise Scribd logo
1  sur  175
Télécharger pour lire hors ligne
Composer
Game Changing Dependency Management

TechCamp Memphis 2013

Saturday, November 2, 13

Jeremy Kendall
Saturday, November 2, 13
I love to code

Saturday, November 2, 13
I love to code
I’m terribly forgetful

Saturday, November 2, 13
I love to code
I’m terribly forgetful
I take pictures

Saturday, November 2, 13
I love to code
I’m terribly forgetful
I take pictures
I work at OpenSky

Saturday, November 2, 13
Adding Dependencies is Easy

Saturday, November 2, 13
Adding Dependencies is Easy
‣

Saturday, November 2, 13

Copy and Paste
Adding Dependencies is Easy
‣
DIY Solution
‣

Copy and Paste

Saturday, November 2, 13
Adding Dependencies is Easy
‣
DIY Solution
‣
SVN Externals
‣

Copy and Paste

Saturday, November 2, 13
Adding Dependencies is Easy
‣
DIY Solution
‣
SVN Externals
‣
Git Submodules
‣
Copy and Paste

Saturday, November 2, 13
Managing them is Messy

Saturday, November 2, 13
What is Composer?

Saturday, November 2, 13
What is Composer?
‣

Saturday, November 2, 13

Dependency management tool
What is Composer?
‣
Per-project
‣

Dependency management tool

Saturday, November 2, 13
What is Composer?
‣
Per-project
‣
Inspired by:
‣

Dependency management tool

Saturday, November 2, 13
What is Composer?
‣
Per-project
‣
Inspired by:
‣
node’s npm
‣

Dependency management tool

Saturday, November 2, 13
What is Composer?
‣
Per-project
‣
Inspired by:
‣
node’s npm
‣
ruby’s bundler
‣

Dependency management tool

Saturday, November 2, 13
Benefits

Saturday, November 2, 13
Benefits
‣

Saturday, November 2, 13

Easily declare project dependencies
Benefits
‣
Updating dependency versions extremely simple
‣
Easily declare project dependencies

Saturday, November 2, 13
Benefits
‣
Updating dependency versions extremely simple
‣
Ensures your team is on the same page
‣
Easily declare project dependencies

Saturday, November 2, 13
Benefits
‣
Updating dependency versions extremely simple
‣
Ensures your team is on the same page
‣
Tons of excellent related features
‣
Easily declare project dependencies

Saturday, November 2, 13
Installing

Saturday, November 2, 13
Installing Locally
In your project:

Saturday, November 2, 13

$ curl -sS https://getcomposer.org/installer | php
Installing Locally
In your project:

Specify a directory:

Saturday, November 2, 13

$ curl -sS https://getcomposer.org/installer | php

$ curl -sS https://getcomposer.org/installer | php -- --install-dir=bin
Installing Locally
In your project:

Specify a directory:

What you’ll see:

$ curl -sS https://getcomposer.org/installer | php

$ curl -sS https://getcomposer.org/installer | php -- --install-dir=bin

$ curl -sS https://getcomposer.org/installer | php
#!/usr/bin/env php
All settings correct for using Composer
Downloading...
Composer successfully installed to: /Users/jkendall/dev/
composer.phar
Use it: php composer.phar

Saturday, November 2, 13
Installing Globally
Recommended
$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer

Saturday, November 2, 13
Installing Globally
Recommended
$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer

(You might need to use sudo)

Saturday, November 2, 13
(There’s an installer for
Windows folks)

Saturday, November 2, 13
Keeping up to Date
$ php composer.phar self-update
You are using the latest composer version.

or
$ composer self-update
You are using the latest composer version.

Saturday, November 2, 13
Keeping up to Date
$ php composer.phar self-update
You are using the latest composer version.

or
$ composer self-update
You are using the latest composer version.

(Always updates to the latest dev-master)

Saturday, November 2, 13
Defining Dependencies

Saturday, November 2, 13
composer.json
{
"require": {
"monolog/monolog": "1.6.*"
}
}

Saturday, November 2, 13
composer.json
{
"require": {
"monolog/monolog": "1.6.*"
}
}

‣Place in the root of your project

Saturday, November 2, 13
composer.json
{
"require": {
"monolog/monolog": "1.6.*"
}
}

‣Place in the root of your project
‣“require” specifies package and version

Saturday, November 2, 13
composer.json
{
"require": {
"monolog/monolog": "1.6.*"
}
}

‣Place in the root of your project
‣“require” specifies package and version
‣monolog logging library

Saturday, November 2, 13
composer.json
{
"require": {
"monolog/monolog": "1.6.*"
}
}

‣Place in the root of your project
‣“require” specifies package and version
‣monolog logging library
‣Version >= 1.6.0 and < 1.7
Saturday, November 2, 13
composer.json
{
"require": {
"monolog/monolog": "1.6.*"
}
}

‣Place in the root of your project
‣“require” specifies package and version
‣monolog logging library
‣Version >= 1.6.0 and < 1.7
‣No fuss, no muss
Saturday, November 2, 13
Versions

Saturday, November 2, 13
Versions
‣

Saturday, November 2, 13

Exact version: 1.0.0, 12.2.4, etc.
Versions
‣
Wildcard: 3.*, 4.2.*
‣

Exact version: 1.0.0, 12.2.4, etc.

Saturday, November 2, 13
Versions
‣
Wildcard: 3.*, 4.2.*
‣
Range: >, >=, <=, !=
‣

Exact version: 1.0.0, 12.2.4, etc.

Saturday, November 2, 13
Versions
‣
Wildcard: 3.*, 4.2.*
‣
Range: >, >=, <=, !=
‣
Example: >=2.4
‣

Exact version: 1.0.0, 12.2.4, etc.

Saturday, November 2, 13
Versions
‣
Wildcard: 3.*, 4.2.*
‣
Range: >, >=, <=, !=
‣
Example: >=2.4
‣
Range: >=1.0,<1.7 (comma separated)
‣
Exact version: 1.0.0, 12.2.4, etc.

Saturday, November 2, 13
Versions
‣
Wildcard: 3.*, 4.2.*
‣
Range: >, >=, <=, !=
‣
Example: >=2.4
‣
Range: >=1.0,<1.7 (comma separated)
‣
Next Significant Release: ~1.3.3
‣
Exact version: 1.0.0, 12.2.4, etc.

Saturday, November 2, 13
Installing Dependencies
composer install
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing psr/log (1.0.0)
Loading from cache
- Installing monolog/monolog (1.6.0)
Loading from cache
monolog/monolog suggests installing
monolog/monolog suggests installing
monolog/monolog suggests installing
monolog/monolog suggests installing
Writing lock file
Generating autoload files

Saturday, November 2, 13

mlehner/gelf-php (Allow sending log messages to a GrayLog2 server)
raven/raven (Allow sending log messages to a Sentry server)
doctrine/couchdb (Allow sending log messages to a CouchDB server)
ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
composer.lock

Saturday, November 2, 13
composer.lock
‣

Saturday, November 2, 13

install writes a dependency lock file
composer.lock
‣
List of exact versions installed
‣

install writes a dependency lock file

Saturday, November 2, 13
composer.lock
‣
List of exact versions installed
‣
Commit both composer.lock and composer.json
‣
install writes a dependency lock file

Saturday, November 2, 13
composer.lock
‣
List of exact versions installed
‣
Commit both composer.lock and composer.json
‣
install writes a dependency lock file

‣ composer

install now checks the lock file, not

composer.json

Saturday, November 2, 13
composer.lock
‣
List of exact versions installed
‣
Commit both composer.lock and composer.json
‣
install writes a dependency lock file

‣ composer

install now checks the lock file, not

composer.json

‣
Saturday, November 2, 13

Update dependencies with composer update
Updating Dependencies

Saturday, November 2, 13
Updating Dependencies
{
"require": {
"monolog/monolog": "1.6.*@dev"
}
}

Saturday, November 2, 13
Updating Dependencies
{
"require": {
"monolog/monolog": "1.6.*@dev"
}
}

‣Updates monolog library version

Saturday, November 2, 13
Updating Dependencies
{
"require": {
"monolog/monolog": "1.6.*@dev"
}
}

‣Updates monolog library version
‣Version >= 1.6.0 and < 1.7 (dev)
Saturday, November 2, 13
Updating Dependencies
composer update
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing monolog/monolog (1.5.0)
- Installing monolog/monolog (dev-master c933bb6)
Cloning c933bb67a8a2e45c42d0626a0cd6569789bf6ed7
Writing lock file
Generating autoload files

Saturday, November 2, 13
Updating Dependencies
composer update
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing monolog/monolog (1.5.0)
- Installing monolog/monolog (dev-master c933bb6)
Cloning c933bb67a8a2e45c42d0626a0cd6569789bf6ed7
Writing lock file
Generating autoload files

‣Reads from composer.json

Saturday, November 2, 13
Updating Dependencies
composer update
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing monolog/monolog (1.5.0)
- Installing monolog/monolog (dev-master c933bb6)
Cloning c933bb67a8a2e45c42d0626a0cd6569789bf6ed7
Writing lock file
Generating autoload files

‣Reads from composer.json
‣Updates dependencies
Saturday, November 2, 13
Updating Dependencies
composer update
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing monolog/monolog (1.5.0)
- Installing monolog/monolog (dev-master c933bb6)
Cloning c933bb67a8a2e45c42d0626a0cd6569789bf6ed7
Writing lock file
Generating autoload files

‣Reads from composer.json
‣Updates dependencies
‣Rewrites lock file
Saturday, November 2, 13
Adding New Dependencies
Edit composer.json . . .
{
"require": {
"monolog/monolog": "1.6.*@dev",
"ircmaxell/password-compat": "1.0.3"

}
}

Saturday, November 2, 13
Adding New Dependencies
Or use the command line
composer require
$ composer require ircmaxell/password-compat:1.0.3
composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing ircmaxell/password-compat (1.0.3)
Downloading: 100%
Writing lock file
Generating autoload files

Saturday, November 2, 13
Autoloading

Saturday, November 2, 13
Autoloading
‣

Saturday, November 2, 13

Composer generates vendor/autoload.php
Autoloading
‣
Add require ‘vendor/autoload.php’;
‣

Composer generates vendor/autoload.php

Saturday, November 2, 13
Autoloading
‣
Add require ‘vendor/autoload.php’;
‣
Immediately begin using your dependencies
‣

Composer generates vendor/autoload.php

Saturday, November 2, 13
Autoloading
Don’t forget to add your own code!
{
"require": {
"monolog/monolog": "1.6.*@dev"
},
"autoload": {
"psr-0": {
"Beeblebrox": "src/"
}
}
}

Saturday, November 2, 13
Autoloading
Pro Tip
Grab an autoloader instance and
add more namespaces.
$loader = require 'vendor/autoload.php';
$loader->add('AcmeTest', __DIR__);

Saturday, November 2, 13
Kickstart a Project
composer create-project
$ composer create-project slim/slim-skeleton super-sweet-application
Installing slim/slim-skeleton (1.1.0)
- Installing slim/slim-skeleton (1.1.0)
Downloading: 100%
Created project in super-sweet-application
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing slim/slim (2.3.0)
Downloading: 100%
- Installing slim/extras (2.0.3)
Loading from cache
- Installing twig/twig (v1.13.1)
Loading from cache
Writing lock file
Generating autoload files

Saturday, November 2, 13
Little Bobby Tables as a Service
composer create-project jeremykendall/lbtaas lbtaas

Saturday, November 2, 13
Little Bobby Tables as a Service
http://lbtaas.dev

{
"status":"success",
"data":{
"name":"Exploits of a Mom",
"permalink":"http://xkcd.com/327/",
"image":"http://imgs.xkcd.com/comics/exploits_of_a_mom.png"
}
}

Saturday, November 2, 13
Your Very Own Library

Saturday, November 2, 13
Libraries

Saturday, November 2, 13
Libraries
‣

Saturday, November 2, 13

Everyone has written a library of some sort
Libraries
‣
Making up examples is not my strong suit
‣

Everyone has written a library of some sort

Saturday, November 2, 13
Libraries
‣
Making up examples is not my strong suit
‣
Let’s walk through a real library . . .
‣

Everyone has written a library of some sort

Saturday, November 2, 13
Libraries
‣
Making up examples is not my strong suit
‣
Let’s walk through a real library . . .
‣
. . . and check out some awesome Composer features
‣
Everyone has written a library of some sort

Saturday, November 2, 13
PHP Domain Parser

https://github.com/jeremykendall/php-domain-parser
Saturday, November 2, 13
{

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
Saturday, November 2, 13

"name": "jeremykendall/php-domain-parser",
"description": "Public Suffix List based URL parsing implemented in PHP.",
"license": "MIT",
"authors": [
{
"name": "Jeremy Kendall",
"homepage": "http://about.me/jeremykendall",
"role": "Developer"
}
],
"bin": ["bin/pdp-psl"],
"keywords": ["Public Suffix List", "domain parsing", "url parsing"],
"require": {
"php": ">=5.3.0",
"ext-curl": "*"
},
"require-dev": {
	 "mikey179/vfsStream": "1.1.*",
	 "jeremykendall/phpctagger": "0.0.*"
},
"autoload": {
	 "psr-0":
	 	 {
	 	 "Pdp": "library/"
	 }
},
"scripts": {
	 "post-install-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ],
	 "post-update-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ]
}
{
"name": "jeremykendall/php-domain-parser",
"description": "Public Suffix List based URL parsing implemented in PHP.",
"license": "MIT",
"authors": [
{
"name": "Jeremy Kendall",
"homepage": "http://about.me/jeremykendall",
"role": "Developer"
}
],
"bin": ["bin/pdp-psl"],
"keywords": ["Public Suffix List", "domain parsing", "url parsing"],
"require": {
"php": ">=5.3.0",
"ext-curl": "*"
},
"require-dev": {
	 "mikey179/vfsStream": "1.1.*",
	 "jeremykendall/phpctagger": "0.0.*"
},
"autoload": {
	 "psr-0":
	 	 {
	 	 "Pdp": "library/"
	 }
},
"scripts": {
	 "post-install-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ],
	 "post-update-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ]
}

Package requirements

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
Saturday, November 2, 13
{
"name": "jeremykendall/php-domain-parser",
"description": "Public Suffix List based URL parsing implemented in PHP.",
"license": "MIT",
"authors": [
{
"name": "Jeremy Kendall",
"homepage": "http://about.me/jeremykendall",
"role": "Developer"
}
],
"bin": ["bin/pdp-psl"],
"keywords": ["Public Suffix List", "domain parsing", "url parsing"],
"require": {
"php": ">=5.3.0",
"ext-curl": "*"
},
"require-dev": {
	 "mikey179/vfsStream": "1.1.*",
	 "jeremykendall/phpctagger": "0.0.*"
},
"autoload": {
	 "psr-0":
	 	 {
	 	 "Pdp": "library/"
	 }
},
"scripts": {
	 "post-install-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ],
	 "post-update-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ]
}

Package requirements

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
Saturday, November 2, 13

Autoloading
{
"name": "jeremykendall/php-domain-parser",
"description": "Public Suffix List based URL parsing implemented in PHP.",
"license": "MIT",
"authors": [
{
"name": "Jeremy Kendall",
"homepage": "http://about.me/jeremykendall",
"role": "Developer"
}
],
"bin": ["bin/pdp-psl"],
"keywords": ["Public Suffix List", "domain parsing", "url parsing"],
"require": {
"php": ">=5.3.0",
"ext-curl": "*"
},
"require-dev": {
	 "mikey179/vfsStream": "1.1.*",
	 "jeremykendall/phpctagger": "0.0.*"
},
"autoload": {
	 "psr-0":
	 	 {
	 	 "Pdp": "library/"
	 }
},
"scripts": {
	 "post-install-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ],
	 "post-update-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ]
}

Add the “name” key
and it’s installable

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
Saturday, November 2, 13
{
"name": "jeremykendall/php-domain-parser",
"description": "Public Suffix List based URL parsing implemented in PHP.",
"license": "MIT",
"authors": [
{
"name": "Jeremy Kendall",
"homepage": "http://about.me/jeremykendall",
"role": "Developer"
}
],
"bin": ["bin/pdp-psl"],
"keywords": ["Public Suffix List", "domain parsing", "url parsing"],
"require": {
"php": ">=5.3.0",
"ext-curl": "*"
},
"require-dev": {
	 "mikey179/vfsStream": "1.1.*",
	 "jeremykendall/phpctagger": "0.0.*"
},
"autoload": {
	 "psr-0":
	 	 {
	 	 "Pdp": "library/"
	 }
},
"scripts": {
	 "post-install-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ],
	 "post-update-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ]
}

Additional
metadata

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
Saturday, November 2, 13
{
"name": "jeremykendall/php-domain-parser",
"description": "Public Suffix List based URL parsing implemented in PHP.",
"license": "MIT",
"authors": [
{
"name": "Jeremy Kendall",
"homepage": "http://about.me/jeremykendall",
"role": "Developer"
}
],
"bin": ["bin/pdp-psl"],
"keywords": ["Public Suffix List", "domain parsing", "url parsing"],
"require": {
"php": ">=5.3.0",
"ext-curl": "*"
},
"require-dev": {
	 "mikey179/vfsStream": "1.1.*",
	 "jeremykendall/phpctagger": "0.0.*"
},
"autoload": {
	 "psr-0":
	 	 {
	 	 "Pdp": "library/"
	 }
},
"scripts": {
	 "post-install-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ],
	 "post-update-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ]
}

Don’t forget the license!

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
Saturday, November 2, 13
{
"name": "jeremykendall/php-domain-parser",
"description": "Public Suffix List based URL parsing implemented in PHP.",
"license": "MIT",
"authors": [
{
"name": "Jeremy Kendall",
"homepage": "http://about.me/jeremykendall",
"role": "Developer"
}
],
"bin": ["bin/pdp-psl"],
"keywords": ["Public Suffix List", "domain parsing", "url parsing"],
"require": {
"php": ">=5.3.0",
"ext-curl": "*"
},
"require-dev": {
	 "mikey179/vfsStream": "1.1.*",
	 "jeremykendall/phpctagger": "0.0.*"
},
"autoload": {
	 "psr-0":
	 	 {
	 	 "Pdp": "library/"
	 }
},
"scripts": {
	 "post-install-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ],
	 "post-update-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ]
}

Full fledged library!

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
Saturday, November 2, 13
Now for the cool(er)
stuff . . .

Saturday, November 2, 13
{

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
Saturday, November 2, 13

"name": "jeremykendall/php-domain-parser",
"description": "Public Suffix List based URL parsing implemented in PHP.",
"license": "MIT",
"authors": [
{
"name": "Jeremy Kendall",
"homepage": "http://about.me/jeremykendall",
"role": "Developer"
}
],
"bin": ["bin/pdp-psl"],
"keywords": ["Public Suffix List", "domain parsing", "url parsing"],
"require": {
"php": ">=5.3.0",
"ext-curl": "*"
},
"require-dev": {
	 "mikey179/vfsStream": "1.1.*",
	 "jeremykendall/phpctagger": "0.0.*"
},
"autoload": {
	 "psr-0":
	 	 {
	 	 "Pdp": "library/"
	 }
},
"scripts": {
	 "post-install-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ],
	 "post-update-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ]
}

require-dev
require-dev

Saturday, November 2, 13
require-dev
‣

Saturday, November 2, 13

Lists packages required for development (think tests)
require-dev
‣
Only applies to the root package
‣

Lists packages required for development (think tests)

Saturday, November 2, 13
require-dev
‣
Only applies to the root package
‣
Both install and update install require-dev by default
‣
Lists packages required for development (think tests)

Saturday, November 2, 13
require-dev
‣
Only applies to the root package
‣
Both install and update install require-dev by default
‣
(Use the --no-dev flag to skip installing dev
‣ dependencies)
Lists packages required for development (think tests)

Saturday, November 2, 13
{
"name": "jeremykendall/php-domain-parser",
"description": "Public Suffix List based URL parsing implemented in PHP.",
"license": "MIT",
"authors": [
{
"name": "Jeremy Kendall",
"homepage": "http://about.me/jeremykendall",
"role": "Developer"
}
],

"bin": ["bin/pdp-psl"],

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
Saturday, November 2, 13

bin

"keywords": ["Public Suffix List", "domain parsing", "url parsing"],
"require": {
"php": ">=5.3.0",
"ext-curl": "*"
},
"require-dev": {
	 "mikey179/vfsStream": "1.1.*",
	 "jeremykendall/phpctagger": "0.0.*"
},
"autoload": {
	 "psr-0":
	 	 {
	 	 "Pdp": "library/"
	 }
},
"scripts": {
	 "post-install-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ],
	 "post-update-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ]
}
bin

Saturday, November 2, 13
bin
‣

Saturday, November 2, 13

cli scripts to pass along to package users
bin
‣
A set of files that should be treated as binaries
‣
cli scripts to pass along to package users

Saturday, November 2, 13
bin
‣
A set of files that should be treated as binaries
‣
Installs binaries to vendor/bin for any project that
‣ depends on your project
cli scripts to pass along to package users

Saturday, November 2, 13
bin
‣
A set of files that should be treated as binaries
‣
Installs binaries to vendor/bin for any project that
‣ depends on your project
cli scripts to pass along to package users

‣

Saturday, November 2, 13

php-domain-parser uses a bin to update the local copy
of the public suffix list
{

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
Saturday, November 2, 13

"name": "jeremykendall/php-domain-parser",
"description": "Public Suffix List based URL parsing implemented in PHP.",
"license": "MIT",
"authors": [
{
"name": "Jeremy Kendall",
"homepage": "http://about.me/jeremykendall",
"role": "Developer"
}
],
"bin": ["bin/pdp-psl"],
"keywords": ["Public Suffix List", "domain parsing", "url parsing"],
"require": {
"php": ">=5.3.0",
"ext-curl": "*"
},
"require-dev": {
	 "mikey179/vfsStream": "1.1.*",
	 "jeremykendall/phpctagger": "0.0.*"
},
"autoload": {
	 "psr-0":
	 	 {
	 	 "Pdp": "library/"
	 }
},
"scripts": {
	 "post-install-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ],
	 "post-update-cmd": [
	 	 "PhpCtaggerComposerScriptCtagger::ctag"
	 ]
}

scripts
scripts

Saturday, November 2, 13
scripts
‣

Saturday, November 2, 13

Used to execute custom code during the Composer
execution process
scripts
‣
‣

Saturday, November 2, 13

Used to execute custom code during the Composer
execution process
PHP callback (defined as a static method) . . .
scripts
‣

Used to execute custom code during the Composer
execution process

‣
. . . or any command-line executable command
‣
PHP callback (defined as a static method) . . .

Saturday, November 2, 13
scripts
‣

Used to execute custom code during the Composer
execution process

‣
. . . or any command-line executable command
‣
Only scripts defined in the root composer.json are
‣ executed
PHP callback (defined as a static method) . . .

Saturday, November 2, 13
scripts
‣

Used to execute custom code during the Composer
execution process

‣
. . . or any command-line executable command
‣
Only scripts defined in the root composer.json are
‣ executed
PHP callback (defined as a static method) . . .

‣
Saturday, November 2, 13

If a script is defined in a dependency, you can use it in
your composer.json
scripts

Saturday, November 2, 13
scripts
‣

Saturday, November 2, 13

Composer fires “named events” during execution
scripts
‣
Named events include:
‣

Composer fires “named events” during execution

Saturday, November 2, 13
scripts
‣
Named events include:
‣
pre- and post-install-cmd
‣

Composer fires “named events” during execution

Saturday, November 2, 13
scripts
‣
Named events include:
‣
pre- and post-install-cmd
‣
pre- and post-update-cmd
‣

Composer fires “named events” during execution

Saturday, November 2, 13
scripts
‣
Named events include:
‣
pre- and post-install-cmd
‣
pre- and post-update-cmd
‣
post-root-package-install
‣

Composer fires “named events” during execution

Saturday, November 2, 13
scripts
‣
Named events include:
‣
pre- and post-install-cmd
‣
pre- and post-update-cmd
‣
post-root-package-install
‣
Many more . . .
‣

Composer fires “named events” during execution

Saturday, November 2, 13
Running scripts

Saturday, November 2, 13
Running scripts
Execute Composer (script will execute if the named
event is triggered) or . . .

Saturday, November 2, 13
Running scripts
Execute Composer (script will execute if the named
event is triggered) or . . .

Saturday, November 2, 13
Running scripts
Execute Composer (script will execute if the named
event is triggered) or . . .
composer run-script <named event>

Saturday, November 2, 13
Example
public static function create(Event $event)
{
$dir = dirname($event->getComposer()->getConfig()->get('vendor-dir'));
$io = $event->getIO();
$io->write('Reviewing your Flaming Archer environment . . .', true);
$configExists = file_exists($dir . '/config.php');
$configDistExists = file_exists($dir . '/config-dist.php');
if (!$configExists && $configDistExists) {
$io->write('Creating config.php by copying config-dist.php . . .', true);
copy($dir . '/config-dist.php', $dir . '/config.php');
$io->write("Done! Please edit config.php.", true);
} else {
$io->write('Found config.php.', true);
}
}

https://github.com/jeremykendall/flaming-archer/blob/develop/library/Fa/Composer/Script/Config.php
Saturday, November 2, 13
You’ve built your library.
Now what?

Saturday, November 2, 13
Push it to a VCS

Saturday, November 2, 13
Push it to a VCS
‣

Saturday, November 2, 13

git, svn, or hg all work equally well
Push it to a VCS
‣
For the sake of simplicity I’ll assume git/github
‣
git, svn, or hg all work equally well

Saturday, November 2, 13
Push it to a VCS
‣
For the sake of simplicity I’ll assume git/github
‣
Package versions:
‣
git, svn, or hg all work equally well

Saturday, November 2, 13
Push it to a VCS
‣
For the sake of simplicity I’ll assume git/github
‣
Package versions:
‣
Tags are package versions (1.0.0, v2.5.4, etc)
‣
git, svn, or hg all work equally well

Saturday, November 2, 13
Push it to a VCS
‣
For the sake of simplicity I’ll assume git/github
‣
Package versions:
‣
Tags are package versions (1.0.0, v2.5.4, etc)
‣
Branches are dev versions (dev-{branchname},
‣ {branchname}-dev)
git, svn, or hg all work equally well

Saturday, November 2, 13
Push it to a VCS
‣
For the sake of simplicity I’ll assume git/github
‣
Package versions:
‣
Tags are package versions (1.0.0, v2.5.4, etc)
‣
Branches are dev versions (dev-{branchname},
‣ {branchname}-dev)
git, svn, or hg all work equally well

‣
Saturday, November 2, 13

For this reason, I strongly recommend using semantic
versioning: http://semver.org
Share!

Saturday, November 2, 13
Packagist

Saturday, November 2, 13
Packagist

Saturday, November 2, 13
Packagist
‣

Saturday, November 2, 13

The main package repository for Composer
Packagist
‣
(Aside: Search Packagist before “rolling your own”)
‣
The main package repository for Composer

Saturday, November 2, 13
Packagist
‣
(Aside: Search Packagist before “rolling your own”)
‣
Packages published there need no special settings in
‣ composer.json to be installable (see “repositories” key)
The main package repository for Composer

Saturday, November 2, 13
Packagist
‣
(Aside: Search Packagist before “rolling your own”)
‣
Packages published there need no special settings in
‣ composer.json to be installable (see “repositories” key)
The main package repository for Composer

‣

Saturday, November 2, 13

Submitting is dead simple
Packagist
‣
(Aside: Search Packagist before “rolling your own”)
‣
Packages published there need no special settings in
‣ composer.json to be installable (see “repositories” key)
The main package repository for Composer

‣
Create account, hit big green submit button
‣
Submitting is dead simple

Saturday, November 2, 13
Packagist

Saturday, November 2, 13
Packagist: Package Search

Saturday, November 2, 13
Packagist: Keyword Search

Saturday, November 2, 13
Packagist: Package

Saturday, November 2, 13
But what about internal
proprietary packages?

Saturday, November 2, 13
Satis to the Rescue

Saturday, November 2, 13
Satis to the Rescue
‣

Saturday, November 2, 13

Static composer repository generator
Satis to the Rescue
‣
Lightweight, static file based version of Packagist
‣
Static composer repository generator

Saturday, November 2, 13
Satis to the Rescue
‣
Lightweight, static file based version of Packagist
‣
Simple to configure
‣
Static composer repository generator

Saturday, November 2, 13
Satis to the Rescue
‣
Lightweight, static file based version of Packagist
‣
Simple to configure
‣
Flexible
‣
Static composer repository generator

Saturday, November 2, 13
composer create-project composer/satis --stability=dev

$ composer create-project composer/satis --stability=dev --keep-vcs
Installing composer/satis (dev-master 059588ef0fd0977964ad13637e02012519686202)
- Installing composer/satis (dev-master master)
Cloning master
Created project in /Users/jkendall/dev/satis
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json . . .
- Installing symfony/process (dev-master 75c8101)
Cloning 75c810176f8e069714cef8696d7ecc3aa86e8168
- [ . . . ]
- Installing twig/twig (v1.13.1)
Loading from cache
symfony/console suggests installing symfony/event-dispatcher ()
Generating autoload files

Saturday, November 2, 13
Satis config.json
{
"name": "Satis Demo",
"homepage": "http://satis.dev",
"repositories": [
{ "type": "vcs", "url": "https://github.com/jeremykendall/php-domain-parser" },
{ "type": "vcs", "url": "https://github.com/jeremykendall/phpctagger" }
],
"require": {
"jeremykendall/php-domain-parser": ">=0.0.5",
"jeremykendall/phpctagger": ">0.0.6"
},
"archive": {
"directory": "dist",
"format": "tar"
}
}

Saturday, November 2, 13
Satis config.json
{
"name": "Satis Demo",
"homepage": "http://satis.dev",
"repositories": [
{ "type": "vcs", "url": "https://github.com/jeremykendall/php-domain-parser" },
{ "type": "vcs", "url": "https://github.com/jeremykendall/phpctagger" }
],
"require": {
"jeremykendall/php-domain-parser": ">=0.0.5",
"jeremykendall/phpctagger": ">0.0.6"
},
"archive": {
"directory": "dist",
"format": "tar"
}
}

Saturday, November 2, 13
Satis config.json
{
"name": "Satis Demo",
"homepage": "http://satis.dev",
"repositories": [
{ "type": "vcs", "url": "https://github.com/jeremykendall/php-domain-parser" },
{ "type": "vcs", "url": "https://github.com/jeremykendall/phpctagger" }
],
"require": {
"jeremykendall/php-domain-parser": ">=0.0.5",
"jeremykendall/phpctagger": ">0.0.6"
},
"archive": {
"directory": "dist",
"format": "tar"
}
}

Saturday, November 2, 13
Satis config.json
{
"name": "Satis Demo",
"homepage": "http://satis.dev",
"repositories": [
{ "type": "vcs", "url": "https://github.com/jeremykendall/php-domain-parser" },
{ "type": "vcs", "url": "https://github.com/jeremykendall/phpctagger" }
],
"require": {
"jeremykendall/php-domain-parser": ">=0.0.5",
"jeremykendall/phpctagger": ">0.0.6"
},
"archive": {
"directory": "dist",
"format": "tar"
}
}

Saturday, November 2, 13
Satis config.json
{
"name": "Satis Demo",
"homepage": "http://satis.dev",
"repositories": [
{ "type": "vcs", "url": "https://github.com/jeremykendall/php-domain-parser" },
{ "type": "vcs", "url": "https://github.com/jeremykendall/phpctagger" }
],
"require": {
"jeremykendall/php-domain-parser": ">=0.0.5",
"jeremykendall/phpctagger": ">0.0.6"
},
"archive": {
"directory": "dist",
"format": "tar"
}
}

Saturday, November 2, 13
Build Repo
$ php bin/satis build config.json web/

Saturday, November 2, 13
composer.json
{
"repositories": [
{ "type": "composer", "url": "http://satis.dev" }
],
"require": {
"jeremykendall/php-domain-parser": "0.0.7"
}
}

Saturday, November 2, 13
composer.json
{
"repositories": [
{ "type": "composer", "url": "http://satis.dev" }
],
"require": {
"jeremykendall/php-domain-parser": "0.0.7"
}
}

Saturday, November 2, 13
composer.json
{
"repositories": [
{ "type": "composer", "url": "http://satis.dev" }
],
"require": {
"jeremykendall/php-domain-parser": "0.0.7"
}
}

Saturday, November 2, 13
Satis Demo Project

Saturday, November 2, 13
Satis Demo Project
‣

Saturday, November 2, 13

Want to goof around with Satis?
Satis Demo Project
‣
See: https://github.com/jeremykendall/satis-demo
‣
Want to goof around with Satis?

Saturday, November 2, 13
Satis Demo Project
‣
See: https://github.com/jeremykendall/satis-demo
‣
Clone, follow instructions in README, and WIN
‣
Want to goof around with Satis?

Saturday, November 2, 13
Satis Demo Project
‣
See: https://github.com/jeremykendall/satis-demo
‣
Clone, follow instructions in README, and WIN
‣
Satis really is dead simple to set up
‣
Want to goof around with Satis?

Saturday, November 2, 13
Parting Tips and Tricks

Saturday, November 2, 13
composer install --no-dev --prefer-dist --optimize-autoloader

Saturday, November 2, 13
“example/package”: “2.3.x-dev#5aec89a”

Saturday, November 2, 13
Non-Composer and PEAR packages can be installed
(see “repositories” key documentation)

Saturday, November 2, 13
archive key

Saturday, November 2, 13
http://getcomposer.org
#composer on irc.freenode.org

Saturday, November 2, 13
There’s So Much More!

Saturday, November 2, 13
Credits

Saturday, November 2, 13
Credits
‣

Thanks to TechCamp for having me

IMMA LET YOU FINISH,
BUT RAFAEL DOHMS
HAS THE BEST
COMPOSER TALK OF
ALL TIME.
Saturday, November 2, 13
Credits

Saturday, November 2, 13
Credits
‣

Saturday, November 2, 13

Thanks to Rafael Dohms, the Composer presenter
Credits
‣
Thanks to TechCamp for having me
‣

Thanks to Rafael Dohms, the Composer presenter

Saturday, November 2, 13
Credits
‣
Thanks to TechCamp for having me
‣
Thanks to Jordi Boggiano, Nils Adermann, and the
‣ community for an amazing project (and all the

Thanks to Rafael Dohms, the Composer presenter

documentation I cribbed from)

Saturday, November 2, 13
Credits
‣
Thanks to TechCamp for having me
‣
Thanks to Jordi Boggiano, Nils Adermann, and the
‣ community for an amazing project (and all the

Thanks to Rafael Dohms, the Composer presenter

documentation I cribbed from)

‣
Saturday, November 2, 13

Thanks to our sponsors for help making this happen
Credits
‣
Thanks to TechCamp for having me
‣
Thanks to Jordi Boggiano, Nils Adermann, and the
‣ community for an amazing project (and all the

Thanks to Rafael Dohms, the Composer presenter

documentation I cribbed from)

‣
Thanks to all of you for being here
‣

Thanks to our sponsors for help making this happen

Saturday, November 2, 13
Thanks!
jeremy@jeremykendall.net
http://about.me/jeremykendall
@jeremykendall
http://365.jeremykendall.net

Saturday, November 2, 13

Contenu connexe

Tendances

There's Nothing so Permanent as Temporary
There's Nothing so Permanent as TemporaryThere's Nothing so Permanent as Temporary
There's Nothing so Permanent as TemporaryPositive Hack Days
 
Developing OpenResty Framework
Developing OpenResty FrameworkDeveloping OpenResty Framework
Developing OpenResty FrameworkAapo Talvensaari
 
Running PHP on a Java container
Running PHP on a Java containerRunning PHP on a Java container
Running PHP on a Java containernetinhoteixeira
 
Debugging Your Plone Site
Debugging Your Plone SiteDebugging Your Plone Site
Debugging Your Plone Sitecdw9
 
44CON London 2015 - reverse reverse engineering
44CON London 2015 - reverse reverse engineering44CON London 2015 - reverse reverse engineering
44CON London 2015 - reverse reverse engineering44CON
 
Ember.js Module Loading
Ember.js Module LoadingEmber.js Module Loading
Ember.js Module LoadingMatthew Beale
 
톰캣 #02-설치환경
톰캣 #02-설치환경톰캣 #02-설치환경
톰캣 #02-설치환경GyuSeok Lee
 
Using React for the Mobile Web
Using React for the Mobile WebUsing React for the Mobile Web
Using React for the Mobile WebC4Media
 
Be a microservices hero
Be a microservices heroBe a microservices hero
Be a microservices heroOpenRestyCon
 
Debugging PHP With Xdebug
Debugging PHP With XdebugDebugging PHP With Xdebug
Debugging PHP With XdebugMark Niebergall
 
徒手打造自己的粉專客服機器人
徒手打造自己的粉專客服機器人 徒手打造自己的粉專客服機器人
徒手打造自己的粉專客服機器人 Sasaya Hu
 
Angular js活用事例:filydoc
Angular js活用事例:filydocAngular js活用事例:filydoc
Angular js活用事例:filydocKeiichi Kobayashi
 
Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Tatsuhiko Miyagawa
 
Developing OpenResty Framework
Developing OpenResty FrameworkDeveloping OpenResty Framework
Developing OpenResty FrameworkOpenRestyCon
 

Tendances (20)

There's Nothing so Permanent as Temporary
There's Nothing so Permanent as TemporaryThere's Nothing so Permanent as Temporary
There's Nothing so Permanent as Temporary
 
Front-end tools
Front-end toolsFront-end tools
Front-end tools
 
Transforming WebSockets
Transforming WebSocketsTransforming WebSockets
Transforming WebSockets
 
Developing OpenResty Framework
Developing OpenResty FrameworkDeveloping OpenResty Framework
Developing OpenResty Framework
 
Running PHP on a Java container
Running PHP on a Java containerRunning PHP on a Java container
Running PHP on a Java container
 
Introduction to Kalabox
Introduction to KalaboxIntroduction to Kalabox
Introduction to Kalabox
 
Debugging Your Plone Site
Debugging Your Plone SiteDebugging Your Plone Site
Debugging Your Plone Site
 
44CON London 2015 - reverse reverse engineering
44CON London 2015 - reverse reverse engineering44CON London 2015 - reverse reverse engineering
44CON London 2015 - reverse reverse engineering
 
Ember.js Module Loading
Ember.js Module LoadingEmber.js Module Loading
Ember.js Module Loading
 
톰캣 #02-설치환경
톰캣 #02-설치환경톰캣 #02-설치환경
톰캣 #02-설치환경
 
Using React for the Mobile Web
Using React for the Mobile WebUsing React for the Mobile Web
Using React for the Mobile Web
 
Be a microservices hero
Be a microservices heroBe a microservices hero
Be a microservices hero
 
Debugging PHP With Xdebug
Debugging PHP With XdebugDebugging PHP With Xdebug
Debugging PHP With Xdebug
 
Drupal Development Tips
Drupal Development TipsDrupal Development Tips
Drupal Development Tips
 
GiTFO
GiTFOGiTFO
GiTFO
 
徒手打造自己的粉專客服機器人
徒手打造自己的粉專客服機器人 徒手打造自己的粉專客服機器人
徒手打造自己的粉專客服機器人
 
Auto Build
Auto BuildAuto Build
Auto Build
 
Angular js活用事例:filydoc
Angular js活用事例:filydocAngular js活用事例:filydoc
Angular js活用事例:filydoc
 
Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8
 
Developing OpenResty Framework
Developing OpenResty FrameworkDeveloping OpenResty Framework
Developing OpenResty Framework
 

En vedette

Symfony Camp 2013 UA RESTing with Symfony2
Symfony Camp 2013 UA RESTing with Symfony2Symfony Camp 2013 UA RESTing with Symfony2
Symfony Camp 2013 UA RESTing with Symfony2Lukas Smith
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionJoe Ferguson
 
L'intégration d'e-mails responsive
L'intégration d'e-mails responsiveL'intégration d'e-mails responsive
L'intégration d'e-mails responsiveHTeuMeuLeu
 
Docker for PHP Developers - Jetbrains
Docker for PHP Developers - JetbrainsDocker for PHP Developers - Jetbrains
Docker for PHP Developers - JetbrainsChris Tankersley
 
Rock-solid Magento Deployments (and Development)
Rock-solid Magento Deployments (and Development)Rock-solid Magento Deployments (and Development)
Rock-solid Magento Deployments (and Development)AOE
 
Leaky Bucket & Tocken Bucket - Traffic shaping
Leaky Bucket & Tocken Bucket - Traffic shapingLeaky Bucket & Tocken Bucket - Traffic shaping
Leaky Bucket & Tocken Bucket - Traffic shapingVimal Dewangan
 

En vedette (6)

Symfony Camp 2013 UA RESTing with Symfony2
Symfony Camp 2013 UA RESTing with Symfony2Symfony Camp 2013 UA RESTing with Symfony2
Symfony Camp 2013 UA RESTing with Symfony2
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
L'intégration d'e-mails responsive
L'intégration d'e-mails responsiveL'intégration d'e-mails responsive
L'intégration d'e-mails responsive
 
Docker for PHP Developers - Jetbrains
Docker for PHP Developers - JetbrainsDocker for PHP Developers - Jetbrains
Docker for PHP Developers - Jetbrains
 
Rock-solid Magento Deployments (and Development)
Rock-solid Magento Deployments (and Development)Rock-solid Magento Deployments (and Development)
Rock-solid Magento Deployments (and Development)
 
Leaky Bucket & Tocken Bucket - Traffic shaping
Leaky Bucket & Tocken Bucket - Traffic shapingLeaky Bucket & Tocken Bucket - Traffic shaping
Leaky Bucket & Tocken Bucket - Traffic shaping
 

Similaire à Game Changing Dependency Management

Vinted life embetterment
Vinted life embettermentVinted life embetterment
Vinted life embettermentAgile Lietuva
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...NETWAYS
 
Fosdem 2014 - MySQL & Friends Devroom: 15 tips galera cluster
Fosdem 2014 - MySQL & Friends Devroom: 15 tips galera clusterFosdem 2014 - MySQL & Friends Devroom: 15 tips galera cluster
Fosdem 2014 - MySQL & Friends Devroom: 15 tips galera clusterFrederic Descamps
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Puppet
 
#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and Speed#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and SpeedSalesforce Marketing Cloud
 
Automate Yo'self -- SeaGL
Automate Yo'self -- SeaGL Automate Yo'self -- SeaGL
Automate Yo'self -- SeaGL John Anderson
 
Happy porting x86 application to android
Happy porting x86 application to androidHappy porting x86 application to android
Happy porting x86 application to androidOwen Hsu
 
Scalable Deployment Architectures with TYPO3 Surf, Git and Jenkins
Scalable Deployment Architectures with TYPO3 Surf, Git and JenkinsScalable Deployment Architectures with TYPO3 Surf, Git and Jenkins
Scalable Deployment Architectures with TYPO3 Surf, Git and Jenkinsmhelmich
 
Subversionn Introduction at SuperMondays 2009-09-01
Subversionn Introduction at SuperMondays 2009-09-01Subversionn Introduction at SuperMondays 2009-09-01
Subversionn Introduction at SuperMondays 2009-09-01Alex Kavanagh
 
Composer the right way - DPC15
Composer the right way - DPC15Composer the right way - DPC15
Composer the right way - DPC15Rafael Dohms
 
Composer The Right Way #PHPjhb15
Composer The Right Way #PHPjhb15Composer The Right Way #PHPjhb15
Composer The Right Way #PHPjhb15Rafael Dohms
 
[Nuxeo World 2013] MARKETPLACE PACKAGES - THIBAUD ARGUILLERE
[Nuxeo World 2013] MARKETPLACE PACKAGES - THIBAUD ARGUILLERE[Nuxeo World 2013] MARKETPLACE PACKAGES - THIBAUD ARGUILLERE
[Nuxeo World 2013] MARKETPLACE PACKAGES - THIBAUD ARGUILLERENuxeo
 
Composer The Right Way
Composer The Right WayComposer The Right Way
Composer The Right WayRafael Dohms
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflowRiccardo Coppola
 
Composer the Right Way - PHPSRB16
Composer the Right Way - PHPSRB16Composer the Right Way - PHPSRB16
Composer the Right Way - PHPSRB16Rafael Dohms
 

Similaire à Game Changing Dependency Management (20)

Vinted life embetterment
Vinted life embettermentVinted life embetterment
Vinted life embetterment
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...
 
Cucumber Upgrade
Cucumber UpgradeCucumber Upgrade
Cucumber Upgrade
 
Fosdem 2014 - MySQL & Friends Devroom: 15 tips galera cluster
Fosdem 2014 - MySQL & Friends Devroom: 15 tips galera clusterFosdem 2014 - MySQL & Friends Devroom: 15 tips galera cluster
Fosdem 2014 - MySQL & Friends Devroom: 15 tips galera cluster
 
Smartgears
SmartgearsSmartgears
Smartgears
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...
 
#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and Speed#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and Speed
 
Automate Yo'self -- SeaGL
Automate Yo'self -- SeaGL Automate Yo'self -- SeaGL
Automate Yo'self -- SeaGL
 
Ns-2.35 Installation
Ns-2.35 InstallationNs-2.35 Installation
Ns-2.35 Installation
 
Bundler
BundlerBundler
Bundler
 
Automate Yo' Self
Automate Yo' SelfAutomate Yo' Self
Automate Yo' Self
 
Happy porting x86 application to android
Happy porting x86 application to androidHappy porting x86 application to android
Happy porting x86 application to android
 
Scalable Deployment Architectures with TYPO3 Surf, Git and Jenkins
Scalable Deployment Architectures with TYPO3 Surf, Git and JenkinsScalable Deployment Architectures with TYPO3 Surf, Git and Jenkins
Scalable Deployment Architectures with TYPO3 Surf, Git and Jenkins
 
Subversionn Introduction at SuperMondays 2009-09-01
Subversionn Introduction at SuperMondays 2009-09-01Subversionn Introduction at SuperMondays 2009-09-01
Subversionn Introduction at SuperMondays 2009-09-01
 
Composer the right way - DPC15
Composer the right way - DPC15Composer the right way - DPC15
Composer the right way - DPC15
 
Composer The Right Way #PHPjhb15
Composer The Right Way #PHPjhb15Composer The Right Way #PHPjhb15
Composer The Right Way #PHPjhb15
 
[Nuxeo World 2013] MARKETPLACE PACKAGES - THIBAUD ARGUILLERE
[Nuxeo World 2013] MARKETPLACE PACKAGES - THIBAUD ARGUILLERE[Nuxeo World 2013] MARKETPLACE PACKAGES - THIBAUD ARGUILLERE
[Nuxeo World 2013] MARKETPLACE PACKAGES - THIBAUD ARGUILLERE
 
Composer The Right Way
Composer The Right WayComposer The Right Way
Composer The Right Way
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflow
 
Composer the Right Way - PHPSRB16
Composer the Right Way - PHPSRB16Composer the Right Way - PHPSRB16
Composer the Right Way - PHPSRB16
 

Plus de Jeremy Kendall

Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPJeremy Kendall
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPJeremy Kendall
 
Php 102: Out with the Bad, In with the Good
Php 102: Out with the Bad, In with the GoodPhp 102: Out with the Bad, In with the Good
Php 102: Out with the Bad, In with the GoodJeremy Kendall
 
Keeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro frameworkKeeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro frameworkJeremy Kendall
 
Keeping it Small: Getting to know the Slim Micro Framework
Keeping it Small: Getting to know the Slim Micro FrameworkKeeping it Small: Getting to know the Slim Micro Framework
Keeping it Small: Getting to know the Slim Micro FrameworkJeremy Kendall
 
Keeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro frameworkKeeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro frameworkJeremy Kendall
 
PHP 102: Out with the Bad, In with the Good
PHP 102: Out with the Bad, In with the GoodPHP 102: Out with the Bad, In with the Good
PHP 102: Out with the Bad, In with the GoodJeremy Kendall
 
Intro to #memtech PHP 2011-12-05
Intro to #memtech PHP   2011-12-05Intro to #memtech PHP   2011-12-05
Intro to #memtech PHP 2011-12-05Jeremy Kendall
 
TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25Jeremy Kendall
 
Zend_Form to the Rescue - A Brief Introduction to Zend_Form
Zend_Form to the Rescue - A Brief Introduction to Zend_FormZend_Form to the Rescue - A Brief Introduction to Zend_Form
Zend_Form to the Rescue - A Brief Introduction to Zend_FormJeremy Kendall
 
Zero to ZF in 10 Minutes
Zero to ZF in 10 MinutesZero to ZF in 10 Minutes
Zero to ZF in 10 MinutesJeremy Kendall
 
Tdd in php a brief example
Tdd in php   a brief exampleTdd in php   a brief example
Tdd in php a brief exampleJeremy Kendall
 
A Brief Introduction to Zend_Form
A Brief Introduction to Zend_FormA Brief Introduction to Zend_Form
A Brief Introduction to Zend_FormJeremy Kendall
 
Zero to Zend Framework in 10 minutes
Zero to Zend Framework in 10 minutesZero to Zend Framework in 10 minutes
Zero to Zend Framework in 10 minutesJeremy Kendall
 

Plus de Jeremy Kendall (15)

Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
 
Php 102: Out with the Bad, In with the Good
Php 102: Out with the Bad, In with the GoodPhp 102: Out with the Bad, In with the Good
Php 102: Out with the Bad, In with the Good
 
Keeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro frameworkKeeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro framework
 
Keeping it Small: Getting to know the Slim Micro Framework
Keeping it Small: Getting to know the Slim Micro FrameworkKeeping it Small: Getting to know the Slim Micro Framework
Keeping it Small: Getting to know the Slim Micro Framework
 
Keeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro frameworkKeeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro framework
 
Php 101: PDO
Php 101: PDOPhp 101: PDO
Php 101: PDO
 
PHP 102: Out with the Bad, In with the Good
PHP 102: Out with the Bad, In with the GoodPHP 102: Out with the Bad, In with the Good
PHP 102: Out with the Bad, In with the Good
 
Intro to #memtech PHP 2011-12-05
Intro to #memtech PHP   2011-12-05Intro to #memtech PHP   2011-12-05
Intro to #memtech PHP 2011-12-05
 
TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25
 
Zend_Form to the Rescue - A Brief Introduction to Zend_Form
Zend_Form to the Rescue - A Brief Introduction to Zend_FormZend_Form to the Rescue - A Brief Introduction to Zend_Form
Zend_Form to the Rescue - A Brief Introduction to Zend_Form
 
Zero to ZF in 10 Minutes
Zero to ZF in 10 MinutesZero to ZF in 10 Minutes
Zero to ZF in 10 Minutes
 
Tdd in php a brief example
Tdd in php   a brief exampleTdd in php   a brief example
Tdd in php a brief example
 
A Brief Introduction to Zend_Form
A Brief Introduction to Zend_FormA Brief Introduction to Zend_Form
A Brief Introduction to Zend_Form
 
Zero to Zend Framework in 10 minutes
Zero to Zend Framework in 10 minutesZero to Zend Framework in 10 minutes
Zero to Zend Framework in 10 minutes
 

Dernier

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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 WorkerThousandEyes
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Dernier (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

Game Changing Dependency Management

  • 1. Composer Game Changing Dependency Management TechCamp Memphis 2013 Saturday, November 2, 13 Jeremy Kendall
  • 3. I love to code Saturday, November 2, 13
  • 4. I love to code I’m terribly forgetful Saturday, November 2, 13
  • 5. I love to code I’m terribly forgetful I take pictures Saturday, November 2, 13
  • 6. I love to code I’m terribly forgetful I take pictures I work at OpenSky Saturday, November 2, 13
  • 7. Adding Dependencies is Easy Saturday, November 2, 13
  • 8. Adding Dependencies is Easy ‣ Saturday, November 2, 13 Copy and Paste
  • 9. Adding Dependencies is Easy ‣ DIY Solution ‣ Copy and Paste Saturday, November 2, 13
  • 10. Adding Dependencies is Easy ‣ DIY Solution ‣ SVN Externals ‣ Copy and Paste Saturday, November 2, 13
  • 11. Adding Dependencies is Easy ‣ DIY Solution ‣ SVN Externals ‣ Git Submodules ‣ Copy and Paste Saturday, November 2, 13
  • 12. Managing them is Messy Saturday, November 2, 13
  • 13. What is Composer? Saturday, November 2, 13
  • 14. What is Composer? ‣ Saturday, November 2, 13 Dependency management tool
  • 15. What is Composer? ‣ Per-project ‣ Dependency management tool Saturday, November 2, 13
  • 16. What is Composer? ‣ Per-project ‣ Inspired by: ‣ Dependency management tool Saturday, November 2, 13
  • 17. What is Composer? ‣ Per-project ‣ Inspired by: ‣ node’s npm ‣ Dependency management tool Saturday, November 2, 13
  • 18. What is Composer? ‣ Per-project ‣ Inspired by: ‣ node’s npm ‣ ruby’s bundler ‣ Dependency management tool Saturday, November 2, 13
  • 20. Benefits ‣ Saturday, November 2, 13 Easily declare project dependencies
  • 21. Benefits ‣ Updating dependency versions extremely simple ‣ Easily declare project dependencies Saturday, November 2, 13
  • 22. Benefits ‣ Updating dependency versions extremely simple ‣ Ensures your team is on the same page ‣ Easily declare project dependencies Saturday, November 2, 13
  • 23. Benefits ‣ Updating dependency versions extremely simple ‣ Ensures your team is on the same page ‣ Tons of excellent related features ‣ Easily declare project dependencies Saturday, November 2, 13
  • 25. Installing Locally In your project: Saturday, November 2, 13 $ curl -sS https://getcomposer.org/installer | php
  • 26. Installing Locally In your project: Specify a directory: Saturday, November 2, 13 $ curl -sS https://getcomposer.org/installer | php $ curl -sS https://getcomposer.org/installer | php -- --install-dir=bin
  • 27. Installing Locally In your project: Specify a directory: What you’ll see: $ curl -sS https://getcomposer.org/installer | php $ curl -sS https://getcomposer.org/installer | php -- --install-dir=bin $ curl -sS https://getcomposer.org/installer | php #!/usr/bin/env php All settings correct for using Composer Downloading... Composer successfully installed to: /Users/jkendall/dev/ composer.phar Use it: php composer.phar Saturday, November 2, 13
  • 28. Installing Globally Recommended $ curl -sS https://getcomposer.org/installer | php $ mv composer.phar /usr/local/bin/composer Saturday, November 2, 13
  • 29. Installing Globally Recommended $ curl -sS https://getcomposer.org/installer | php $ mv composer.phar /usr/local/bin/composer (You might need to use sudo) Saturday, November 2, 13
  • 30. (There’s an installer for Windows folks) Saturday, November 2, 13
  • 31. Keeping up to Date $ php composer.phar self-update You are using the latest composer version. or $ composer self-update You are using the latest composer version. Saturday, November 2, 13
  • 32. Keeping up to Date $ php composer.phar self-update You are using the latest composer version. or $ composer self-update You are using the latest composer version. (Always updates to the latest dev-master) Saturday, November 2, 13
  • 35. composer.json { "require": { "monolog/monolog": "1.6.*" } } ‣Place in the root of your project Saturday, November 2, 13
  • 36. composer.json { "require": { "monolog/monolog": "1.6.*" } } ‣Place in the root of your project ‣“require” specifies package and version Saturday, November 2, 13
  • 37. composer.json { "require": { "monolog/monolog": "1.6.*" } } ‣Place in the root of your project ‣“require” specifies package and version ‣monolog logging library Saturday, November 2, 13
  • 38. composer.json { "require": { "monolog/monolog": "1.6.*" } } ‣Place in the root of your project ‣“require” specifies package and version ‣monolog logging library ‣Version >= 1.6.0 and < 1.7 Saturday, November 2, 13
  • 39. composer.json { "require": { "monolog/monolog": "1.6.*" } } ‣Place in the root of your project ‣“require” specifies package and version ‣monolog logging library ‣Version >= 1.6.0 and < 1.7 ‣No fuss, no muss Saturday, November 2, 13
  • 41. Versions ‣ Saturday, November 2, 13 Exact version: 1.0.0, 12.2.4, etc.
  • 42. Versions ‣ Wildcard: 3.*, 4.2.* ‣ Exact version: 1.0.0, 12.2.4, etc. Saturday, November 2, 13
  • 43. Versions ‣ Wildcard: 3.*, 4.2.* ‣ Range: >, >=, <=, != ‣ Exact version: 1.0.0, 12.2.4, etc. Saturday, November 2, 13
  • 44. Versions ‣ Wildcard: 3.*, 4.2.* ‣ Range: >, >=, <=, != ‣ Example: >=2.4 ‣ Exact version: 1.0.0, 12.2.4, etc. Saturday, November 2, 13
  • 45. Versions ‣ Wildcard: 3.*, 4.2.* ‣ Range: >, >=, <=, != ‣ Example: >=2.4 ‣ Range: >=1.0,<1.7 (comma separated) ‣ Exact version: 1.0.0, 12.2.4, etc. Saturday, November 2, 13
  • 46. Versions ‣ Wildcard: 3.*, 4.2.* ‣ Range: >, >=, <=, != ‣ Example: >=2.4 ‣ Range: >=1.0,<1.7 (comma separated) ‣ Next Significant Release: ~1.3.3 ‣ Exact version: 1.0.0, 12.2.4, etc. Saturday, November 2, 13
  • 47. Installing Dependencies composer install $ composer install Loading composer repositories with package information Installing dependencies (including require-dev) - Installing psr/log (1.0.0) Loading from cache - Installing monolog/monolog (1.6.0) Loading from cache monolog/monolog suggests installing monolog/monolog suggests installing monolog/monolog suggests installing monolog/monolog suggests installing Writing lock file Generating autoload files Saturday, November 2, 13 mlehner/gelf-php (Allow sending log messages to a GrayLog2 server) raven/raven (Allow sending log messages to a Sentry server) doctrine/couchdb (Allow sending log messages to a CouchDB server) ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
  • 49. composer.lock ‣ Saturday, November 2, 13 install writes a dependency lock file
  • 50. composer.lock ‣ List of exact versions installed ‣ install writes a dependency lock file Saturday, November 2, 13
  • 51. composer.lock ‣ List of exact versions installed ‣ Commit both composer.lock and composer.json ‣ install writes a dependency lock file Saturday, November 2, 13
  • 52. composer.lock ‣ List of exact versions installed ‣ Commit both composer.lock and composer.json ‣ install writes a dependency lock file ‣ composer install now checks the lock file, not composer.json Saturday, November 2, 13
  • 53. composer.lock ‣ List of exact versions installed ‣ Commit both composer.lock and composer.json ‣ install writes a dependency lock file ‣ composer install now checks the lock file, not composer.json ‣ Saturday, November 2, 13 Update dependencies with composer update
  • 55. Updating Dependencies { "require": { "monolog/monolog": "1.6.*@dev" } } Saturday, November 2, 13
  • 56. Updating Dependencies { "require": { "monolog/monolog": "1.6.*@dev" } } ‣Updates monolog library version Saturday, November 2, 13
  • 57. Updating Dependencies { "require": { "monolog/monolog": "1.6.*@dev" } } ‣Updates monolog library version ‣Version >= 1.6.0 and < 1.7 (dev) Saturday, November 2, 13
  • 58. Updating Dependencies composer update $ composer update Loading composer repositories with package information Updating dependencies (including require-dev) - Removing monolog/monolog (1.5.0) - Installing monolog/monolog (dev-master c933bb6) Cloning c933bb67a8a2e45c42d0626a0cd6569789bf6ed7 Writing lock file Generating autoload files Saturday, November 2, 13
  • 59. Updating Dependencies composer update $ composer update Loading composer repositories with package information Updating dependencies (including require-dev) - Removing monolog/monolog (1.5.0) - Installing monolog/monolog (dev-master c933bb6) Cloning c933bb67a8a2e45c42d0626a0cd6569789bf6ed7 Writing lock file Generating autoload files ‣Reads from composer.json Saturday, November 2, 13
  • 60. Updating Dependencies composer update $ composer update Loading composer repositories with package information Updating dependencies (including require-dev) - Removing monolog/monolog (1.5.0) - Installing monolog/monolog (dev-master c933bb6) Cloning c933bb67a8a2e45c42d0626a0cd6569789bf6ed7 Writing lock file Generating autoload files ‣Reads from composer.json ‣Updates dependencies Saturday, November 2, 13
  • 61. Updating Dependencies composer update $ composer update Loading composer repositories with package information Updating dependencies (including require-dev) - Removing monolog/monolog (1.5.0) - Installing monolog/monolog (dev-master c933bb6) Cloning c933bb67a8a2e45c42d0626a0cd6569789bf6ed7 Writing lock file Generating autoload files ‣Reads from composer.json ‣Updates dependencies ‣Rewrites lock file Saturday, November 2, 13
  • 62. Adding New Dependencies Edit composer.json . . . { "require": { "monolog/monolog": "1.6.*@dev", "ircmaxell/password-compat": "1.0.3" } } Saturday, November 2, 13
  • 63. Adding New Dependencies Or use the command line composer require $ composer require ircmaxell/password-compat:1.0.3 composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) - Installing ircmaxell/password-compat (1.0.3) Downloading: 100% Writing lock file Generating autoload files Saturday, November 2, 13
  • 65. Autoloading ‣ Saturday, November 2, 13 Composer generates vendor/autoload.php
  • 66. Autoloading ‣ Add require ‘vendor/autoload.php’; ‣ Composer generates vendor/autoload.php Saturday, November 2, 13
  • 67. Autoloading ‣ Add require ‘vendor/autoload.php’; ‣ Immediately begin using your dependencies ‣ Composer generates vendor/autoload.php Saturday, November 2, 13
  • 68. Autoloading Don’t forget to add your own code! { "require": { "monolog/monolog": "1.6.*@dev" }, "autoload": { "psr-0": { "Beeblebrox": "src/" } } } Saturday, November 2, 13
  • 69. Autoloading Pro Tip Grab an autoloader instance and add more namespaces. $loader = require 'vendor/autoload.php'; $loader->add('AcmeTest', __DIR__); Saturday, November 2, 13
  • 70. Kickstart a Project composer create-project $ composer create-project slim/slim-skeleton super-sweet-application Installing slim/slim-skeleton (1.1.0) - Installing slim/slim-skeleton (1.1.0) Downloading: 100% Created project in super-sweet-application Loading composer repositories with package information Installing dependencies (including require-dev) - Installing slim/slim (2.3.0) Downloading: 100% - Installing slim/extras (2.0.3) Loading from cache - Installing twig/twig (v1.13.1) Loading from cache Writing lock file Generating autoload files Saturday, November 2, 13
  • 71. Little Bobby Tables as a Service composer create-project jeremykendall/lbtaas lbtaas Saturday, November 2, 13
  • 72. Little Bobby Tables as a Service http://lbtaas.dev { "status":"success", "data":{ "name":"Exploits of a Mom", "permalink":"http://xkcd.com/327/", "image":"http://imgs.xkcd.com/comics/exploits_of_a_mom.png" } } Saturday, November 2, 13
  • 73. Your Very Own Library Saturday, November 2, 13
  • 75. Libraries ‣ Saturday, November 2, 13 Everyone has written a library of some sort
  • 76. Libraries ‣ Making up examples is not my strong suit ‣ Everyone has written a library of some sort Saturday, November 2, 13
  • 77. Libraries ‣ Making up examples is not my strong suit ‣ Let’s walk through a real library . . . ‣ Everyone has written a library of some sort Saturday, November 2, 13
  • 78. Libraries ‣ Making up examples is not my strong suit ‣ Let’s walk through a real library . . . ‣ . . . and check out some awesome Composer features ‣ Everyone has written a library of some sort Saturday, November 2, 13
  • 80. { } Saturday, November 2, 13 "name": "jeremykendall/php-domain-parser", "description": "Public Suffix List based URL parsing implemented in PHP.", "license": "MIT", "authors": [ { "name": "Jeremy Kendall", "homepage": "http://about.me/jeremykendall", "role": "Developer" } ], "bin": ["bin/pdp-psl"], "keywords": ["Public Suffix List", "domain parsing", "url parsing"], "require": { "php": ">=5.3.0", "ext-curl": "*" }, "require-dev": { "mikey179/vfsStream": "1.1.*", "jeremykendall/phpctagger": "0.0.*" }, "autoload": { "psr-0": { "Pdp": "library/" } }, "scripts": { "post-install-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ], "post-update-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ] }
  • 81. { "name": "jeremykendall/php-domain-parser", "description": "Public Suffix List based URL parsing implemented in PHP.", "license": "MIT", "authors": [ { "name": "Jeremy Kendall", "homepage": "http://about.me/jeremykendall", "role": "Developer" } ], "bin": ["bin/pdp-psl"], "keywords": ["Public Suffix List", "domain parsing", "url parsing"], "require": { "php": ">=5.3.0", "ext-curl": "*" }, "require-dev": { "mikey179/vfsStream": "1.1.*", "jeremykendall/phpctagger": "0.0.*" }, "autoload": { "psr-0": { "Pdp": "library/" } }, "scripts": { "post-install-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ], "post-update-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ] } Package requirements } Saturday, November 2, 13
  • 82. { "name": "jeremykendall/php-domain-parser", "description": "Public Suffix List based URL parsing implemented in PHP.", "license": "MIT", "authors": [ { "name": "Jeremy Kendall", "homepage": "http://about.me/jeremykendall", "role": "Developer" } ], "bin": ["bin/pdp-psl"], "keywords": ["Public Suffix List", "domain parsing", "url parsing"], "require": { "php": ">=5.3.0", "ext-curl": "*" }, "require-dev": { "mikey179/vfsStream": "1.1.*", "jeremykendall/phpctagger": "0.0.*" }, "autoload": { "psr-0": { "Pdp": "library/" } }, "scripts": { "post-install-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ], "post-update-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ] } Package requirements } Saturday, November 2, 13 Autoloading
  • 83. { "name": "jeremykendall/php-domain-parser", "description": "Public Suffix List based URL parsing implemented in PHP.", "license": "MIT", "authors": [ { "name": "Jeremy Kendall", "homepage": "http://about.me/jeremykendall", "role": "Developer" } ], "bin": ["bin/pdp-psl"], "keywords": ["Public Suffix List", "domain parsing", "url parsing"], "require": { "php": ">=5.3.0", "ext-curl": "*" }, "require-dev": { "mikey179/vfsStream": "1.1.*", "jeremykendall/phpctagger": "0.0.*" }, "autoload": { "psr-0": { "Pdp": "library/" } }, "scripts": { "post-install-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ], "post-update-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ] } Add the “name” key and it’s installable } Saturday, November 2, 13
  • 84. { "name": "jeremykendall/php-domain-parser", "description": "Public Suffix List based URL parsing implemented in PHP.", "license": "MIT", "authors": [ { "name": "Jeremy Kendall", "homepage": "http://about.me/jeremykendall", "role": "Developer" } ], "bin": ["bin/pdp-psl"], "keywords": ["Public Suffix List", "domain parsing", "url parsing"], "require": { "php": ">=5.3.0", "ext-curl": "*" }, "require-dev": { "mikey179/vfsStream": "1.1.*", "jeremykendall/phpctagger": "0.0.*" }, "autoload": { "psr-0": { "Pdp": "library/" } }, "scripts": { "post-install-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ], "post-update-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ] } Additional metadata } Saturday, November 2, 13
  • 85. { "name": "jeremykendall/php-domain-parser", "description": "Public Suffix List based URL parsing implemented in PHP.", "license": "MIT", "authors": [ { "name": "Jeremy Kendall", "homepage": "http://about.me/jeremykendall", "role": "Developer" } ], "bin": ["bin/pdp-psl"], "keywords": ["Public Suffix List", "domain parsing", "url parsing"], "require": { "php": ">=5.3.0", "ext-curl": "*" }, "require-dev": { "mikey179/vfsStream": "1.1.*", "jeremykendall/phpctagger": "0.0.*" }, "autoload": { "psr-0": { "Pdp": "library/" } }, "scripts": { "post-install-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ], "post-update-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ] } Don’t forget the license! } Saturday, November 2, 13
  • 86. { "name": "jeremykendall/php-domain-parser", "description": "Public Suffix List based URL parsing implemented in PHP.", "license": "MIT", "authors": [ { "name": "Jeremy Kendall", "homepage": "http://about.me/jeremykendall", "role": "Developer" } ], "bin": ["bin/pdp-psl"], "keywords": ["Public Suffix List", "domain parsing", "url parsing"], "require": { "php": ">=5.3.0", "ext-curl": "*" }, "require-dev": { "mikey179/vfsStream": "1.1.*", "jeremykendall/phpctagger": "0.0.*" }, "autoload": { "psr-0": { "Pdp": "library/" } }, "scripts": { "post-install-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ], "post-update-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ] } Full fledged library! } Saturday, November 2, 13
  • 87. Now for the cool(er) stuff . . . Saturday, November 2, 13
  • 88. { } Saturday, November 2, 13 "name": "jeremykendall/php-domain-parser", "description": "Public Suffix List based URL parsing implemented in PHP.", "license": "MIT", "authors": [ { "name": "Jeremy Kendall", "homepage": "http://about.me/jeremykendall", "role": "Developer" } ], "bin": ["bin/pdp-psl"], "keywords": ["Public Suffix List", "domain parsing", "url parsing"], "require": { "php": ">=5.3.0", "ext-curl": "*" }, "require-dev": { "mikey179/vfsStream": "1.1.*", "jeremykendall/phpctagger": "0.0.*" }, "autoload": { "psr-0": { "Pdp": "library/" } }, "scripts": { "post-install-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ], "post-update-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ] } require-dev
  • 90. require-dev ‣ Saturday, November 2, 13 Lists packages required for development (think tests)
  • 91. require-dev ‣ Only applies to the root package ‣ Lists packages required for development (think tests) Saturday, November 2, 13
  • 92. require-dev ‣ Only applies to the root package ‣ Both install and update install require-dev by default ‣ Lists packages required for development (think tests) Saturday, November 2, 13
  • 93. require-dev ‣ Only applies to the root package ‣ Both install and update install require-dev by default ‣ (Use the --no-dev flag to skip installing dev ‣ dependencies) Lists packages required for development (think tests) Saturday, November 2, 13
  • 94. { "name": "jeremykendall/php-domain-parser", "description": "Public Suffix List based URL parsing implemented in PHP.", "license": "MIT", "authors": [ { "name": "Jeremy Kendall", "homepage": "http://about.me/jeremykendall", "role": "Developer" } ], "bin": ["bin/pdp-psl"], } Saturday, November 2, 13 bin "keywords": ["Public Suffix List", "domain parsing", "url parsing"], "require": { "php": ">=5.3.0", "ext-curl": "*" }, "require-dev": { "mikey179/vfsStream": "1.1.*", "jeremykendall/phpctagger": "0.0.*" }, "autoload": { "psr-0": { "Pdp": "library/" } }, "scripts": { "post-install-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ], "post-update-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ] }
  • 96. bin ‣ Saturday, November 2, 13 cli scripts to pass along to package users
  • 97. bin ‣ A set of files that should be treated as binaries ‣ cli scripts to pass along to package users Saturday, November 2, 13
  • 98. bin ‣ A set of files that should be treated as binaries ‣ Installs binaries to vendor/bin for any project that ‣ depends on your project cli scripts to pass along to package users Saturday, November 2, 13
  • 99. bin ‣ A set of files that should be treated as binaries ‣ Installs binaries to vendor/bin for any project that ‣ depends on your project cli scripts to pass along to package users ‣ Saturday, November 2, 13 php-domain-parser uses a bin to update the local copy of the public suffix list
  • 100. { } Saturday, November 2, 13 "name": "jeremykendall/php-domain-parser", "description": "Public Suffix List based URL parsing implemented in PHP.", "license": "MIT", "authors": [ { "name": "Jeremy Kendall", "homepage": "http://about.me/jeremykendall", "role": "Developer" } ], "bin": ["bin/pdp-psl"], "keywords": ["Public Suffix List", "domain parsing", "url parsing"], "require": { "php": ">=5.3.0", "ext-curl": "*" }, "require-dev": { "mikey179/vfsStream": "1.1.*", "jeremykendall/phpctagger": "0.0.*" }, "autoload": { "psr-0": { "Pdp": "library/" } }, "scripts": { "post-install-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ], "post-update-cmd": [ "PhpCtaggerComposerScriptCtagger::ctag" ] } scripts
  • 102. scripts ‣ Saturday, November 2, 13 Used to execute custom code during the Composer execution process
  • 103. scripts ‣ ‣ Saturday, November 2, 13 Used to execute custom code during the Composer execution process PHP callback (defined as a static method) . . .
  • 104. scripts ‣ Used to execute custom code during the Composer execution process ‣ . . . or any command-line executable command ‣ PHP callback (defined as a static method) . . . Saturday, November 2, 13
  • 105. scripts ‣ Used to execute custom code during the Composer execution process ‣ . . . or any command-line executable command ‣ Only scripts defined in the root composer.json are ‣ executed PHP callback (defined as a static method) . . . Saturday, November 2, 13
  • 106. scripts ‣ Used to execute custom code during the Composer execution process ‣ . . . or any command-line executable command ‣ Only scripts defined in the root composer.json are ‣ executed PHP callback (defined as a static method) . . . ‣ Saturday, November 2, 13 If a script is defined in a dependency, you can use it in your composer.json
  • 108. scripts ‣ Saturday, November 2, 13 Composer fires “named events” during execution
  • 109. scripts ‣ Named events include: ‣ Composer fires “named events” during execution Saturday, November 2, 13
  • 110. scripts ‣ Named events include: ‣ pre- and post-install-cmd ‣ Composer fires “named events” during execution Saturday, November 2, 13
  • 111. scripts ‣ Named events include: ‣ pre- and post-install-cmd ‣ pre- and post-update-cmd ‣ Composer fires “named events” during execution Saturday, November 2, 13
  • 112. scripts ‣ Named events include: ‣ pre- and post-install-cmd ‣ pre- and post-update-cmd ‣ post-root-package-install ‣ Composer fires “named events” during execution Saturday, November 2, 13
  • 113. scripts ‣ Named events include: ‣ pre- and post-install-cmd ‣ pre- and post-update-cmd ‣ post-root-package-install ‣ Many more . . . ‣ Composer fires “named events” during execution Saturday, November 2, 13
  • 115. Running scripts Execute Composer (script will execute if the named event is triggered) or . . . Saturday, November 2, 13
  • 116. Running scripts Execute Composer (script will execute if the named event is triggered) or . . . Saturday, November 2, 13
  • 117. Running scripts Execute Composer (script will execute if the named event is triggered) or . . . composer run-script <named event> Saturday, November 2, 13
  • 118. Example public static function create(Event $event) { $dir = dirname($event->getComposer()->getConfig()->get('vendor-dir')); $io = $event->getIO(); $io->write('Reviewing your Flaming Archer environment . . .', true); $configExists = file_exists($dir . '/config.php'); $configDistExists = file_exists($dir . '/config-dist.php'); if (!$configExists && $configDistExists) { $io->write('Creating config.php by copying config-dist.php . . .', true); copy($dir . '/config-dist.php', $dir . '/config.php'); $io->write("Done! Please edit config.php.", true); } else { $io->write('Found config.php.', true); } } https://github.com/jeremykendall/flaming-archer/blob/develop/library/Fa/Composer/Script/Config.php Saturday, November 2, 13
  • 119. You’ve built your library. Now what? Saturday, November 2, 13
  • 120. Push it to a VCS Saturday, November 2, 13
  • 121. Push it to a VCS ‣ Saturday, November 2, 13 git, svn, or hg all work equally well
  • 122. Push it to a VCS ‣ For the sake of simplicity I’ll assume git/github ‣ git, svn, or hg all work equally well Saturday, November 2, 13
  • 123. Push it to a VCS ‣ For the sake of simplicity I’ll assume git/github ‣ Package versions: ‣ git, svn, or hg all work equally well Saturday, November 2, 13
  • 124. Push it to a VCS ‣ For the sake of simplicity I’ll assume git/github ‣ Package versions: ‣ Tags are package versions (1.0.0, v2.5.4, etc) ‣ git, svn, or hg all work equally well Saturday, November 2, 13
  • 125. Push it to a VCS ‣ For the sake of simplicity I’ll assume git/github ‣ Package versions: ‣ Tags are package versions (1.0.0, v2.5.4, etc) ‣ Branches are dev versions (dev-{branchname}, ‣ {branchname}-dev) git, svn, or hg all work equally well Saturday, November 2, 13
  • 126. Push it to a VCS ‣ For the sake of simplicity I’ll assume git/github ‣ Package versions: ‣ Tags are package versions (1.0.0, v2.5.4, etc) ‣ Branches are dev versions (dev-{branchname}, ‣ {branchname}-dev) git, svn, or hg all work equally well ‣ Saturday, November 2, 13 For this reason, I strongly recommend using semantic versioning: http://semver.org
  • 130. Packagist ‣ Saturday, November 2, 13 The main package repository for Composer
  • 131. Packagist ‣ (Aside: Search Packagist before “rolling your own”) ‣ The main package repository for Composer Saturday, November 2, 13
  • 132. Packagist ‣ (Aside: Search Packagist before “rolling your own”) ‣ Packages published there need no special settings in ‣ composer.json to be installable (see “repositories” key) The main package repository for Composer Saturday, November 2, 13
  • 133. Packagist ‣ (Aside: Search Packagist before “rolling your own”) ‣ Packages published there need no special settings in ‣ composer.json to be installable (see “repositories” key) The main package repository for Composer ‣ Saturday, November 2, 13 Submitting is dead simple
  • 134. Packagist ‣ (Aside: Search Packagist before “rolling your own”) ‣ Packages published there need no special settings in ‣ composer.json to be installable (see “repositories” key) The main package repository for Composer ‣ Create account, hit big green submit button ‣ Submitting is dead simple Saturday, November 2, 13
  • 139. But what about internal proprietary packages? Saturday, November 2, 13
  • 140. Satis to the Rescue Saturday, November 2, 13
  • 141. Satis to the Rescue ‣ Saturday, November 2, 13 Static composer repository generator
  • 142. Satis to the Rescue ‣ Lightweight, static file based version of Packagist ‣ Static composer repository generator Saturday, November 2, 13
  • 143. Satis to the Rescue ‣ Lightweight, static file based version of Packagist ‣ Simple to configure ‣ Static composer repository generator Saturday, November 2, 13
  • 144. Satis to the Rescue ‣ Lightweight, static file based version of Packagist ‣ Simple to configure ‣ Flexible ‣ Static composer repository generator Saturday, November 2, 13
  • 145. composer create-project composer/satis --stability=dev $ composer create-project composer/satis --stability=dev --keep-vcs Installing composer/satis (dev-master 059588ef0fd0977964ad13637e02012519686202) - Installing composer/satis (dev-master master) Cloning master Created project in /Users/jkendall/dev/satis Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Warning: The lock file is not up to date with the latest changes in composer.json . . . - Installing symfony/process (dev-master 75c8101) Cloning 75c810176f8e069714cef8696d7ecc3aa86e8168 - [ . . . ] - Installing twig/twig (v1.13.1) Loading from cache symfony/console suggests installing symfony/event-dispatcher () Generating autoload files Saturday, November 2, 13
  • 146. Satis config.json { "name": "Satis Demo", "homepage": "http://satis.dev", "repositories": [ { "type": "vcs", "url": "https://github.com/jeremykendall/php-domain-parser" }, { "type": "vcs", "url": "https://github.com/jeremykendall/phpctagger" } ], "require": { "jeremykendall/php-domain-parser": ">=0.0.5", "jeremykendall/phpctagger": ">0.0.6" }, "archive": { "directory": "dist", "format": "tar" } } Saturday, November 2, 13
  • 147. Satis config.json { "name": "Satis Demo", "homepage": "http://satis.dev", "repositories": [ { "type": "vcs", "url": "https://github.com/jeremykendall/php-domain-parser" }, { "type": "vcs", "url": "https://github.com/jeremykendall/phpctagger" } ], "require": { "jeremykendall/php-domain-parser": ">=0.0.5", "jeremykendall/phpctagger": ">0.0.6" }, "archive": { "directory": "dist", "format": "tar" } } Saturday, November 2, 13
  • 148. Satis config.json { "name": "Satis Demo", "homepage": "http://satis.dev", "repositories": [ { "type": "vcs", "url": "https://github.com/jeremykendall/php-domain-parser" }, { "type": "vcs", "url": "https://github.com/jeremykendall/phpctagger" } ], "require": { "jeremykendall/php-domain-parser": ">=0.0.5", "jeremykendall/phpctagger": ">0.0.6" }, "archive": { "directory": "dist", "format": "tar" } } Saturday, November 2, 13
  • 149. Satis config.json { "name": "Satis Demo", "homepage": "http://satis.dev", "repositories": [ { "type": "vcs", "url": "https://github.com/jeremykendall/php-domain-parser" }, { "type": "vcs", "url": "https://github.com/jeremykendall/phpctagger" } ], "require": { "jeremykendall/php-domain-parser": ">=0.0.5", "jeremykendall/phpctagger": ">0.0.6" }, "archive": { "directory": "dist", "format": "tar" } } Saturday, November 2, 13
  • 150. Satis config.json { "name": "Satis Demo", "homepage": "http://satis.dev", "repositories": [ { "type": "vcs", "url": "https://github.com/jeremykendall/php-domain-parser" }, { "type": "vcs", "url": "https://github.com/jeremykendall/phpctagger" } ], "require": { "jeremykendall/php-domain-parser": ">=0.0.5", "jeremykendall/phpctagger": ">0.0.6" }, "archive": { "directory": "dist", "format": "tar" } } Saturday, November 2, 13
  • 151. Build Repo $ php bin/satis build config.json web/ Saturday, November 2, 13
  • 152. composer.json { "repositories": [ { "type": "composer", "url": "http://satis.dev" } ], "require": { "jeremykendall/php-domain-parser": "0.0.7" } } Saturday, November 2, 13
  • 153. composer.json { "repositories": [ { "type": "composer", "url": "http://satis.dev" } ], "require": { "jeremykendall/php-domain-parser": "0.0.7" } } Saturday, November 2, 13
  • 154. composer.json { "repositories": [ { "type": "composer", "url": "http://satis.dev" } ], "require": { "jeremykendall/php-domain-parser": "0.0.7" } } Saturday, November 2, 13
  • 155. Satis Demo Project Saturday, November 2, 13
  • 156. Satis Demo Project ‣ Saturday, November 2, 13 Want to goof around with Satis?
  • 157. Satis Demo Project ‣ See: https://github.com/jeremykendall/satis-demo ‣ Want to goof around with Satis? Saturday, November 2, 13
  • 158. Satis Demo Project ‣ See: https://github.com/jeremykendall/satis-demo ‣ Clone, follow instructions in README, and WIN ‣ Want to goof around with Satis? Saturday, November 2, 13
  • 159. Satis Demo Project ‣ See: https://github.com/jeremykendall/satis-demo ‣ Clone, follow instructions in README, and WIN ‣ Satis really is dead simple to set up ‣ Want to goof around with Satis? Saturday, November 2, 13
  • 160. Parting Tips and Tricks Saturday, November 2, 13
  • 161. composer install --no-dev --prefer-dist --optimize-autoloader Saturday, November 2, 13
  • 163. Non-Composer and PEAR packages can be installed (see “repositories” key documentation) Saturday, November 2, 13
  • 166. There’s So Much More! Saturday, November 2, 13
  • 168. Credits ‣ Thanks to TechCamp for having me IMMA LET YOU FINISH, BUT RAFAEL DOHMS HAS THE BEST COMPOSER TALK OF ALL TIME. Saturday, November 2, 13
  • 170. Credits ‣ Saturday, November 2, 13 Thanks to Rafael Dohms, the Composer presenter
  • 171. Credits ‣ Thanks to TechCamp for having me ‣ Thanks to Rafael Dohms, the Composer presenter Saturday, November 2, 13
  • 172. Credits ‣ Thanks to TechCamp for having me ‣ Thanks to Jordi Boggiano, Nils Adermann, and the ‣ community for an amazing project (and all the Thanks to Rafael Dohms, the Composer presenter documentation I cribbed from) Saturday, November 2, 13
  • 173. Credits ‣ Thanks to TechCamp for having me ‣ Thanks to Jordi Boggiano, Nils Adermann, and the ‣ community for an amazing project (and all the Thanks to Rafael Dohms, the Composer presenter documentation I cribbed from) ‣ Saturday, November 2, 13 Thanks to our sponsors for help making this happen
  • 174. Credits ‣ Thanks to TechCamp for having me ‣ Thanks to Jordi Boggiano, Nils Adermann, and the ‣ community for an amazing project (and all the Thanks to Rafael Dohms, the Composer presenter documentation I cribbed from) ‣ Thanks to all of you for being here ‣ Thanks to our sponsors for help making this happen Saturday, November 2, 13