<?xml version="1.0"?>
<?xml-stylesheet 
 href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rss version="0.91"><channel><title>Planet PHP</title><link>http://planet-php.net</link><description>People blogging about PHP</description><language>en</language><item><title>Code complexity and clean code - Brandon Savage</title><link>http://www.brandonsavage.net/code-complexity-and-clean-code/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=code-complexity-and-clean-code</link><pubDate>Wed, 22 May 2013 11:00:04 +0000</pubDate><description><![CDATA[Many people wonder how they can improve the overall readability and cleanliness of their code. It seems impossible to understand exactly how to rewrite code in such a way that makes it clean, easy to understand and simple to work with. But clean code is about a few simple principles, one of which is reducing [...]]]></description></item><item><title>Development By The Numbers - Slides - Anthony Ferrara</title><link>http://blog.ircmaxell.com/2013/05/development-by-numbers-slides.html</link><pubDate>Tue, 21 May 2013 18:42:00 +0000</pubDate><description><![CDATA[<div style="text-align: justify;">Today, I'm doing a talk at <a href="http://portland2013.drupal.org/node/1078">DrupalCon Portland 2013</a> on Static analysis and code metrics. Here are the slides for that talk. When the videos are posted, I'll make a followup post that links to it. Click through for the slides!</div><div style="text-align: justify;"><br></div><a href="http://blog.ircmaxell.com/2013/05/development-by-numbers-slides.html#more">Read more »</a>]]></description></item><item><title>Dear Ed (A response to Open Sourcing Mental Illness at php[tek] 2013) - Davey Shafik</title><link>http://daveyshafik.com/archives/65721-dear-ed-a-response-to-open-sourcing-mental-illness-at-phptek-2013.html</link><pubDate>Mon, 20 May 2013 16:00:31 +0000</pubDate><description><![CDATA[<blockquote><p>
  <strong>Note:</strong> this post is personal, and may contain triggers for those suffering through grief. Due to it’s nature, I did pass it by Ed before posting it publicly, as every body is different when dealing with their mental illnesses, and this is such a complex topic that it’s difficult to talk about without drawing broad brush strokes that may offend some people. Please keep in mind that this is [some of] <em>my</em> thoughts on this very complicated subject, and you are free to disagree.
