SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
Composer
Power User Tips
Tom Corrigan
Lead Developer - EstimateOne
@tommygnr
Melbourne PHP Users Group
January 2015
Composer just got way faster
• My biggest (and only) complaint about composer is
its speed
• One simple function call has slashed composer
update calls by up to %90
• gc_disable()
• See Anthony Ferrara’s brilliant explanation of how
PHP’s garbage collector works here: http://
blog.ircmaxell.com/2014/12/what-about-
garbage.html
First: What happens when you run
composer update
• Parses your composer.json
• Recurses through dependencies creating Rules for every possible version
• Recurses through the ruleset to determine installable versions
• Performance gets exponentially worse as package count increases
• Downloads updates/ new packages
Let’s find out why
• Running composer update for the packagist app
resulted in over 15 million function calls
• Lots of classes being created, lots of garbage
collector runs
• Except there were no circular references
• The garbage collector was wasting its time
Run composer with HHVM
$ hhvm /usr/local/bin/composer update
or create a simple wrapper
#!/bin/bash
hhvm /usr/local/bin/composer update -v "$@"
Speeding up download
• composer install --prefer-source will give you git
repositories rather than zipballs
• Use it for ongoing projects where you will be
running composer update often
• This isn’t faster the first time
• It will pay you back in spades subsequently
Bonus when installing from source
Tom@Toms-iMac:~/Sites/ascension (master)$ composer update -v
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Updating phpunit/php-token-stream (1.3.0 => 1.4.0)
Checking out db32c18eba00b121c145575fcbcd4d4d24e6db74
Pulling in changes:
db32c18 - Sebastian Bergmann: Update the branch alias to 1.4
802c518 - Milad Rastian: Added tokens introduced in HackLang #43
- Updating mopa/bootstrap-bundle dev-master (184a761 => 32f5c47)
Checking out 32f5c47b575278236dbf28245cb26acbe1d1d5ea
Pulling in changes:
8be5b94 - auipga: Updated @icon-font-path
b500dde - auipga: make $icon-font-path able to override
fa3abea - Marc Valldepérez: added compatibility with symfony 2.3
98ff7b0 - Marc Valldepérez: added compatibility with label_format
Writing lock file
Generating autoload files
Tom@Toms-iMac:~/Sites/ascension (master)$
• composer update -v will
show you the commit
messages for all
changes
• this is extremely useful
when using unstable
deps
Tracking down bugs in third party
code
Scenario:
After running composer update your application
breaks. You track it down to a single library that was
upgraded from 1.0 to 1.1. There were 300 commits
between the two releases and the CHANGELOG
isn’t helpful.
How do you find which commit broke your app?
git bisect to the rescue
• Check the diff for your composer.lock file
• Find the SHA1 hash for the working version
$ git bisect start
$ git bisect bad #Current version is bad
$ git bisect good OLD_SHA1
git bisect to the rescue
• run your tests
• if they pass:
$ git bisect good
• if they fail:
$ git bisect bad
• repeat until you find the guilty commit
Fixing bugs in third party code
Scenario:
After bisecting the third party library to find the bug
you fork the repo, fix the bug and issue a pull request.
You have a warm fuzzy open source feeling but your
app is still broken until the maintainer merges your fix
How do I use my fix before it is merged upstream?
Overriding a package with an inline alias
See: https://getcomposer.org/doc/articles/aliases.md
//composer.json
"require": {
"simplethings/entity-audit-bundle": "dev-m2m-audit as dev-master",
//...
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/tommygnr/EntityAudit"
}
],
ToranProxy
• Created by Jordi Boggiano
• Acts as a proxy & cache for packagist and
github
• Helps support ongoing development of
composer
• https://toranproxy.com/
Questions
?

Weitere ähnliche Inhalte

Was ist angesagt?

Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With SubversionSamnang Chhun
 
Joomla! Day Poland 2012 - Advanced Akeeba Backup - Beyond just backing up you...
Joomla! Day Poland 2012 - Advanced Akeeba Backup - Beyond just backing up you...Joomla! Day Poland 2012 - Advanced Akeeba Backup - Beyond just backing up you...
Joomla! Day Poland 2012 - Advanced Akeeba Backup - Beyond just backing up you...Nicholas Dionysopoulos
 
Subversion Overview
Subversion OverviewSubversion Overview
Subversion Overviewpolarion
 
