SlideShare a Scribd company logo
1 of 93
Practical SVN  for PHP Developers Matthew Weier O'Phinney Project Lead Zend Framework Lorna Jane Mitchell Software Engineer Ibuildings
What is Version Control?
[object Object],[object Object],Change Management
Types of  Version Control
[object Object],[object Object],[object Object],[object Object],Distributed
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Non-Distributed
What is Subversion?
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Subversion is...
Installing Subversion
Choose a Protocol
[object Object],[object Object],[object Object],Local filesystem
[object Object],[object Object],[object Object],svn+ssh
[object Object],[object Object],[object Object],[object Object],WebDAV via HTTP/S
Installing on Linux
[object Object],[object Object],Distribution packages
[object Object],[object Object],[object Object],From source
Setting up a repository
What  is  a repository ?
[object Object],[object Object],A repository is...
Creating the repository
Use “svnadmin create”
Create initial content
Commit initial structure
Alternate way: import into the repo
About repository structure
[object Object],[object Object],[object Object],[object Object],Repository Structure
Using Subversion
Checkout: svn checkout (co)
.svn directory
Status: svn status (st)
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Common status codes
Add to repo: svn add
Commit to repo: svn commit (ci)
Changelog: svn log
Dealing with missing files
[object Object],[object Object],[object Object],[object Object],Missing files - ! in the status
What and When to commit
[object Object],[object Object],Bad  practices
Each commit should include all code, tests, and docs related to a discrete behavior or set of functionality. The  Best Practice:
[object Object],[object Object],Why?
Examples
Examples
[object Object],[object Object],[object Object],How?
Conflicts
[object Object],[object Object],svn blame
Example
[object Object],[object Object],Conflicts
[object Object],[object Object],[object Object],[object Object],Example: conflict adds files
[object Object],[object Object],[object Object],svn resolved
[object Object],[object Object],[object Object],Avoiding Conflicts
Branching and Tagging
Patterns
Feature Branches Graph by Eli White
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Feature Branches
Long-lived Branches Graph by Eli White
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Long-lived Branches
Release Branches Graph by Eli White
[object Object],[object Object],[object Object],[object Object],[object Object],Release Branches
Merging
[object Object],[object Object],[object Object],Merging
[object Object],[object Object],[object Object],[object Object],How to merge
[object Object],[object Object],[object Object],How to merge: the easy way
Administering Repositories
Backing up your Repository
[object Object],[object Object],svnadmin hotcopy
Authentication
[object Object],[object Object],[object Object],[object Object],[object Object],svnserve or svn+ssh
[object Object],[object Object],[object Object],[object Object],WebDAV (http/https)
Example HTTP Auth configuration
Authorization
[object Object],[object Object],[object Object],[object Object],[object Object],ACL File
[object Object],[object Object],[object Object],[object Object],ACL File
ACL File: example
[object Object],[object Object],[object Object],[object Object],ACL File: placement
ACL File in WebDAV: vhost setup
Hooks
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],What are hooks?
Running a linter REPOS = "$1" TXN = "$2" PHP = "/path/to/php" SVNLOOK = "/path/to/svnlook" AWK = "/path/to/awk" GREP = "/path/to/egrep" SED = "/path/to/sed" CHANGED = `$SVNLOOK changed -t "$TXN" "$REPOS" | $AWK '{print $2}' | $GREP   .php$` for   FILE   in   $CHANGED do MESSAGE = `$SVNLOOK cat -t "$TXN" "$REPOS" "$FILE" | $PHP -l` if   [   $?   - ne   0   ] then echo   1 >& 2 echo   "***********************************"   1 >& 2 echo   "PHP error in: $FILE:"   1 >& 2 echo   `echo "$MESSAGE" | $SED "s| -| $FILE|g"`   1 >& 2 echo   "***********************************"   1 >& 2 exit   1 fi done
*********************************** PHP error in: test.php echo $foobar *********************************** Sample linter output
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Running unit tests
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Sending notifications
Example notification:
[object Object],[object Object],Publishing RSS Feeds
Adding svn2feed.py to your  post-commit hook: path / to / python path / to / hooks / svn2feed.py -- svn - path   / usr / bin /   -- max - items = 100   -- format = atom -- revision   "$REV"   – item - url   "http://localhost/svn/"  -- feed - url = "http://localhost/rss/svn.rss"  -- feed - file   "path/to/rss/svn.rss"  "$REPOS"   &
[object Object],[object Object],[object Object],Generating documentation
[object Object],[object Object],[object Object],[object Object],[object Object],Running PHP_CodeSniffer
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],PHP_CodeSniffer hook output
[object Object],For more info on PHP_CodeSniffer:
Deploying from SVN
[object Object],[object Object],[object Object],[object Object],Deployment Considerations
[object Object],[object Object],[object Object],[object Object],[object Object],Checkout or Export
[object Object],[object Object],[object Object],[object Object],[object Object],Best Practices
Thank you.