</p></blockquote>
<p>Dear Ed,</p>
<p>I felt that I needed to write this letter to you, and I wanted it to be open because I think it’s an appropriate way to participate in open sourcing mental illness. Consider this a pull request of sorts. The only way to remove the stigma around this topic is by talking frankly and <strong>openly</strong> about it.</p>
<p>I’m writing this (specifically) in response to <a href="http://funkatron.com/posts/open-sourcing-mental-illness-at-php_tek13.html">the talk you gave</a> at <a href="http://tek.phparch.com">php[tek]</a> last week. I remember first meeting you, at php|tek (as it was then known) in Chicago, sometime around 2003-4, one of my first conferences. You had some local friends meeting you there and we all hung out at the hotel bar. It was fun. But I remember the <em>intimidation</em> of meeting this hard core rock looking dude that I didn’t think I could possibly fit in with and relate to.</p>
<p>I was expecting to find a rough biker type dude, that would beat me up if I said the wrong thing… And I remember you were very intense (which I now know was passion) and I remember the change that came over your entire demeanor when you started talking about your son… The warmth and joy that I saw made me think “holy crap, this guy is just an awesome dad. I like this guy!”. Someone else has described this phenomenon as you turning into a pile of goo. As a fairly new father myself I now understand that so much better — thanks for being one of my first peer role models for being a father.</p>
<p>I don’t suffer from the kinds of mental illness you (we?) are trying to help, I have some very irrational (but “normal”) fears – needles and bugs, especially wasps and spiders – and travel stresses me out (<a href="http://tripit.com">TripIt Pro</a> is so fantastic for helping me with that, ask me if you want details <img src='http://daveyshafik.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>I do however have experience with depression, and related things. I lost my father at age 11, and I lost my (first) wife at 22. These were traumatic, depressive, insane things to go through.</p>
<p>But I did get through them, and I feel stronger and happier at this end of that path. Thanks to folks like Ligaya Turmelle, Joey Smith, Matthew Turland and all three Elizabeths (Smith, Naramore and Tucker-Long), who have all at one time or another been a shoulder for me, I am now in a place where I can be laid back about most issues that many people simply can’t (the things that stress you out and cause anxiety on a daily basis). I live by “It is what it is”. But most folks can’t do that.</p>
<p>It is very difficult for me to relate to what people suffering from mental illness have been through in a lot of ways. The kinds of things I suffered from are considered “normal”, a part of the grieving process, and a temporary state; I personally don’t see it as the same thing as clinical depression — though they can lead to it — but “in the moment” they possibly are very similar.</p>
<p>I do however live with mental illness every day. My wife is bipolar (diagnosed and treated for about 6 years) and suffers from depression and anxieties. I see how it affects her, even with medication, and I really appreciate some more insight into a lot of things that she (like most people) has trouble verbalizing, so that I can help her handle it.</p>
<p>I don’t think I can help people suffering directly, I have no direct experience to draw from, other than my experiences with grief over a lost loved one… but I’m very open to any question about what I went through, and how I dealt with it from anyone <em>(consider that an open invitation to anyone reading this.)</em> But I wanted to let you know you have my support, admiration, and maybe even a little bit of love (OK a lot: internet hugs!) for opening yourself up to help this community we both hold so near and dear.</p>
<p>So, thank you!</p>
<ul>
<li>Davey</li>
</ul>
]]></description></item><item><title>Survived php tek 2013 - Michelangelo van Dam</title><link>http://feedproxy.google.com/~r/dragonbe-php/~3/3oE_G4Pmuho/survived-php-tek-2013.html</link><pubDate>Mon, 20 May 2013 12:14:00 +0000</pubDate><description><![CDATA[<a href="https://twitter.com/CaseySoftware/status/335192997983555584/photo/1" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="112" src="http://1.bp.blogspot.com/-DZ6tgyZSHRw/UZoBfcvrm0I/AAAAAAAADxk/Sv6pwwXRMQw/s200/BKbYQXhCEAArUQm.jpg-large.jpeg" width="200"/></a>If you were last week in Chicago, you've might felt the city was buzzing <a href="http://php.net/">PHP</a> all over the place. <a href="http://tek.phparch.com/">php[tek] 2013</a> was taking place at the <a href="http://www.sheratonchicagoohare.com/">Sheraton Gateway Suites Chicago O'Hare</a> in Rosemont, just outside of Chicago city.<br/><br/>This year it was also the first time <a href="http://musketeers.me/">Musketeers.me</a>, a php consulting team from the East Coast, was running the show, putting their own signature onto the event. And with great success I might add. A well deserved applause to <a href="https://twitter.com/kevinbruce">Eli White</a>, <a href="https://twitter.com/kevinbruce">Kevin Bruce</a>, <a href="https://twitter.com/sandys1">Sandy Smith</a>, <a href="https://twitter.com/omerida">Oscar Merida</a> and of course the <a href="https://twitter.com/e3betht">Beth Tucker Long</a> for their unlocked achievement running a great conference.<br/><br/>For me was also the first time I was running the uncon, where attendees and conference speakers could propose talks they wanted to present at the uncon and have other attendees vote for them.<br/><br/>One uncon talk really stood out: "<a href="https://speakerdeck.com/funkatron/open-sourcing-mental-illness">Open Sourcing mental illness</a>" by Ed Finkler (<a href="https://twitter.com/funkatron">@funkatron</a>) where he discussed the issues people face who suffer a mental illness. It was an emotional talk where Ed described his own experiences and how his mind made him think about things differently then the rest of us. For me it was a real eye-opener and made me understand that there are people that don't really take things for granted.<br/><br/>This year's edition was filed with very good talks and it's almost impossible to give my feedback on all of them. A few talks that I attended really stood out that I would really want to promote here.<br/><br/><a href="https://twitter.com/enygma">Chris Cornut</a>, the driving force behind <a href="http://phpdeveloper.org/">phpdeveloper.org</a>, talked about "<a href="https://speakerdeck.com/ccornutt/beyond-the-basics-security-with-php-1">Beyond the Basics: Security with PHP</a>" where he did not just list the top 10 of <a href="https://www.owasp.org/index.php/Main_Page">OWASP</a>, but also gave good advices on how to protect yourself against most of the common attacks. A good closing hint: be better secured than the next guy.<br/><br/><a href="https://twitter.com/jeremykendall">Jeremy Kendall</a> was giving good advice on how to improve your code you wrote a couple of weeks or months ago in his talk "<a href="http://www.slideshare.net/jeremykendall/php-102-out-with-the-bad-in-with-the-good-21331876">PHP 102: Out with the Bad, In with the Good</a>". What I like about Jeremy is he can bring very complex subjects in an easy, understandable way that even a novice can understand complex software engineering stuff. And so he did with this talk.<br/><br/>One talk I missed which I really wanted to see was the <a href="http://www.slideshare.net/VampyreBytes/php-ooh-shiny">Distractions</a> talk of <a href="https://twitter.com/sprunka">Sean Prunka</a>, or how to deal with distractions when you're a developer. When I look at the<a href="https://joind.in/8152"> reviews on joind.in</a> I see he did an amazing good job giving this was his first conference talk ever. So hopefully he will do a webinar or an online recording of this talk *hint, hint*.<br/><br/>This year <a href="http://in2it.be/">my company</a> was sponsoring the hackathon and can be called a good success, knowing we had to compete against Lego fun party. According to <a href="https://twitter.com/lornajane">Lorna</a> a bunch of pull requests were made for joind.in (the community feedback platform for conference speakers). And we captured the first pull request on twitter.<br/><br/><blockquote class="twitter-tweet">Can I get a woot? First @<a href="https://twitter.com/joindin">joindin</a> pull request of the night has been merged at <a href="https://twitter.com/search/%23tek13">#tek13</a> hackathon!<br/>— Lorna Mitchell (@lornajane) <a href="https://twitter.com/lornajane/status/335177872660656128">May 16, 2013</a></blockquote>&lt;script async="" charset="utf-8" src="//platform.twitter.com/widgets.js"/><br/>At the introduction of the hackathon we also had a nice surprise for <a href="https://twitter.com/caseysoftware">Mr. Keith Casey</a> from his colleagues at <a href="http://twillio.com/">Twillio</a> where he worked 2 years now.<br/><br/><iframe allowfullscreen="" frameborder="0" height="315" src="https://www.&lt;/body>"/><p><i>Truncated by Planet PHP, read more at <a href="http://feedproxy.google.com/~r/dragonbe-php/~3/3oE_G4Pmuho/survived-php-tek-2013.html">the original</a> (another 2560 bytes)</i></p>]]></description></item><item><title>5 Reasons Why the Web Platform War is Over: PHP Won with 75% says Google - PHP Classes</title><link>http://www.phpclasses.org/blog/post/208-5-Reasons-Why-the-Web-Platform-War-is-Over-PHP-Won-with-75-says-Google.html</link><pubDate>Mon, 20 May 2013 10:43:11 +0000</pubDate><description><![CDATA[<div style="clear: both">
<div style="margin-top: 1ex"><a href="http://www.phpclasses.org/blog/post/208-5-Reasons-Why-the-Web-Platform-War-is-Over-PHP-Won-with-75-says-Google.html">5 Reasons Why the Web Platform War is Over: PHP Won with 75% says Google</a></div>
<div style="margin-top: 1ex">By Manuel Lemos</a></div>
<div style="margin-top: 1ex">During Google I/O 2013 event a Google manager said PHP runs on 75% of the Web sites. So they decided to finally support PHP as in their AppEngine hosting service.<br />
<br />
Read this article to understand why this puts an end to years of false claims that PHP was losing market, as well what it means to Web developers using PHP or other languages.</a></div>
</div>
]]></description></item><item><title>Offline Processing in PHP with Advanced Queuing  - Christopher Jones</title><link>http://feedproxy.google.com/~r/feedburner/ChristopherJonesOnPHP/~3/5z0Kq_laNpI/offline_processing_in_php_with</link><pubDate>Thu, 16 May 2013 20:14:32 +0000</pubDate><description><![CDATA[<p>Offloading slow batch tasks to an external process is a common
method of improving website responsiveness.  One great way to initiate
such background tasks in PHP is to use Oracle Streams Advanced Queuing
in a producer-consumer message passing fashion. Oracle AQ is highly
configurable. Messages can queued by multiple producers. Different
consumers can filter messages.  From PHP, the PL/SQL interface to AQ
is used.  There are also Java, C and HTTPS interfaces, allowing wide
architectural freedom.</p>

