<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Brian Wigginton &#187; PHP</title>
	<atom:link href="http://www.bwigg.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bwigg.com</link>
	<description>Lab and Nerdery</description>
	<lastBuildDate>Fri, 03 Feb 2012 04:15:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Magento Sidebar Categories</title>
		<link>http://www.bwigg.com/2010/01/magento-sidebar-categories/</link>
		<comments>http://www.bwigg.com/2010/01/magento-sidebar-categories/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 05:06:37 +0000</pubDate>
		<dc:creator>bawigga</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bwigg.com/?p=209</guid>
		<description><![CDATA[The following will display a list of categories in your store in your right sidebar. Layout Alter page.xml so that the default handle's right block contains the following: &#60;block type=&#34;catalog/navigation&#34; name=&#34;category.listing&#34; template=&#34;catalog/navigation/categories.phtml&#34; /&#62; My final right block looks as follows &#60;block type=&#34;core/text_list&#34; name=&#34;right&#34; as=&#34;right&#34;&#62; &#60;block type=&#34;catalog/navigation&#34; name=&#34;featured&#34; template=&#34;catalog/featured_random.phtml&#34; /&#62; &#60;block type=&#34;catalog/navigation&#34; name=&#34;category.listing&#34; template=&#34;catalog/navigation/categories.phtml&#34; /&#62; &#60;/block&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following will display a list of categories in your store in your right sidebar.</p>
<h2>Layout</h2>
<p>Alter page.xml so that the default handle's right block contains the following:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;block</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;catalog/navigation&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;category.listing&quot;</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;catalog/navigation/categories.phtml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>My final right block looks as follows</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;block</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;core/text_list&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;right&quot;</span> <span style="color: #000066;">as</span>=<span style="color: #ff0000;">&quot;right&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;block</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;catalog/navigation&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;featured&quot;</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;catalog/featured_random.phtml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;block</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;catalog/navigation&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;category.listing&quot;</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;catalog/navigation/categories.phtml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/block<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h2>Template</h2>
<p>Create the file template/catalog/navigation/categories.phtml and paste in the following</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;block block-layered-nav&quot;&gt;
  &lt;div class=&quot;block-title&quot;&gt;
    &lt;h2&gt;Categories&lt;/h2&gt;
  &lt;/div&gt;
  &lt;div class=&quot;block-content&quot;&gt;
    &lt;ul id=&quot;nav_category&quot; class=&quot;nav_category&quot;&gt;
    	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStoreCategories</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$_category</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">drawItem</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_category</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endforeach</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;/ul&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bwigg.com/2010/01/magento-sidebar-categories/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Magento Sidebar Featured Products</title>
		<link>http://www.bwigg.com/2010/01/magento-featured-products-in-sidebar/</link>
		<comments>http://www.bwigg.com/2010/01/magento-featured-products-in-sidebar/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 04:59:18 +0000</pubDate>
		<dc:creator>bawigga</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bwigg.com/?p=195</guid>
		<description><![CDATA[This tutorial will explain how to add a featured product to the sidebar. In this example we will add the featured product to the right sidebar. The steps we will follow are as follows. Create a new category in the magento admin area to contain our featured products. Add the block calls to the XML [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial will explain how to add a featured product to the sidebar. In this example we will add the featured product to the right sidebar. The steps we will follow are as follows.</p>
<ol>
<li>Create a new category in the magento admin area to contain our featured products.</li>
<li>Add the block calls to the XML Layout</li>
<li>Create the phtml template files to be referenced by the block</li>
</ol>
<h2>Category</h2>
<p>Add a new category to your store to contain your featured products. Make it inactive and jot down the id that it is given once saved. Add any products you want to consider featured to this category. Also make sure this category is not a root category.</p>
<h2>Layout</h2>
<p>Open page.xml and inside your default handle's right block add the following line.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;block</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;catalog/navigation&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;featured&quot;</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;catalog/featured_random.phtml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>My finished right block looks as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;block</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;core/text_list&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;right&quot;</span> <span style="color: #000066;">as</span>=<span style="color: #ff0000;">&quot;right&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;block</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;catalog/navigation&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;featured&quot;</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;catalog/featured_random.phtml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;block</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;catalog/navigation&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;category.listing&quot;</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;catalog/navigation/categories.phtml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/block<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h2>Template</h2>
<p>Use the following code for featured_random.phtml</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category   design_default
* @package    Mage
* @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #000088;">$category_id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;25&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// category_id for &quot;Featured Products&quot;</span>
<span style="color: #000088;">$_productCollection</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getResourceModel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog/product_collection'</span><span style="color: #009900;">&#41;</span>
  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttributeToSelect</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'price'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'small_image'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'inner'</span><span style="color: #009900;">&#41;</span>
  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">addCategoryFilter</span><span style="color: #009900;">&#40;</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">getModel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog/category'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$category_id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_productCollection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> 
  <span style="color: #000088;">$products</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_productCollection</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$_product</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$products</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_product</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  <span style="color: #000088;">$_product</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$products</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$products</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div class=&quot;block block-featured-product&quot;&gt;
  &lt;div class=&quot;block-title&quot;&gt;
    &lt;h2&gt;Featured Product&lt;/h2&gt;
  &lt;/div&gt;
  &lt;div class=&quot;block-content&quot;&gt;
    &lt;ul id=&quot;featured-product-list&quot;&gt;
      &lt;li class=&quot;featured-product&quot;&gt;
          &lt;h4&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">htmlEscape</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h4&gt;
          &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getProductUrl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">htmlEscape</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getImageLabel</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_product</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'small_image'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
            &lt;img class=&quot;product-image&quot; src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog/image'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">init</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_product</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'small_image'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">resize</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">117</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">117</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; alt=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">htmlEscape</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getImageLabel</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_product</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'small_image'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">htmlEscape</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getImageLabel</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_product</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'small_image'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;
          &lt;/a&gt;
          &lt;a class=&quot;view-item-button&quot; href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getProductUrl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">htmlEscape</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;View Item&lt;/a&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>Resources:</strong></p>
<ul>
<li>Elias Interactive - Adapted from <a title="Homepage Featured Products" href="http://www.eliasinteractive.com/blog/magento-featured-products-a-more-convenient-way-to-display-featured-products-on-the-home-page" target="_blank">Homepage Featured Products</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.bwigg.com/2010/01/magento-featured-products-in-sidebar/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Subversion: Continuous Integration with a PHP Application</title>
		<link>http://www.bwigg.com/2009/10/subversion-continuous-integration-with-a-php-application/</link>
		<comments>http://www.bwigg.com/2009/10/subversion-continuous-integration-with-a-php-application/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 21:13:32 +0000</pubDate>
		<dc:creator>bawigga</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://www.bwigg.com/?p=110</guid>
		<description><![CDATA[Abstract This tutorial explains how to update a staging site whenever there is a commit to the SVN repository. This assumes basic knowledge of Subversion, Apache and C and that the staging site is running a working copy checked out from the repository. Problem &#38; Solution When working close with designers or other non-coders it's [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Abstract</strong></p>
<p>This tutorial explains how to update a staging site whenever there is a commit to the SVN repository. This assumes basic knowledge of Subversion, Apache and C and that the staging site is running a working copy checked out from the repository.</p>
<p><strong>Problem &amp; Solution<br />
</strong></p>
<p>When working close with designers or other non-coders it's often most productive to be able to make quick changes live to the box serving up the dev site, then to commit a change then update the server over and over. The bigger issue is that there is now modified code on the dev site that's not revisioned with subversion. To solve this problem we are going to update the codebase for the development site whenever anyone commits changes to the subversion repository.</p>
<p><strong>update_svn</strong></p>
<p>update_svn is a C program that will make a call to the svn command with our designated username and password and update the working copy. This program should live inside your applications directory.</p>
<p><em>update.c</em></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#include &lt;stddef.h&gt;</span>
<span style="color:#008000; font-style:italic;">#include &lt;stdlib.h&gt;</span>
<span style="color:#008000; font-style:italic;">#include &lt;unistd.h&gt;</span>
int main<span style="color:#006600; font-weight:bold;">&#40;</span>void<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#006600; font-weight:bold;">&#123;</span>
     execl<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;/usr/bin/svn&quot;</span>, <span style="color:#996600;">&quot;svn&quot;</span>, <span style="color:#996600;">&quot;update&quot;</span>, <span style="color:#996600;">&quot;--username&quot;</span>,
     <span style="color:#996600;">&quot;USERNAME&quot;</span>, <span style="color:#996600;">&quot;--password&quot;</span>, <span style="color:#996600;">&quot;PASSWORD&quot;</span>,
     <span style="color:#996600;">&quot;/var/www/website/&quot;</span>,  <span style="color:#006600; font-weight:bold;">&#40;</span>const char <span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#41;</span> NULL<span style="color:#006600; font-weight:bold;">&#41;</span>;
     <span style="color:#0000FF; font-weight:bold;">return</span><span style="color:#006600; font-weight:bold;">&#40;</span>EXIT_FAILURE<span style="color:#006600; font-weight:bold;">&#41;</span>;
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>Compile and add permissions</p>
<p><code>gcc svn_update.c -o /var/www/website/update_svn<br />
chmod +s update_svn</code></p>
<p><strong>Subversion post-commit hook</strong></p>
<p>In our subversion repository's post-commit script we want to add a call to update_svn. Add the following line to your post-commit script:</p>
<p><code>/var/www/website/update_svn</code></p>
<p>Resources:</p>
<ul>
<li><a title="SVN Post Commit script to update php code" href="http://dtbaker.com.au/random-bits/svn-post-commit-script-to-update-php-code.html">David Baker: SVN Post Commit script to update php code</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.bwigg.com/2009/10/subversion-continuous-integration-with-a-php-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

