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

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
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
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 

Practical SVN for PHP Developers