<p>The following example simulates an application user registration
system where the PHP application queues each new user's street
address. An external system monitoring the queue can then fetch and
process that address. In real life the external system might initiate
a snail-mail welcome letter, or do further, slower automated
validation on the address.</p>

<p>The following SQL*Plus script <tt>qcreate.sql</tt> creates a new
Oracle user <tt>demoqueue</tt> with permission to create and use
queues. A payload type for the address is created and a queue is set
up for this payload.  </p>

<pre>
-- qcreate.sql

connect / as sysdba
drop user demoqueue cascade;

create user demoqueue identified by welcome;
grant connect, resource to demoqueue;
grant aq_administrator_role, aq_user_role to demoqueue;
grant execute on dbms_aq to demoqueue;
grant create type to demoqueue;

connect demoqueue/welcome@localhost/orcl

-- The data we want to queue
create or replace type user_address_type as object (
  name        varchar2(10),
  address     varchar2(50)
);
/

-- Create and start the queue
begin
 dbms_aqadm.create_queue_table(
   queue_table        =>  'demoqueue.addr_queue_tab',
   queue_payload_type =>  'demoqueue.user_address_type');
end;
/

begin
 dbms_aqadm.create_queue(
   queue_name         =>  'demoqueue.addr_queue',
   queue_table        =>  'demoqueue.addr_queue_tab');