Composer the right way [SweetlakePHP]
Composer the right way [SweetlakePHP]Composer the right way [SweetlakePHP]
Composer the right way [SweetlakePHP]Rafael Dohms
 
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS) Par Jean-...
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS)  Par Jean-...XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS)  Par Jean-...
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS) Par Jean-...Publicis Sapient Engineering
 
Cfg Mgmtcamp 2015 - Releases
Cfg Mgmtcamp 2015 - ReleasesCfg Mgmtcamp 2015 - Releases
Cfg Mgmtcamp 2015 - ReleasesCFEngine
 
Brief introduction to Symfony Flex
Brief introduction to Symfony FlexBrief introduction to Symfony Flex
Brief introduction to Symfony FlexFedir Kryvytskyi
 
Config Management Camp 2015 - How to Deploy CFEngine in the Open Internet
Config Management Camp 2015 - How to Deploy CFEngine in the Open InternetConfig Management Camp 2015 - How to Deploy CFEngine in the Open Internet
Config Management Camp 2015 - How to Deploy CFEngine in the Open InternetCFEngine
 
CPAN Module Maintenance
CPAN Module MaintenanceCPAN Module Maintenance
CPAN Module MaintenanceDave Cross
 
Deployment with capifony
Deployment with capifonyDeployment with capifony
Deployment with capifonyJan De Coster
 
Part 4 - Managing your svn repository using jas forge
Part 4  - Managing your svn repository using jas forgePart 4  - Managing your svn repository using jas forge
Part 4 - Managing your svn repository using jas forgeJasmine Conseil
 
Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Rafael Dohms
 
ElixirConf Lightning Talk: Elixir |> Production
ElixirConf Lightning Talk: Elixir |> ProductionElixirConf Lightning Talk: Elixir |> Production
ElixirConf Lightning Talk: Elixir |> ProductionJeff Weiss
 
Symfony Live San Franciso 2017 - BDD API Development with Symfony and Behat
Symfony Live San Franciso 2017 - BDD API Development with Symfony and BehatSymfony Live San Franciso 2017 - BDD API Development with Symfony and Behat
Symfony Live San Franciso 2017 - BDD API Development with Symfony and BehatAdam Englander
 
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010 Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010 Matt Gauger
 

Was ist angesagt? (20)

Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With Subversion
 
Joomla! Day Poland 2012 - Advanced Akeeba Backup - Beyond just backing up you...
Joomla! Day Poland 2012 - Advanced Akeeba Backup - Beyond just backing up you...Joomla! Day Poland 2012 - Advanced Akeeba Backup - Beyond just backing up you...
Joomla! Day Poland 2012 - Advanced Akeeba Backup - Beyond just backing up you...
 
Subversion Overview
Subversion OverviewSubversion Overview
Subversion Overview
 
Composer
ComposerComposer
Composer
 
Symfony aws
Symfony awsSymfony aws
Symfony aws
 
Composer the right way [SweetlakePHP]
Composer the right way [SweetlakePHP]Composer the right way [SweetlakePHP]
Composer the right way [SweetlakePHP]
 
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS) Par Jean-...
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS)  Par Jean-...XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS)  Par Jean-...
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS) Par Jean-...
 
Cfg Mgmtcamp 2015 - Releases
Cfg Mgmtcamp 2015 - ReleasesCfg Mgmtcamp 2015 - Releases
Cfg Mgmtcamp 2015 - Releases
 
Brief introduction to Symfony Flex
Brief introduction to Symfony FlexBrief introduction to Symfony Flex
Brief introduction to Symfony Flex
 
Config Management Camp 2015 - How to Deploy CFEngine in the Open Internet
Config Management Camp 2015 - How to Deploy CFEngine in the Open InternetConfig Management Camp 2015 - How to Deploy CFEngine in the Open Internet
Config Management Camp 2015 - How to Deploy CFEngine in the Open Internet
 
CPAN Module Maintenance
CPAN Module MaintenanceCPAN Module Maintenance
CPAN Module Maintenance
 
Deployment with capifony
Deployment with capifonyDeployment with capifony
Deployment with capifony
 
Pinto+Stratopan+Love
Pinto+Stratopan+LovePinto+Stratopan+Love
Pinto+Stratopan+Love
 
Part 4 - Managing your svn repository using jas forge
Part 4  - Managing your svn repository using jas forgePart 4  - Managing your svn repository using jas forge
Part 4 - Managing your svn repository using jas forge
 
Svn Basic Tutorial
Svn Basic TutorialSvn Basic Tutorial
Svn Basic Tutorial
 
Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13
 