More Related Content

What's hot

Subversion proper renaming and merging as if you’ve read the whole code of co...
Subversion proper renaming and merging as if you’ve read the whole code of co...Subversion proper renaming and merging as if you’ve read the whole code of co...
Subversion proper renaming and merging as if you’ve read the whole code of co...
Fazreil Amreen Abdul Jalil
 
Simon Laws – Apache Flink Cluster Deployment on Docker and Docker-Compose
Simon Laws – Apache Flink Cluster Deployment on Docker and Docker-ComposeSimon Laws – Apache Flink Cluster Deployment on Docker and Docker-Compose
Simon Laws – Apache Flink Cluster Deployment on Docker and Docker-Compose
Flink Forward
 

What's hot (20)

Jaringan, Linux, Docker
Jaringan, Linux, DockerJaringan, Linux, Docker
Jaringan, Linux, Docker
 
The Gory Details of Debian packages
The Gory Details of Debian packagesThe Gory Details of Debian packages
The Gory Details of Debian packages
 
Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo Platform
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
Docker & ci
Docker & ciDocker & ci
Docker & ci
 
Concourse Workshop
Concourse WorkshopConcourse Workshop
Concourse Workshop
 
ONOS System Test - ONS2016
ONOS System Test - ONS2016ONOS System Test - ONS2016
ONOS System Test - ONS2016
 
PVS-Studio in the Clouds: Travis CI
PVS-Studio in the Clouds: Travis CIPVS-Studio in the Clouds: Travis CI
PVS-Studio in the Clouds: Travis CI
 
Divorcing System
Divorcing SystemDivorcing System
Divorcing System
 
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebCleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
 
Subversion proper renaming and merging as if you’ve read the whole code of co...
Subversion proper renaming and merging as if you’ve read the whole code of co...Subversion proper renaming and merging as if you’ve read the whole code of co...
Subversion proper renaming and merging as if you’ve read the whole code of co...
 
Simon Laws – Apache Flink Cluster Deployment on Docker and Docker-Compose
Simon Laws – Apache Flink Cluster Deployment on Docker and Docker-ComposeSimon Laws – Apache Flink Cluster Deployment on Docker and Docker-Compose
Simon Laws – Apache Flink Cluster Deployment on Docker and Docker-Compose
 