end;
/

begin
 dbms_aqadm.start_queue(
   queue_name         => 'demoqueue.addr_queue',
   enqueue            => true);
end;
/
</pre>

<p>The script <tt>qhelper.sql</tt> creates two useful helper functions
to enqueue and dequeue messages:</p>

<pre>
-- qhelper.sql
-- Helpful address enqueue/dequeue procedures

connect demoqueue/welcome@localhost/orcl

-- Put an address in the queue
create or replace procedure my_enq(name_p in varchar2, address_p in varchar2) as
  user_address       user_address_type;
  enqueue_options    dbms_aq.enqueue_options_t;
  message_properties dbms_aq.message_properties_t;
  enq_id             raw(16);
begin
  user_address := user_address_type(name_p, address_p);
  dbms_aq.enqueue(queue_name         => 'demoqueue.addr_queue',
                  enqueue_options    => enqueue_options,
                  message_properties => message_properties,
                  payload            => user_address,
                  msgid              => enq_id);
  commit;
end;
/
show errors

-- Get an address from the queue
create or replace procedure my_deq(name_p out varchar2, address_p out varchar2) as
  dequeue_options    dbms_aq.dequeue_options_t;
  message_properties dbms_aq.message_properties_t;
  user_address       user_address_type;
  enq_id             raw(16);
begin
  dbms_aq.dequeue(queue_name         => 'demoqueue.addr_queue',
                  dequeue_options    => dequeue_options,
                  message_properties => message_properties,
                  payload            => user_address,
                  msgid              => enq_id);
  name_p    := user_address.name;
  address_p := user_address.address;
  commit;
end;
/
show errors
</pre>

<p>The script <tt>newuser.php</tt> is the part of the PHP application
that handles site registration for a new user. It queues a message
containing their address and continues executing:</p>

<pre>
&lt;?php
// newuser.php

$c = oci_connect("demoqueue", "welcome", "localhost/orcl");

// The new user details
$username = 'Fred';
$address  = '500 Oracle Parkway';

// Enqueue the address for later offline handling
$s = oci_parse($c, "begin my_enq(:username, :address); end;");
oci_bind_by_name($s, ":username", $username, 10);
oci_bind_by_name($s, ":address",  $address,  50);
$r = oci_execute($s);

// Continue executing
echo "Welcome $username\n";

?>
</pre>

<p>It executes an anonymous PL/SQL block to create and enqueue the
address message. The immediate script output is simply the echoed
welcome message: </p>

<pre>
Welcome Fred
</pre>

<p>Once this PHP script is executed, any application can dequeue the
new message at its leisure.  For example, the following SQL*Plus
commands call the helper <tt>my_deq()</tt> dequeue function and
displays the user details: </p>

<pre>
-- getuser.sql

connect demoqueue/welcome@localhost/orcl

set serveroutput on
declare
  name varchar2(10);
  address varchar2(50);
begin
  my_deq(name, address);
  dbms_output.put_line('Name     : ' || name);
  dbms_output.put_line('Address  : ' || address);
end;
/
</pre>