ElixirConf Lightning Talk: Elixir |> Production
ElixirConf Lightning Talk: Elixir |> ProductionElixirConf Lightning Talk: Elixir |> Production
ElixirConf Lightning Talk: Elixir |> Production
 
Symfony Live San Franciso 2017 - BDD API Development with Symfony and Behat
Symfony Live San Franciso 2017 - BDD API Development with Symfony and BehatSymfony Live San Franciso 2017 - BDD API Development with Symfony and Behat
Symfony Live San Franciso 2017 - BDD API Development with Symfony and Behat
 
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010 Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
 
fmcsadmin 1.0.0
fmcsadmin 1.0.0fmcsadmin 1.0.0
fmcsadmin 1.0.0
 

Andere mochten auch

Classification of films
Classification of films Classification of films
Classification of films 08murphyc
 
Міський етап Всеукраїнського гуманітарного конкурсу КосмічнІ фантазії
Міський етап Всеукраїнського гуманітарного конкурсу КосмічнІ фантазіїМіський етап Всеукраїнського гуманітарного конкурсу КосмічнІ фантазії
Міський етап Всеукраїнського гуманітарного конкурсу КосмічнІ фантазії08600 Vasilkov
 
MSH Design Brochure (draft / test)
MSH Design Brochure (draft / test)MSH Design Brochure (draft / test)
MSH Design Brochure (draft / test)MSHDinc
 
Appunti della II settimana
Appunti della II settimanaAppunti della II settimana
Appunti della II settimanaservetti
 
Technology and education 1.ppt
Technology and education 1.pptTechnology and education 1.ppt
Technology and education 1.pptchipstrahm
 
Pp reunión pedagógica-3°-4° básicos 2016
Pp reunión pedagógica-3°-4° básicos 2016Pp reunión pedagógica-3°-4° básicos 2016
Pp reunión pedagógica-3°-4° básicos 2016Emmanuel High School
 
Whetstone u09a1.irregular verbs
Whetstone u09a1.irregular verbsWhetstone u09a1.irregular verbs
Whetstone u09a1.irregular verbsjillwhetstone
 
Classification of Films
Classification of Films Classification of Films
Classification of Films 08murphyc
 
Phenomenological Decomposition Heuristics for Process Design Synthesis of Oil...
Phenomenological Decomposition Heuristics for Process Design Synthesis of Oil...Phenomenological Decomposition Heuristics for Process Design Synthesis of Oil...
Phenomenological Decomposition Heuristics for Process Design Synthesis of Oil...Alkis Vazacopoulos
 
Підсумки міського етапу Всеукраїнського конкурсу "Космічні фантазії"
Підсумки міського етапу Всеукраїнського конкурсу "Космічні фантазії" Підсумки міського етапу Всеукраїнського конкурсу "Космічні фантазії"
Підсумки міського етапу Всеукраїнського конкурсу "Космічні фантазії" 08600 Vasilkov
 
Iman bio
Iman bioIman bio
Iman bioimanza
 
IMPRESS Presentation Carnegie Mellon University
IMPRESS Presentation Carnegie Mellon UniversityIMPRESS Presentation Carnegie Mellon University
IMPRESS Presentation Carnegie Mellon UniversityAlkis Vazacopoulos
 
活動攝影的失與得
活動攝影的失與得活動攝影的失與得
活動攝影的失與得小華 黃
 

Andere mochten auch (20)

Classification of films
Classification of films Classification of films
Classification of films
 
Міський етап Всеукраїнського гуманітарного конкурсу КосмічнІ фантазії
Міський етап Всеукраїнського гуманітарного конкурсу КосмічнІ фантазіїМіський етап Всеукраїнського гуманітарного конкурсу КосмічнІ фантазії
Міський етап Всеукраїнського гуманітарного конкурсу КосмічнІ фантазії
 
MSH Design Brochure (draft / test)
MSH Design Brochure (draft / test)MSH Design Brochure (draft / test)
MSH Design Brochure (draft / test)
 
Apexcse
ApexcseApexcse
Apexcse
 
Pecha Kucha
Pecha KuchaPecha Kucha
Pecha Kucha
 
Appunti della II settimana
Appunti della II settimanaAppunti della II settimana
Appunti della II settimana
 
Pasapalabra, marc i akaki
Pasapalabra, marc i akakiPasapalabra, marc i akaki
Pasapalabra, marc i akaki
 
Ahmet yeşilpınar
Ahmet yeşilpınarAhmet yeşilpınar
Ahmet yeşilpınar
 
Technology and education 1.ppt
Technology and education 1.pptTechnology and education 1.ppt
Technology and education 1.ppt
 