Rational Robot (http://www.geektester.blogspot.com)
Rational Robot (http://www.geektester.blogspot.com)Rational Robot (http://www.geektester.blogspot.com)
Rational Robot (http://www.geektester.blogspot.com)
 
Introduce fuego
Introduce fuegoIntroduce fuego
Introduce fuego
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90mins
 
Care and Feeding of Large Web Applications
Care and Feeding of Large Web ApplicationsCare and Feeding of Large Web Applications
Care and Feeding of Large Web Applications
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 
Infrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfraInfrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfra
 
Docker 2014
Docker 2014Docker 2014
Docker 2014
 
Drupal & Continous Integration - SF State Study Case
Drupal & Continous Integration - SF State Study CaseDrupal & Continous Integration - SF State Study Case
Drupal & Continous Integration - SF State Study Case
 

Similar to Practical SVN for PHP Developers

SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best Practices
Ashraf Fouad
 
Introduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project HostingIntroduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project Hosting
Philip Johnson
 
Introduction to Version Control and Configuration Management
Introduction to Version Control and Configuration ManagementIntroduction to Version Control and Configuration Management
Introduction to Version Control and Configuration Management
Philip Johnson
 
Subversion
SubversionSubversion
Subversion
thebdot1
 

Similar to Practical SVN for PHP Developers (20)

SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best Practices
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
 
Introduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project HostingIntroduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project Hosting
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best Practices
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version Control
 
Introduction to Version Control and Configuration Management
Introduction to Version Control and Configuration ManagementIntroduction to Version Control and Configuration Management
Introduction to Version Control and Configuration Management
 
Totalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By GopiTotalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By Gopi
 
ClearCase Basics
ClearCase BasicsClearCase Basics
ClearCase Basics
 
Getting Started With Subversion
Getting Started With SubversionGetting Started With Subversion
Getting Started With Subversion
 
SVN Tutorial
SVN TutorialSVN Tutorial
SVN Tutorial
 
Subversion (SVN)
Subversion (SVN)Subversion (SVN)
Subversion (SVN)
 
Subversion
SubversionSubversion
Subversion
 
Intro To Version Control
Intro To Version ControlIntro To Version Control
Intro To Version Control
 
Digital Fabrication Studio v.0.2: Information
Digital Fabrication Studio v.0.2: InformationDigital Fabrication Studio v.0.2: Information
Digital Fabrication Studio v.0.2: Information
 
subversion.ppt
subversion.pptsubversion.ppt
subversion.ppt
 
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
 
Subversion
SubversionSubversion
Subversion
 
Version Control Training - First Lego League
Version Control Training - First Lego LeagueVersion Control Training - First Lego League
Version Control Training - First Lego League
 

More from Lorna Mitchell

Understanding Distributed Source Control
Understanding Distributed Source ControlUnderstanding Distributed Source Control
Understanding Distributed Source Control
Lorna Mitchell
 

More from Lorna Mitchell (20)

OAuth: Trust Issues
OAuth: Trust IssuesOAuth: Trust Issues
OAuth: Trust Issues
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
 
Best Practice in API Design
Best Practice in API DesignBest Practice in API Design
Best Practice in API Design
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open Source
 
Business 101 for Developers: Time and Money
Business 101 for Developers: Time and MoneyBusiness 101 for Developers: Time and Money
Business 101 for Developers: Time and Money
 
Things I wish web graduates knew
Things I wish web graduates knewThings I wish web graduates knew
Things I wish web graduates knew
 
Teach a Man To Fish (phpconpl edition)
Teach a Man To Fish (phpconpl edition)Teach a Man To Fish (phpconpl edition)
Teach a Man To Fish (phpconpl edition)
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
 
Join In With Joind.In
Join In With Joind.InJoin In With Joind.In
Join In With Joind.In
 
Tool Up Your LAMP Stack
Tool Up Your LAMP StackTool Up Your LAMP Stack
Tool Up Your LAMP Stack
 
Going Freelance
Going FreelanceGoing Freelance
Going Freelance
 
Understanding Distributed Source Control
Understanding Distributed Source ControlUnderstanding Distributed Source Control
Understanding Distributed Source Control
 
Best Practice in Web Service Design
Best Practice in Web Service DesignBest Practice in Web Service Design
Best Practice in Web Service Design
 
Coaching Development Teams: Teach A Man To Fish
Coaching Development Teams: Teach A Man To FishCoaching Development Teams: Teach A Man To Fish
Coaching Development Teams: Teach A Man To Fish
 
Zend Certification Preparation Tutorial
Zend Certification Preparation TutorialZend Certification Preparation Tutorial
Zend Certification Preparation Tutorial
 
Implementing OAuth with PHP
Implementing OAuth with PHPImplementing OAuth with PHP
Implementing OAuth with PHP
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 
Object Oriented Programming in PHP
Object Oriented Programming in PHPObject Oriented Programming in PHP
Object Oriented Programming in PHP
 
Example Presentation
Example PresentationExample Presentation
Example Presentation
 
Could You Telecommute?
Could You Telecommute?Could You Telecommute?
Could You Telecommute?
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Practical SVN for PHP Developers