Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Managing your project PHP dependencies
Search
Théo FIDRY
October 20, 2016
Research
730
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
Transcript
59 slides
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
More Decks by Théo FIDRY
See All by Théo FIDRY
Mutation Testing PHPDeveloperDay
theofidry
1
720
Mutation Testing - Better code by making bugs
theofidry
3
1.4k
Mutation Testing - Better code by making bugs
theofidry
0
160
Other Decks in Research
See All in Research
Des solutions pour pâturer davantage en hiver
institutdelelevage
PRO
0
140
SPACE 2026 - Renforcer l’attractivité des métiers des productions animales dans les établissements d'enseignement agricole
institutdelelevage
PRO
0
120
Byzantine Eventual Consistency for Reliable Local-First Software
ept
0
410
横浜市長(山中氏)の言動にかかる第三者による調査報告書
sishi2026
0
680
The Conductor Pattern -Multi-Granularity Feedback for Creative Agents-
shibuiwilliam
2
120
Who’s Behind the Divide?
sirmatrixpage
1
1.6k
Physical AIでモデリングはどう変わるか/How Physical AI Will Change Modeling
stktu
0
350
CDCL を用いた MILP の厳密解法
imai448
0
330
生成AI時代の開発方法論と、メールサーバー運用の新しいかたち
hirachan
0
240
論文紹介:Doc-to-LoRA: Learning to Instantly Internalize Contexts
yukako_nakano
0
240
XDPerf: A High-Performance Traffic Generator Built with WASM and eBPF
takehaya
1
400
[IEICE-Soceity-Conf2026] セマンティック通信を見据えたマルチスケールセンシングと 学習の融合によるデジタルツイン基盤 / Digital Twin Infrastructure via the Fusion of Multi-Scale Sensing and Learning toward Semantic Communications
pman0214
0
150
Featured
See All Featured
The Language of Interfaces
destraynor
162
27k
Docker and Python
trallard
47
4.3k
Raft: Consensus for Rubyists
vanstee
143
7.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
30 Presentation Tips
portentint
PRO
1
470
For a Future-Friendly Web
brad_frost
184
11k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
690
A Soul's Torment
seathinner
9
3.9k
sira's awesome portfolio website redesign presentation
elsirapls
0
510