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
Ghost in the 7‑Zip: The Shadow of Residential Proxies Creeping into Your Life
nttcom
0
1.8k
敵対生成プロンプト同時探索による内省型プロンプト最適化
kinoue_smarthr
0
350
論文紹介 "ReSim: Reliable World Simulation for Autonomous Driving"
kogo
0
720
Google Cloud Next 2026 DM Recap Agentic Data Cloudを添えて / Google Cloud Next 2026 DM Recap
nnaka2992
0
100
第64回CV・PRML勉強会 論文紹介:Linguistic Priors for Visual Decoupling: Towards Symmetric Vision-Brain Alignment
sokikatayama
0
150
SoftMatcha 2: 1兆語規模コーパスの超高速かつ柔らかい検索
e869120_sub
7
3.7k
ScoreMatchingRiesz for Automatic Debiased Machine Learning and Policy Path Estimation with an Application to Japanese Monetary Policy Evaluation
masakat0
0
310
Dual Quadric表現を用いた動的物体追跡とRGB-D・IMU制約の密結合によるオドメトリ推定
nanoshimarobot
0
480
AIを叩き台として、 「検証」から「共創」へと進化するリサーチ
mela_dayo
0
330
HAKARI-Bench - 実運用視点での情報検索モデル評価ベンチマーク
hotchpotch
1
630
Anthropic が提案する LLM の内部状態を自然言語で説明可能にした Natural Language Autoencoders / Natural Language Autoencoders Produce Unsupervised Explanations of LLM Activations
shunk031
0
160
XDPerf: A High-Performance Traffic Generator Built with WASM and eBPF
takehaya
0
180
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Fireside Chat
paigeccino
42
4k
How Software Deployment tools have changed in the past 20 years
geshan
1
34k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Context Engineering - Making Every Token Count
addyosmani
9
1k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
240
Raft: Consensus for Rubyists
vanstee
141
7.6k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.8k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
330
Art, The Web, and Tiny UX
lynnandtonic
304
22k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
41k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
330
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