• Technosailor.com
  • Desk of the Editor
  • Entrepreneurship
  • Web Marketing
  • Tech Policy
  • Contenido Español
Technosailor
  • Authors
  • Twitter Pitch Me!
  • Disclosures
May
09
2007

Customized WordPress: SVN Externals

Posted by: Aaron Brazell

Let’s say you have a WordPress repository (because you previously set one up) and you have a firm understanding of the basics of Subversion. You’re almost to the point where you can begin customizing WordPress for your own use. Being an employee of a blog network, I’d prefer if this was used for your own personal benefit, however I recognize that one of the main benefactors of such a scheme are blog networks or folks providing commercialized instances of WordPress - generally hosted as this makes good business sense under GPL and commercialization (you don’t have to give away any code and commercial modifications then), but I digress. :-)

Now assume for a minute that you actually want to customize WordPress. The defacto way of accomplishing this is through plugins. WordPress is very extensible and allows for most any default behaviour to be modified via plugin hooks. Thousands of plugins already exist at the WordPress plugin repository. Even better, all of these plugins are also available as SVN repositories. So why not use them as such?

Subversion gives us the benefit of using svn:externals, a property of each folder in a repository, to define external repositories (i.e. plugin repositories) to include files and folders that are not controlled by the repository, but are still included.

Ok, so it’s a little difficult to explian, but a good example of this is how Automattic has bundled the Akismet plugin as an external. If you were to checkout the WordPress code, you would find that Akismet is bundled as an external entity - it is not controlled by the WordPress repository itself.

We can do the same thing with our WordPress repository.

Adding SVN Externals

You can add any external SVN repository to your custom WordPress but the most likely candidate for this tool is to bundle plugins. Assume you wanted to bundle my Embargo Press Release plugin. You would use the svn propedit command to get this done.

macbrain:~/svn/wpwc aaron$ svn propedit svn:externals wp-content/plugins

This generally brings up vi for editing. If you’re not familiar with vi, go get familiar. It’s your best friend on the unix commandline.

The syntax for the svn:externals property is like this:

embargo http://svn.wp-plugins.org/embargo-press-release/trunk/

The first portion is the directory name that the contents of the repository will be downloaded into. At this time, there is no way in subversion to grab individual files - only directories. You can designate specific revision numbers, a practice that is encouraged to ensure no accidental breakage. To do so, you might formulate the property as such:

embargo -r 12438 http://svn.wp-plugins.org/embargo-press-release/trunk/

Place additional repositories on subsequent lines and remember when you’re done to commit your changes!

macbrain:~/svn/wpwc aaron$ svn ci -m "svn:externals modifications"

Though SVN is great and the svn:externals properites gives us alot of flexibility, sometimes we actually have to modify core files. I’ll show you how to do that next time,

Table of contents for Build Your Own WordPress Repository

  1. Customized WordPress: Understanding Subversion
  2. Customized WordPress: Setting up an SVN Repository
  3. Customized WordPress: SVN Externals
  4. Customized WordPress: Applying Patches to WordPress
  5. Customized WordPress: Reasons for Doing It
Previous in series Next in series
  • Add to Mixx!
  • Stumble it!
About the Author: Aaron Brazell is the lead editor of Technosailor.com and a social media expert. His passion is to see companies and individuals use the internet and web technologies wisely and effectively to promote their brands and companies. He is Business Development Manager for Lijit and he worked as Director of Technology at b5media from 2005-2008 and is currently an independent consultant.
Tagged: at 11:50 am -
discussion by DISQUS

Add New Comment

  • Subscribe:  This Thread
  • Go to:  My Comments ·  Community Page
  • Thanks. Your comment is awaiting approval by a moderator.

    Do you already have an account? Log in and claim this comment.

    discussion by DISQUS

    Add New Comment

    close Joe Chill(joechill)
    konvict

    status via twitter

    Murdering the Wayne parents, creating Batman · 2 minutes ago

    recent comments (follow comments)

      View Profile »
      Powered by Disqus · Learn more
      blog comments powered by Disqus
      Powered by Defender Hosting
      Freshbooks
      • Recent Posts

        • Entrepreneurship Writer Wanted
        • Google Shiny is Not as Hot as You would Think
        • 99.96% Uptime is Bogus Marketing
        • Google Blog Platform
        • I am Famous, Therefore I Blog
      • Recent Comments

        Powered by Disqus
      • Tags

        Aaron Brazell Advertising Apple b5media Blogging book conferences Design entrepreneurship Facebook Finance and Funding Google guest_blogging holidays humor hurricanes_and_natural_disasters interesting job Links Marketing Music nfl Op-Ed Perfect Pitch personal politics pr Predictions productivity Programming Security Social Issues Social Media Social Networking social_issues Sports Tech Industry Technology Technosailor Travel twitter unix Venture Files WordPress you_can_blog

      • License Creative Commons Attribution-Noncommercial-Share Alike 3.0 | Copyright © 2004 - 2008 - Aaron Brazell | Lisa helped out | Privacy Policy

        Twitter Pitch!

        <p>Twitter pitching is a form of pitch that requires succint "what does this mean for me" kind of pitching. It is the ultimate efficiency of words. You have 140 characters or less to tell me why your pitch matters to me or my readers. Please include a means of contacting you. This is included in your 140 characters. If you send successive pitches, you will likely be ignored, unless it's obvious that the first pitch was a case of "accidental send", etc.</p> <p>This form of pitching does not mean I'm being a diva. It means that my time is valuable, and you want a piece of it. It's good practice for you, and delivers your pitch in a format I want. Win-win.</p>


        (X) Close

        Twitter Pitch Me!