際際滷

際際滷Share a Scribd company logo
Golang for PHPDevelopers
Dependency
management
byRichardTuin
PHPhas Composer
Golang has Glide
(among others)
These slides compare
Composerand
Glide
byfour commands:
- init
- install
- require
- update
1.
init?
composer init
? creates a composer.json
glide init
? creates a glide.yaml
It's muchthe same
init?
Glide's initisa
bitmore clever
? It looks through your code
and detects dependencies
? Asks you to add them
2.
install
composer install
? installs dependencies to vendor/
glide install
? installs dependencies to vendor/
installworksthe
same in bothtools
3.
require
Composer require
and
Glide get
Composer require
? composer require rtuin/somepackage
? composer require --dev rtuin/somepackage
Glide get
? glide get github.com/rtuin/somepackage
? glide get --test github.com/rtuin/somepackage
Withversion constraints
Composer require
? composer require rtuin/somepackage:^1.0
Glide get
? glide get github.com/rtuin/somepackage#^1.0
4. update = update
composer.json
vs
glide.yaml
composer.json
{
"name": "rtuin/somepackage",
"require": {
"rtuin/someotherpackage": "^4.1",
},
}
glide.yaml
package: github.com/rtuin/somepackage
import:
- package: github.com/rtuin/someotherpackage
version: ^4.1
Composerand
Glidearevery
similar
...
ifnotequals
Golang for PHPDevelopers
Dependencymanagement
byRichardTuin
Read the full blogpost here.

More Related Content

Golang for PHP Developers: Dependency management with Glide