<?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>RyanD &#187; Server Side</title>
	<atom:link href="http://blog.ryandonahue.net/topics/server-side/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ryandonahue.net</link>
	<description>Culture + Technology</description>
	<lastBuildDate>Thu, 26 Jan 2012 01:01:11 +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>A development environment using subdomains and rsync</title>
		<link>http://blog.ryandonahue.net/2010/08/a-working-development-environment-using-subdomains-and-rsync/</link>
		<comments>http://blog.ryandonahue.net/2010/08/a-working-development-environment-using-subdomains-and-rsync/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 19:15:35 +0000</pubDate>
		<dc:creator>RyanD</dc:creator>
				<category><![CDATA[Process]]></category>
		<category><![CDATA[Server Side]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[production]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://blog.ryandonahue.net/?p=39</guid>
		<description><![CDATA[Since the beginning of my tenure at George Eastman House, I&#8217;ve longed for the time to implement an honest-to-goodness development environment.   I&#8217;d flirted with purchasing a second hosting package to do development work, but if version of software weren&#8217;t sync&#8217;d, why bother having a development environment anyways? Enter rsync. rsync is an open source utility [...]]]></description>
			<content:encoded><![CDATA[<p>Since the beginning of my tenure at <a href="http://www.eastmanhouse.org">George Eastman House</a>, I&#8217;ve longed for the time to implement an honest-to-goodness development environment.   I&#8217;d flirted with purchasing a second hosting package to do development work, but if version of software weren&#8217;t sync&#8217;d, why bother having a development environment anyways?</p>
<p>Enter <a href="http://www.samba.org/rsync/">rsync</a>.</p>
<blockquote><p>rsync is an <a href="http://www.opensource.org/">open source</a> utility that provides fast incremental file transfer. rsync is freely available under the <a href="http://www.samba.org/rsync/GPL.html">GNU General Public License</a> and is currently being maintained by <a href="http://opencoder.net/">Wayne Davison</a>.</p></blockquote>
<p>I recently re-organized the files on the host, diving them up to keep library files out of the accessible document root, and to better organize files in general.</p>
<p>The overall layout is very similar to java source package layouts.  The home directory for the host contains directories that correspond with domain names, and each sub-domain (including www) is labeled as such inside the domain folder.  There is a mirror of this structure for any website files I wish to not ever directly serve (php libs, config files, etc.).</p>
<p>This yields a directory structure similar to the one depicted below:</p>
<p><code><br />
/example.org/<br />
/example.org/www/<br />
/example.org/www/index.php<br />
/example.org/dev/<br />
/example.org/dev/index.php<br />
/example.org/static<br />
/example.org/image<br />
...<br />
</code></p>
<p>www is, of course, mapped to www.eastmanhouse.org, and dev mapped to dev.eastmanhouse.org.</p>
<p>When I make a change, I make it to the files in the dev domain, and send a link to the user requesting the change.  Upon their confirmation that the change is made to their liking, the result is pushed to production by calling <code>rsync -auv</code>, which is actually triggered by a web facing admin function (to save me from having to ssh in every time I have to make a small change.</p>
<p>So far, its working wonders.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ryandonahue.net/2010/08/a-working-development-environment-using-subdomains-and-rsync/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Adventure in arbitrary PHP in WordPress.</title>
		<link>http://blog.ryandonahue.net/2009/08/an-adventure-in-arbitrary-php-in-wordpress/</link>
		<comments>http://blog.ryandonahue.net/2009/08/an-adventure-in-arbitrary-php-in-wordpress/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 05:06:09 +0000</pubDate>
		<dc:creator>RyanD</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Server Side]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Roman Numerals]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.ryandonahue.net/?p=20</guid>
		<description><![CDATA[One of the finishing touches I wanted to add to this blog theme was a copyright statement in roman numerals. Inserting arbitrary PHP into WordPress isn’t as straightforward as it should be, so I’ve outlined instructions below: 1. Edit the functions.php file of your theme to add the following code (courtesy Pradeep S). // A [...]]]></description>
			<content:encoded><![CDATA[<p>One of the finishing touches I wanted to add to this blog theme was a copyright<br />
statement in <a href="http://en.wikipedia.org/wiki/roman_numerals">roman numerals</a>. Inserting arbitrary PHP into <a href="http://www.wordpress.org">WordPress</a> isn’t as straightforward as it should be, so I’ve outlined instructions below:</p>
<p>1. Edit the <code>functions.php</code> file of your theme to add the following code (courtesy <a href="http://blog.pradeep.net.in/">Pradeep S</a>).</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// A function to return the Roman Numeral, given an integer</span>
  <span style="color: #000000; font-weight: bold;">function</span> numberToRoman<span style="color: #009900;">&#40;</span><span style="color: #000088;">$num</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// use int value</span>
    <span style="color: #000088;">$n</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$num</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$lookup</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
      <span style="color: #0000ff;">'M'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1000</span><span style="color: #339933;">,</span> 
      <span style="color: #0000ff;">'CM'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">900</span><span style="color: #339933;">,</span> 
      <span style="color: #0000ff;">'D'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">500</span><span style="color: #339933;">,</span> 
      <span style="color: #0000ff;">'CD'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">400</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'C'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">,</span> 
      <span style="color: #0000ff;">'XC'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">90</span><span style="color: #339933;">,</span> 
      <span style="color: #0000ff;">'L'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">50</span><span style="color: #339933;">,</span> 
      <span style="color: #0000ff;">'XL'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">40</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'X'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> 
      <span style="color: #0000ff;">'IX'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">9</span><span style="color: #339933;">,</span> 
      <span style="color: #0000ff;">'V'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span> 
      <span style="color: #0000ff;">'IV'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span> 
      <span style="color: #0000ff;">'I'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span>
     <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$lookup</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$roman</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$matches</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$n</span> <span style="color: #339933;">/</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$result</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">str_repeat</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$roman</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$n</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$n</span> <span style="color: #339933;">%</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$result</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>2. Edit the <code>footer.php</code> file in the theme to add a reference to the new function in the copyright block.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;footer&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;grid_12&quot;</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span><span style="color: #ddbb00;">&amp;copy;</span> <span style="color: #009900;">&lt;?php echo numberToRoman<span style="color: #66cc66;">&#40;</span>date<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Y&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; ?&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
  <span style="color: #009900;">&lt;?php wp_footer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></pre></div></div>

<p>3. You&#8217;re done!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ryandonahue.net/2009/08/an-adventure-in-arbitrary-php-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