<p>The</p><p><i>Truncated by Planet PHP, read more at <a href="http://feedproxy.google.com/~r/feedburner/ChristopherJonesOnPHP/~3/5z0Kq_laNpI/offline_processing_in_php_with">the original</a> (another 1511 bytes)</i></p>]]></description></item><item><title>Slides: Behat &amp; Beautiful APIs - Qafoo - PHP</title><link>http://qafoo.com/blog/044_slides_bdd_behat_beautiful_apis.html</link><pubDate>Thu, 16 May 2013 06:14:14 +0000</pubDate><description><![CDATA[Last Wednesday I did a little talk marathon by first presenting a Webinar on Behavior Driven Development with Behat and afterwards going straight to Cologne for the Symfony Usergroup, where I spoke about Designing Beautiful APIs. Find the slides of my talks here.
]]></description></item><item><title>Publishing Security Disclosures In Consumable Formats For Simpler Aggregation and Security Checking - P&#xE1;draic Brady</title><link>http://blog.astrumfutura.com/2013/05/publishing-security-disclosures-in-consumable-formats-for-simpler-aggregation-and-security-checking/</link><pubDate>Wed, 15 May 2013 14:43:34 +0000</pubDate><description><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.astrumfutura.com%2F2013%2F05%2Fpublishing-security-disclosures-in-consumable-formats-for-simpler-aggregation-and-security-checking%2F"><br/><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.astrumfutura.com%2F2013%2F05%2Fpublishing-security-disclosures-in-consumable-formats-for-simpler-aggregation-and-security-checking%2F&source=padraicb&style=normal&service=bit.ly&service_api=padraic%3AR_94101570b7e190f3de921bc15bb9438d&hashtags=php&b=2" height="61" width="50"/><br/></a>
		</div>
<div class="mceTemp">
<dl class="wp-caption alignright zemanta-img" style="width: 210px;"><dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/File:Cooperation.svg" target="_blank"><img class="zemanta-img-inserted zemanta-img-configured" title="English: Decentralised cooperation, many-to-ma..." src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b8/Cooperation.svg/300px-Cooperation.svg.png" alt="English: Decentralised cooperation, many-to-ma..." width="200"/></a></dt>
</dl></div>
<p>This is a branch off from a separate discussion on the PHP-FIG <a href="https://groups.google.com/forum/?fromgroups=#!forum/php-fig" target="_blank">mailing list</a> about other ways the Framework Interoperability Group can encourage and foster wider interoperability among its member projects (and by extension, the whole PHP community). I’ll start by noting two interesting developments in recent months and one long standing best practice.</p>
<h2>1. Launch of the SensioLabs Security Advisory Checker</h2>
<p>The <a href="https://security.sensiolabs.org/" target="_blank">SensioLabs Security Advisor Checker</a> is described on its website as follows.</p>
<blockquote><p>You manage your PHP project dependencies with Composer, right? But are  you sure that your project does not depend on a package with known  security issues? The SensioLabs security advisories checker is a simple  tool, available as a web service or as an online application, that uses  the information from your composer.lock file to check for known security  vulnerabilities. This checker is a frontend for the security advisories  database.</p></blockquote>
<p>The service operates by having people submit vulnerability data, as YAML files, to a centralised Github repository through pull requests. The upside is that the vulnerability data can be peer reviewed and centrally dispersed either online or via a service API. The downside is that you need to find vulnerability disclosures and people to submit them. The service currently covers Symfony, Zend Framework, Doctrine, Twig and FriendsOfSymfony bundles. It’s a tiny sample of packages available through Composer. I’m also not entirely sure if it’s sufficiently fine grained to report vulnerabilities on a project’s sub-packages where you have no direct dependency on the aggregate package (e.g. using zendframework/zend-db instead of zendframework/zendframework). That said, this is a working model of a service for checking your dependencies.</p>
<p>That said, the service exhibits an ambitious idea – projects sharing their vulnerability disclosures or advisories in a way that allows for automatically checking if any of your projects need to have their dependencies updated for security reasons.</p>
<h2>2. <a class="zem_slink" title="OWASP" rel="wikipedia" href="http://en.wikipedia.org/wiki/OWASP" target="_blank">OWASP</a>‘s Top 10 security risks for 2013 includes “A9 – Using Components with Known Vulnerabilities”</h2>
<p><a href="https://www.owasp.org/index.php/Top_10_2013-A9" target="_blank">This is a new entry</a> onto OWASP’s Top 10 (which is currently at release candidate status for 2013). In summary, it recognises that applications are becoming ever more dependent on code not developed internally. We’ve had web application frameworks for years. Composer and Github have unleashed a storm of accessible libraries, bundles, modules, and other units of reuse that have revealed Not Invented Here (<a class="zem_slink" title="Not invented here" rel="wikipedia" href="http://en.wikipedia.org/wiki/Not_invented_here" target="_blank">NIH Syndrome</a>) as a psychological problem in ways not previously possible.</p>
<p>As reliance on externally controlled dependencies increases, so too does the risk of your applications using insecure dependencies. This is a risk that requires a lot of work to mitigate. For each dependency, you need to do a security review (no, I’m not kidding), check for security disclosures (whether voluntary or involuntary) and ensure that you end up rolling out to production with safe versions.</p>
<p>Quoting from the OWASP advice on preventing the use of components with known vulnerabilities…</p>
<blockquote><p>One option is not to use compone</p></blockquote><p><i>Truncated by Planet PHP, read more at <a href="http://blog.astrumfutura.com/2013/05/publishing-security-disclosures-in-consumable-formats-for-simpler-aggregation-and-security-checking/">the original</a> (another 4681 bytes)</i></p>]]></description></item><item><title>How we organize our websites - Paul Reinheimer</title><link>http://blog.preinheimer.com/index.php?/archives/414-How-we-organize-our-websites.html</link><pubDate>Wed, 15 May 2013 13:19:57 +0000</pubDate><description><![CDATA[
    <p>We recently migrated <a href="http://wheresitup.com/">Where’s it Up</a> to our fancy <a href="http://blog.preinheimer.com/index.php?/archives/413-Buying-a-Zoo-server.html">new hardware</a>, it took a bit more effort than planned (some pains surrounding our use of MongoDB) but I’m incredibly happy with how things have ended up. As mentioned earlier we’ve purchased our own hardware, and have racked it with <a href="http://www.peer1.com/">Peer 1</a> here in Toronto. We’ve installed a hypervisor, and are running different VMs for critical services: MySQL, Mongo, Web Production, Web Development, etc. </p>

