Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Managing your project PHP dependencies
Search
Théo FIDRY
October 20, 2016
Research
720
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Managing your project PHP dependencies
Théo FIDRY
October 20, 2016
More Decks by Théo FIDRY
See All by Théo FIDRY
Mutation Testing PHPDeveloperDay
theofidry
1
700
Mutation Testing - Better code by making bugs
theofidry
3
1.4k
Mutation Testing - Better code by making bugs
theofidry
0
150
Other Decks in Research
See All in Research
typst の使い方:言語学を研究する学生のために
gitomochang
0
520
2026 東京科学大 情報通信系 研究室紹介 (大岡山)
icttitech
0
4.1k
[IR Reading 2026春 論文紹介] LLM-based Listwise Reranking under the Effect of Positional Bias (ECIR 2026) /IR-Reading-2026-Spring
koheishinden
PRO
0
240
Apache Gravitinoで実現する Icebergカタログ統合とアクセスの一元化
matsumooon
0
350
データセンター事業者を取り巻く近年の状況とその中での研究開発動向、テストベッドへの貢献の可能性
kikuzo
1
270
Using our influence and power for patient safety
helenbevan
0
370
さくらインターネット研究所テックトーク2026春、研究開発Gr.25年度成果26年度方針
kikuzo
0
160
COFFEE-Japan PROJECT Impact Report(Uminomukou Coffee)
ontheslope
0
280
シングルチャネルマルチトーカー音声認識の進展
ryomasumura
0
200
羽田新ルート運用6年の検証
1manken
0
180
コーディングエージェントとABNを再考
hf149
2
770
AGI4OPT:自然言語から数理最適化を導くエ ージェントスキル Translating Human Intent into Mathematical Optimization
mickey_kubo
0
160
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Navigating Weather and Climate Data
rabernat
0
400
The Curse of the Amulet
leimatthew05
2
13k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
230
So, you think you're a good person
axbom
PRO
2
2.1k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
490
The Cult of Friendly URLs
andyhume
79
7k
For a Future-Friendly Web
brad_frost
183
10k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
190
Agile that works and the tools we love
rasmusluckow
331
22k
Transcript
MANAGING YOUR PROJECT DEPENDENCIES GitHub: @theofidry Twitter: @tfidry 1
“There is no solution, only tradeoffs” Managing your project dependencies
- Paul M. Jones 2
Scope Managing your project dependencies • Case of study: PHP
framework agnostic library • POV: maintainer of the library • Modern PHP version (Composer) 3
What are your project dependencies? Managing your project dependencies 4
Types of dependencies Managing your project dependencies • Hard dependencies
• Optional dependencies • Dev dependencies 5
How to manage those dependencies? Managing your project dependencies 6
Managing your project dependencies Image source: https://getcomposer.org/img/logo-composer-transparent5.png
Hard dependencies Managing your project dependencies 8
Optional dependencies Managing your project dependencies 9
Optional & Dev dependencies Managing your project dependencies 10
Cool? Managing your project dependencies 11
Managing your project dependencies Image source: https://www.allmystery.de/i/tcce1a2_35567217.jpg
require-dev limitations Managing your project dependencies 13
You are changing your dependencies Managing your project dependencies 14
Managing your project dependencies symfony/yaml <3.0 15
Harder to detect issues or incompatibilities Managing your project dependencies
16
“Stupid” conflicts Managing your project dependencies static analysis tool 17
Annoying conflicts Managing your project dependencies never used together 18
Solutions? Managing your project dependencies 19
Managing your project dependencies Example #1 20
KISS: don’t use those dependencies Managing your project dependencies 21
Recap: Managing your project dependencies • pros: dead simple •
cons: you can’t use this dependency 22
Image source: http://i2.mirror.co.uk/incoming/article5940823.ece/ALTERNATES/s1227b/Luhu-the-saddest-tabby-cat.jpg
PHARs Managing your project dependencies 24
Managing your project dependencies What is a PHAR? “The phar
extension provides a way to put entire PHP applications into a single file called a "phar" (PHP Archive) “ Quote source: http://php.net/manual/en/intro.phar.php 25
26
Managing your project dependencies Image source: http://fatcdn.hipobw1hofq5ehpwigfo4.netdna-cdn.com/wp-content/uploads/2015/07/dangercat5-768x1024.jpg WARNING
The code of a PHAR is not isolated Managing your
project dependencies 28
Managing your project dependencies symfony/yaml 2.7.0 symfony/yaml 3.1.0 29
[1]: https://pixabay.com/en/atomic-bomb-mushroom-cloud-explosion-1011738/
Possible outcomes Managing your project dependencies • Everything runs fine
(lucky) • Big fat error (a bit less luck) • Very subtle nasty bug you’ll have hard time to solve (wish you luck man) 31
When can you use a PHAR? Managing your project dependencies
32
When it doesn’t execute your code Managing your project dependencies
33
Recap: Managing your project dependencies • pros: solve the conflict
problem • cons: • Inappropriate when PHARs must execute code • PHARs are not trackable 34
Managing your project dependencies Track your PHARs with tommy-muehle/tooly-composer-script 35
Managing your project dependencies 36
Managing your project dependencies Example #2 37
Use multiple repositories Managing your project dependencies 38
Managing your project dependencies • Core library : acme/lib •
Symfony bridge : acme/lib-bundle • Laravel bridge: acme/lib-laravel-provider 39
Recap: Managing your project dependencies • pros: simple • cons:
you have to manage and synchronize multiple repositories 40
Tweak testing configuration Managing your project dependencies 41
Symfony bridge tests Laravel bridge tests Core library tests 42
Recap: Managing your project dependencies • pros: it works •
cons: • can be very tricky • slow 43
Another solution? Managing your project dependencies 44
Multiple composer.json files Managing your project dependencies 45
Managing your project dependencies Example #2 46
Core library Symfony bridge Laravel bridge 47
How to easily manage them? Managing your project dependencies 48
Managing your project dependencies • bamarni/composer-bin-plugin • theofidry/composer-inheritance-plugin • wikimedia/composer-merge-plugin
49
Managing your project dependencies 50
Managing your project dependencies 51
bamarni symfony/yaml 52
Managing your project dependencies Example #2 53
Core library Laravel bridge Symfony bridge 54
55
Demo https://github.com/theofidry/sfpot-lille-managing-your-dependencies-demo Managing your project dependencies
My takeaway Managing your project dependencies
Questions? Managing your project dependencies
Thanks! Managing your project dependencies GitHub: @theofidry Twitter: @tfidry