Pp reunión pedagógica-3°-4° básicos 2016
Pp reunión pedagógica-3°-4° básicos 2016Pp reunión pedagógica-3°-4° básicos 2016
Pp reunión pedagógica-3°-4° básicos 2016
 
Whetstone u09a1.irregular verbs
Whetstone u09a1.irregular verbsWhetstone u09a1.irregular verbs
Whetstone u09a1.irregular verbs
 
Lettura
LetturaLettura
Lettura
 
Classification of Films
Classification of Films Classification of Films
Classification of Films
 
Letra s 1° basico
Letra s  1° basicoLetra s  1° basico
Letra s 1° basico
 
Phenomenological Decomposition Heuristics for Process Design Synthesis of Oil...
Phenomenological Decomposition Heuristics for Process Design Synthesis of Oil...Phenomenological Decomposition Heuristics for Process Design Synthesis of Oil...
Phenomenological Decomposition Heuristics for Process Design Synthesis of Oil...
 
Підсумки міського етапу Всеукраїнського конкурсу "Космічні фантазії"
Підсумки міського етапу Всеукраїнського конкурсу "Космічні фантазії" Підсумки міського етапу Всеукраїнського конкурсу "Космічні фантазії"
Підсумки міського етапу Всеукраїнського конкурсу "Космічні фантазії"
 
Jet fuelsupplychaindesign
Jet fuelsupplychaindesignJet fuelsupplychaindesign
Jet fuelsupplychaindesign
 
Iman bio
Iman bioIman bio
Iman bio
 
IMPRESS Presentation Carnegie Mellon University
IMPRESS Presentation Carnegie Mellon UniversityIMPRESS Presentation Carnegie Mellon University
IMPRESS Presentation Carnegie Mellon University
 
活動攝影的失與得
活動攝影的失與得活動攝影的失與得
活動攝影的失與得
 

Ähnlich wie Composer Power User Tips

Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19Antonio Peric-Mazar
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with ComposerJason Grimes
 
Symfony 4: A new way to develop applications #phpsrb
 Symfony 4: A new way to develop applications #phpsrb Symfony 4: A new way to develop applications #phpsrb
Symfony 4: A new way to develop applications #phpsrbAntonio Peric-Mazar
 
computer languages
computer languagescomputer languages
computer languagesRajendran
 
Drupal Version Control & File System Basics
Drupal Version Control & File System BasicsDrupal Version Control & File System Basics
Drupal Version Control & File System BasicsJulia Kulla-Mader
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make filesropsu
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fwdays
 
Composer - The missing package manager for PHP
Composer - The missing package manager for PHPComposer - The missing package manager for PHP
Composer - The missing package manager for PHPTareq Hasan
 
How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLabPablo Arriazu
 
Passes of Compiler.pptx
Passes of Compiler.pptxPasses of Compiler.pptx
Passes of Compiler.pptxSanjay Singh
 
Composer the Right Way - MM16NL
Composer the Right Way - MM16NLComposer the Right Way - MM16NL
Composer the Right Way - MM16NLRafael Dohms
 
Composer Tutorial (PHP Hampshire Sept 2013)
Composer Tutorial (PHP Hampshire Sept 2013)Composer Tutorial (PHP Hampshire Sept 2013)
Composer Tutorial (PHP Hampshire Sept 2013)James Titcumb
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .UnixTrong Dinh
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .UnixTrong Dinh
 
What is the merge window?
What is the merge window?What is the merge window?
What is the merge window?Macpaul Lin
 
OnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform BuildOnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform BuildDavid Rosen
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopmentgillygize
 

Ähnlich wie Composer Power User Tips (20)

Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
 
Composer
ComposerComposer
Composer
 
Symfony 4: A new way to develop applications #phpsrb
 Symfony 4: A new way to develop applications #phpsrb Symfony 4: A new way to develop applications #phpsrb
Symfony 4: A new way to develop applications #phpsrb
 
Switching to Git
Switching to GitSwitching to Git
Switching to Git
 
computer languages
computer languagescomputer languages
computer languages
 
Drupal Version Control & File System Basics
Drupal Version Control & File System BasicsDrupal Version Control & File System Basics
Drupal Version Control & File System Basics
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make files
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"
 
Composer - The missing package manager for PHP
Composer - The missing package manager for PHPComposer - The missing package manager for PHP
Composer - The missing package manager for PHP
 
How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLab
 
Passes of Compiler.pptx
Passes of Compiler.pptxPasses of Compiler.pptx
Passes of Compiler.pptx
 