<p>Our websites sit under <span class="code-inline">/var/www</span>, so Where’s it Up resides at <span class="code-inline">/var/www/wheresitup.com/</span>. Under that directory we have <span class="code-inline">/noweb/apache/</span> which contains both <span class="code-inline">wheresitup.com</span> and <span class="code-inline">dev.wheresitup.com</span>, configuration files for apache. The entire <span class="code-inline">/var/www/wheresitup.com</span> directory tree resides nicely in our version control system. We hand off key configuration options to our websites through the use of Apache’s SetEnv, things like <span class="code-inline">SetEnv mysql_host dev.mysql</span>, these apache configuration options represent the only difference between the two code bases. </p>
     
<p style="margin-left: 10px; color: #7C8699;">I’ve written or maintained code that implied the state (Dev/Production/Stage) based on the Host, directory, or other factors in the past. I much prefer grabbing an explicit constant. It feels cleaner, I don’t have to read up on which variables could have been manipulated by an attacker, and I can ask the exact question I want answered: Is this dev, rather than “is the url the one that means this is dev”. </p>

<p>This allows us to match our Development and Production virtual machines very closely, the only difference between the two is which apache configuration file is sym-linked under <span class="code-inline">/etc/apache2/conf/sites-enabled</span>. Clearly WebDev links to the <span class="code-inline">dev.wheresitup.com</span> file, and WebProd links to <span class="code-inline">wheresitup.com</span>. We actually cloned one machine to produce the other. </p>

<p>Keeping the configuration files so close also makes a lot of sense to me. If I’m adding a new constant on Dev, the immediate presence of Prod reminds me that I’ll need to add it there as well. Storing the entire site: PHP code, supporting apache configuration, etc, all in once place makes it easy to avoid forgetting anything (which is easy when it's a different file on a different server). The only exception is SSL certificates. We currently host a number of our projects with GitHub, and trust them as we might, we’re not willing to hand those to anyone else. </p>
  
    ]]></description></item><item><title>Dealing with duplicated code - Brandon Savage</title><link>http://www.brandonsavage.net/dealing-with-duplicated-code/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=dealing-with-duplicated-code</link><pubDate>Wed, 15 May 2013 11:00:31 +0000</pubDate><description><![CDATA[We’ve all seen it: we’re working along, and we come across code that just has a feel to it. It’s like déjà vu. You’ve seen this code before. You open another file – sure enough, there it is. The same code. Almost line for line. In large code bases, it’s likely that there are dozens [...]]]></description></item></channel></rss>