Composer the Right Way - MM16NL
Composer the Right Way - MM16NLComposer the Right Way - MM16NL
Composer the Right Way - MM16NL
 
Composer Tutorial (PHP Hampshire Sept 2013)
Composer Tutorial (PHP Hampshire Sept 2013)Composer Tutorial (PHP Hampshire Sept 2013)
Composer Tutorial (PHP Hampshire Sept 2013)
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 
What is the merge window?
What is the merge window?What is the merge window?
What is the merge window?
 
OnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform BuildOnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform Build
 
Automatic codefixes
Automatic codefixesAutomatic codefixes
Automatic codefixes
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 

Kürzlich hochgeladen

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Kürzlich hochgeladen (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Composer Power User Tips

  • 1. Composer Power User Tips Tom Corrigan Lead Developer - EstimateOne @tommygnr Melbourne PHP Users Group January 2015
  • 2. Composer just got way faster • My biggest (and only) complaint about composer is its speed • One simple function call has slashed composer update calls by up to %90 • gc_disable() • See Anthony Ferrara’s brilliant explanation of how PHP’s garbage collector works here: http:// blog.ircmaxell.com/2014/12/what-about- garbage.html
  • 3. First: What happens when you run composer update • Parses your composer.json • Recurses through dependencies creating Rules for every possible version • Recurses through the ruleset to determine installable versions • Performance gets exponentially worse as package count increases • Downloads updates/ new packages
  • 4. Let’s find out why • Running composer update for the packagist app resulted in over 15 million function calls • Lots of classes being created, lots of garbage collector runs • Except there were no circular references • The garbage collector was wasting its time
  • 5. Run composer with HHVM $ hhvm /usr/local/bin/composer update or create a simple wrapper #!/bin/bash hhvm /usr/local/bin/composer update -v "$@"
  • 6. Speeding up download • composer install --prefer-source will give you git repositories rather than zipballs • Use it for ongoing projects where you will be running composer update often • This isn’t faster the first time • It will pay you back in spades subsequently
  • 7. Bonus when installing from source Tom@Toms-iMac:~/Sites/ascension (master)$ composer update -v Loading composer repositories with package information Updating dependencies (including require-dev) - Updating phpunit/php-token-stream (1.3.0 => 1.4.0) Checking out db32c18eba00b121c145575fcbcd4d4d24e6db74 Pulling in changes: db32c18 - Sebastian Bergmann: Update the branch alias to 1.4 802c518 - Milad Rastian: Added tokens introduced in HackLang #43 - Updating mopa/bootstrap-bundle dev-master (184a761 => 32f5c47) Checking out 32f5c47b575278236dbf28245cb26acbe1d1d5ea Pulling in changes: 8be5b94 - auipga: Updated @icon-font-path b500dde - auipga: make $icon-font-path able to override fa3abea - Marc Valldepérez: added compatibility with symfony 2.3 98ff7b0 - Marc Valldepérez: added compatibility with label_format Writing lock file Generating autoload files Tom@Toms-iMac:~/Sites/ascension (master)$ • composer update -v will show you the commit messages for all changes • this is extremely useful when using unstable deps
  • 8. Tracking down bugs in third party code Scenario: After running composer update your application breaks. You track it down to a single library that was upgraded from 1.0 to 1.1. There were 300 commits between the two releases and the CHANGELOG isn’t helpful. How do you find which commit broke your app?
  • 9. git bisect to the rescue • Check the diff for your composer.lock file • Find the SHA1 hash for the working version $ git bisect start $ git bisect bad #Current version is bad $ git bisect good OLD_SHA1
  • 10. git bisect to the rescue • run your tests • if they pass: $ git bisect good • if they fail: $ git bisect bad • repeat until you find the guilty commit
  • 11. Fixing bugs in third party code Scenario: After bisecting the third party library to find the bug you fork the repo, fix the bug and issue a pull request. You have a warm fuzzy open source feeling but your app is still broken until the maintainer merges your fix How do I use my fix before it is merged upstream?
  • 12. Overriding a package with an inline alias See: https://getcomposer.org/doc/articles/aliases.md //composer.json "require": { "simplethings/entity-audit-bundle": "dev-m2m-audit as dev-master", //... }, "repositories": [ { "type": "vcs", "url": "https://github.com/tommygnr/EntityAudit" } ],
  • 13. ToranProxy • Created by Jordi Boggiano • Acts as a proxy & cache for packagist and github • Helps support ongoing development of composer • https://toranproxy.com/