<?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>Davey Shafik</title>
	<atom:link href="http://daveyshafik.com/feed" rel="self" type="application/rss+xml" />
	<link>http://daveyshafik.com</link>
	<description>As close to my brain as you can safely get...</description>
	<lastBuildDate>Thu, 23 May 2013 08:46:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Speaking at Lonestar PHP (June 28-29, Dallas)</title>
		<link>http://daveyshafik.com/archives/66183-speaking-at-lonestar-php-june-28-29-dallas.html</link>
		<comments>http://daveyshafik.com/archives/66183-speaking-at-lonestar-php-june-28-29-dallas.html#comments</comments>
		<pubDate>Thu, 23 May 2013 03:02:48 +0000</pubDate>
		<dc:creator>Davey Shafik</dc:creator>
				<category><![CDATA[tagged]]></category>
		<category><![CDATA[#lsp13]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[lonestar]]></category>
		<category><![CDATA[lonestarphp]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[speaking]]></category>

		<guid isPermaLink="false">http://daveyshafik.com/?p=66183</guid>
		<description><![CDATA[I will be presenting at Lonestar PHP next month, taking part in their inaugural Foundations track with &#8220;Introduction to Databases&#8221;. Lonestar PHP is a 2-day conference in Dallas (well, Addison) Texas, on June 28th and 29th. After presenting &#8220;MySQL High Availability, Disaster Recovery and Load Balancing&#8221; with Ligaya Turmelle at php[tek] last month, I&#8217;m definitely looking forward to speaking on MySQL (and other databases) again! Lonestar PHP was my favorite conference of 2012, and I know the crew there will do a great job this year too, so if you haven&#8217;t bought your tickets yet, you should definitely do so.]]></description>
				<content:encoded><![CDATA[<p>I will be presenting at <a href="http://lonestarphp.com">Lonestar PHP</a> next month, taking part in their inaugural Foundations track with &#8220;Introduction to Databases&#8221;.</p>
<p>Lonestar PHP is a 2-day conference in Dallas (well, Addison) Texas, on June 28th and 29th.</p>
<p>After presenting &#8220;MySQL High Availability, Disaster Recovery and Load Balancing&#8221; with Ligaya Turmelle at <a href="http://tek.phparch.com">php[tek]</a> last month, I&#8217;m definitely looking forward to speaking on MySQL (and other databases) again!</p>
<p>Lonestar PHP was my favorite conference of 2012, and I know the crew there will do a great job this year too, so if you haven&#8217;t bought your tickets yet, <a href="https://lonestarphp.ticketbud.com/2013">you should definitely do so</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://daveyshafik.com/archives/66183-speaking-at-lonestar-php-june-28-29-dallas.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dear Ed (A response to Open Sourcing Mental Illness at php[tek] 2013)</title>
		<link>http://daveyshafik.com/archives/65721-dear-ed-a-response-to-open-sourcing-mental-illness-at-phptek-2013.html</link>
		<comments>http://daveyshafik.com/archives/65721-dear-ed-a-response-to-open-sourcing-mental-illness-at-phptek-2013.html#comments</comments>
		<pubDate>Mon, 20 May 2013 16:00:31 +0000</pubDate>
		<dc:creator>Davey Shafik</dc:creator>
				<category><![CDATA[tagged]]></category>
		<category><![CDATA[#mentalillness]]></category>
		<category><![CDATA[#opensource]]></category>
		<category><![CDATA[#tek13]]></category>
		<category><![CDATA[mental illness]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php[tek]]]></category>

		<guid isPermaLink="false">http://daveyshafik.com/?p=65721</guid>
		<description><![CDATA[Note: this post is personal, and may contain triggers for those suffering through grief. Due to it&#8217;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&#8217;s difficult to talk about without drawing broad brush strokes that may offend some people. Please keep in mind that this is [some of] my thoughts on this very complicated subject, and you are free to disagree. Dear Ed, I felt that I needed to write this letter to you, and I wanted [...]]]></description>
				<content:encoded><![CDATA[<blockquote><p>
  <strong>Note:</strong> this post is personal, and may contain triggers for those suffering through grief. Due to it&#8217;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&#8217;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&#8217;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&#8217;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&#8217;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&#8230; 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&#8230; The warmth and joy that I saw made me think &#8220;holy crap, this guy is just an awesome dad. I like this guy!&#8221;. 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&#8217;t suffer from the kinds of mental illness you (we?) are trying to help, I have some very irrational (but &#8220;normal&#8221;) fears &#8211; needles and bugs, especially wasps and spiders &#8211; 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&#8217;t (the things that stress you out and cause anxiety on a daily basis). I live by &#8220;It is what it is&#8221;. But most folks can&#8217;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 &#8220;normal&#8221;, a part of the grieving process, and a temporary state; I personally don&#8217;t see it as the same thing as clinical depression — though they can lead to it — but &#8220;in the moment&#8221; 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&#8217;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&#8217;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>
]]></content:encoded>
			<wfw:commentRss>http://daveyshafik.com/archives/65721-dear-ed-a-response-to-open-sourcing-mental-illness-at-phptek-2013.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learning Rails (and Ruby)</title>
		<link>http://daveyshafik.com/archives/62912-learning-rails-and-ruby.html</link>
		<comments>http://daveyshafik.com/archives/62912-learning-rails-and-ruby.html#comments</comments>
		<pubDate>Thu, 11 Apr 2013 23:49:48 +0000</pubDate>
		<dc:creator>Davey Shafik</dc:creator>
				<category><![CDATA[tagged]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[get of your island]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://daveyshafik.com/?p=62912</guid>
		<description><![CDATA[A few days ago I had a new blog post published on the Engine Yard Blog. The post was actually written, before my last blog post here, and is really more on the same subject; get out there and cross-pollinate. Learn, and share with other tech communities. You can read the post here: Learning Rails (and Ruby) on the Engine Yard Blog. I&#8217;ve had a lot of positive feedback (on reddit), and surprisingly the only negative feedback I got was via the PHP sub-reddit. I think some people choose to defend their choices simply because they don&#8217;t want to have [...]]]></description>
				<content:encoded><![CDATA[<p>A few days ago I had a new blog post published on the <a href="http://blog.engineyard.com">Engine Yard Blog</a>. The post was actually written, before <a href="http://daveyshafik.com/archives/60114-distill-an-opportunity-to-get-out-of-your-comfort-zone.html">my last blog post</a> here, and is really more on the same subject; get out there and cross-pollinate. Learn, and share with other tech communities.</p>
<p>You can read the post here: <a href="https://blog.engineyard.com/2013/learning-rails-and-ruby?source=ds">Learning Rails (and Ruby) on the Engine Yard Blog</a>.</p>
<p>I&#8217;ve had a lot of positive feedback (on reddit), and surprisingly the only <strong>negative</strong> feedback I got was via the PHP sub-reddit. I think some people choose to defend their choices simply because they don&#8217;t want to have made the wrong ones. But really, there&#8217;s no right and wrong answer, and it mostly comes down to preference and little else.</p>
<p>That&#8217;s enough meta-commentary from me, <a href="https://blog.engineyard.com/2013/learning-rails-and-ruby?source=ds">read it already!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://daveyshafik.com/archives/62912-learning-rails-and-ruby.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Distill: An opportunity to get out of your comfort zone</title>
		<link>http://daveyshafik.com/archives/60114-distill-an-opportunity-to-get-out-of-your-comfort-zone.html</link>
		<comments>http://daveyshafik.com/archives/60114-distill-an-opportunity-to-get-out-of-your-comfort-zone.html#comments</comments>
		<pubDate>Thu, 21 Mar 2013 21:43:26 +0000</pubDate>
		<dc:creator>Davey Shafik</dc:creator>
				<category><![CDATA[tagged]]></category>
		<category><![CDATA[cfp]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[distill]]></category>
		<category><![CDATA[engine yard]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://daveyshafik.com/?p=60114</guid>
		<description><![CDATA[As part of my work at Engine Yard I have been involved in helping shape and organize a new conference, Distill, which will be held on Treasure Island in San Francisco, CA on August 8-9th 2013. The conference will bring together a bunch of folks from different technological backgrounds to share information, and cross-pollinate ideas. Just like Ruby on Rails kickstarted the PHP frameworks explosion, we (the PHP community) have an opportunity to give back not only to the Ruby/Rails community but to Javascript, Python, Java, and database communities, and who knows what else will make a showing. Hopefully, we [...]]]></description>
				<content:encoded><![CDATA[<p>As part of my work at <a href="http://engineyard.com">Engine Yard</a> I have been involved in helping shape and organize a new conference, <a href="http://distill.engineyard.com">Distill</a>, which will be held on Treasure Island in San Francisco, CA on August 8-9th 2013.</p>
<p>The conference will bring together a bunch of folks from different technological backgrounds to share information, and cross-pollinate ideas. Just like Ruby on Rails kickstarted the PHP frameworks explosion, we (the PHP community) have an opportunity to give back not only to the Ruby/Rails community but to Javascript, Python, Java, and database communities, and who knows what else will make a showing.</p>
<p>Hopefully, we can all <a href="http://www.garfieldtech.com/blog/off-the-island-2013">&#8220;get off the island&#8221;</a> and allow us to create something awesome.</p>
<p>The <a href="http://distill.engineyard.com/cfp">Call For Proposals</a> is currently open, and closes on April 9th, and I highly encourage everyone to submit.</p>
]]></content:encoded>
			<wfw:commentRss>http://daveyshafik.com/archives/60114-distill-an-opportunity-to-get-out-of-your-comfort-zone.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speaking at php[tek] (Chicago, IL May 14th-17th)</title>
		<link>http://daveyshafik.com/archives/57092-speaking-at-phptek-chicago-il-may-14th-17th.html</link>
		<comments>http://daveyshafik.com/archives/57092-speaking-at-phptek-chicago-il-may-14th-17th.html#comments</comments>
		<pubDate>Thu, 14 Feb 2013 05:01:04 +0000</pubDate>
		<dc:creator>Davey Shafik</dc:creator>
				<category><![CDATA[tagged]]></category>

		<guid isPermaLink="false">http://daveyshafik.com/?p=57092</guid>
		<description><![CDATA[I am very excited that I have been chosen to speak at php[tek] 2013 this May. I will be presenting two talks, the first is PHP 5.5: The New Bits that I updated from 5.4 for Sunshine PHP, and which was well received. The second is something new for me, first I will be co-presenting, with the amazing Ligaya Turmelle, something that is altogether new to me, and additionally, it will be a talk on MySQL. Specifically, MySQL HA, Recovery and Load Balancing, which will cover a number of replication strategies, including covering the new Percona XtraDB Cluster, and discuss [...]]]></description>
				<content:encoded><![CDATA[<p>I am very excited that I have been chosen to speak at php[tek] 2013 this May. I will be presenting two talks, the first is <em>PHP 5.5: The New Bits</em> that I updated from 5.4 for <a href="http://sunshinephp.com">Sunshine PHP</a>, and which was well received.</p>
<p>The second is something new for me, first I will be co-presenting, with the amazing <a href="http://www.khankennels.com/blog/">Ligaya Turmelle</a>, something that is altogether new to me, and additionally, it will be a talk on MySQL. Specifically, <em>MySQL <abbr title="High Availability">HA</abbr>, Recovery and Load Balancing</em>, which will cover a number of replication strategies, including covering the new <a href="http://www.percona.com/software/percona-xtradb-cluster">Percona XtraDB Cluster</a>, and discuss what they mean for you as a DBA (or devops, sysadmin) and as a developer (for your application).</p>
<p>The <a href="http://tek13.phparch.com/pricing-and-registration/">early bird ticket price</a> is available till February 28th, so don&#8217;t delay, and hopefully I&#8217;ll see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://daveyshafik.com/archives/57092-speaking-at-phptek-chicago-il-may-14th-17th.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speaking at SunshinePHP (Miami, FL Feb 8th-9th)</title>
		<link>http://daveyshafik.com/archives/56064-speaking-at-sunshinephp-miami-fl-feb-8th-9th.html</link>
		<comments>http://daveyshafik.com/archives/56064-speaking-at-sunshinephp-miami-fl-feb-8th-9th.html#comments</comments>
		<pubDate>Thu, 31 Jan 2013 15:12:29 +0000</pubDate>
		<dc:creator>Davey Shafik</dc:creator>
				<category><![CDATA[tagged]]></category>

		<guid isPermaLink="false">http://daveyshafik.com/?p=56064</guid>
		<description><![CDATA[Just a quick note that I will be speaking on PHP 5.4/5.5 at SunshinePHP in Miami, FL next month (week). The talk will be an updated-for-PHP-5.5 version of my popular PHP 5.4: The New Bits talk. Given the much smaller amount of changes in 5.5, I will probably continue to cover some of the 5.4 changes also. If you&#8217;re in the area, give me a shout and be sure to say Hi!]]></description>
				<content:encoded><![CDATA[<p>Just a quick note that I will be speaking on PHP 5.4/5.5 at <a href="http://sunshinephp.com">SunshinePHP</a> in Miami, FL next month (week).</p>
<p>The talk will be an updated-for-PHP-5.5 version of my popular PHP 5.4: The New Bits talk. Given the much smaller amount of changes in 5.5, I will probably continue to cover some of the 5.4 changes also.</p>
<p>If you&#8217;re in the area, give me a shout and be sure to say Hi!</p>
]]></content:encoded>
			<wfw:commentRss>http://daveyshafik.com/archives/56064-speaking-at-sunshinephp-miami-fl-feb-8th-9th.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speaking at Codeworks (Atlanta GA, Boca Raton FL, Dallas TX)</title>
		<link>http://daveyshafik.com/archives/49726-speaking-at-codeworks-atlanta-ga-boca-raton-fl-dallas-tx.html</link>
		<comments>http://daveyshafik.com/archives/49726-speaking-at-codeworks-atlanta-ga-boca-raton-fl-dallas-tx.html#comments</comments>
		<pubDate>Sun, 30 Sep 2012 03:55:53 +0000</pubDate>
		<dc:creator>Davey Shafik</dc:creator>
				<category><![CDATA[tagged]]></category>

		<guid isPermaLink="false">http://daveyshafik.com/?p=49726</guid>
		<description><![CDATA[I will be speaking at Codeworks on APIs on Monday October 1st in Atlanta, GA, and then in Boca Raton, FL on Wednesday October 3rd. Then, on December 6th, in Dallas. Codeworks is the great one-day conference tour from the folks at php&#124;architect, and this year, thanks to Engine Yard it&#8217;s only $40! I&#8217;ll be arriving in Atlanta on Sunday afternoon (4:15pm) if anyone would like to hang out before the conference, and will be around till Monday evening. Also, I&#8217;ll be arriving in Boca Raton on Tuesday afternoon (via Train into Deerfield Beach at 4:15pm&#8230; again), and will be [...]]]></description>
				<content:encoded><![CDATA[<p>I will be speaking at Codeworks on APIs on <a href="http://codeworks.phparch.com/atlanta/">Monday October 1st in Atlanta, GA</a>, and then in <a href="http://codeworks.phparch.com/boca-raton/">Boca Raton, FL on Wednesday October 3rd</a>.</p>
<p>Then, on <a href="http://codeworks.phparch.com/dallas/">December 6th, in Dallas</a>.</p>
<p>Codeworks is the great one-day conference tour from the folks at <a href="http://phparch.com">php|architect</a>, and this year, thanks to <a href="http://engineyard.com">Engine Yard</a> it&#8217;s only <strong>$40</strong>!</p>
<p>I&#8217;ll be arriving in Atlanta on Sunday afternoon (4:15pm) if anyone would like to hang out before the conference, and will be around till Monday evening. Also, I&#8217;ll be arriving in Boca Raton on Tuesday afternoon (via Train into Deerfield Beach at 4:15pm&#8230; again), and will be around Boca and/or West Palm Beach on Thursday if you want to hang out pre/post conference.</p>
<p>I look forward to seeing you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://daveyshafik.com/archives/49726-speaking-at-codeworks-atlanta-ga-boca-raton-fl-dallas-tx.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Voices of the Elephpant Interview</title>
		<link>http://daveyshafik.com/archives/39264-voices-of-the-elephpant-interview.html</link>
		<comments>http://daveyshafik.com/archives/39264-voices-of-the-elephpant-interview.html#comments</comments>
		<pubDate>Thu, 05 Jul 2012 18:34:20 +0000</pubDate>
		<dc:creator>Davey Shafik</dc:creator>
				<category><![CDATA[tagged]]></category>

		<guid isPermaLink="false">http://daveyshafik.com/?p=39264</guid>
		<description><![CDATA[While I was at the excellent Dutch PHP Conference I had the opportunity to be interview by the great Cal Evans for his Voices of the Elephpant podcast. I had a lot of fun doing this, and highly recommend listening to not just my episode, but every episode!]]></description>
				<content:encoded><![CDATA[<p>While I was at the excellent <a href="http://phpconference.nl">Dutch PHP Conference</a> I had the opportunity to be interview by the great <a href="http://blog.calevans.com/">Cal Evans</a> for his <a href="http://voicesoftheelephpant.com/2012/07/03/interview-with-davey-shafik/">Voices of the Elephpant</a> podcast.</p>
<p>I had a lot of fun doing this, and highly recommend listening to not just <a href="http://voicesoftheelephpant.com/2012/07/03/interview-with-davey-shafik/">my episode</a>, but every episode!</p>
]]></content:encoded>
			<wfw:commentRss>http://daveyshafik.com/archives/39264-voices-of-the-elephpant-interview.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mimetypes (and APIs)</title>
		<link>http://daveyshafik.com/archives/35507-mimetypes-and-apis.html</link>
		<comments>http://daveyshafik.com/archives/35507-mimetypes-and-apis.html#comments</comments>
		<pubDate>Wed, 25 Apr 2012 04:18:54 +0000</pubDate>
		<dc:creator>Davey Shafik</dc:creator>
				<category><![CDATA[tagged]]></category>

		<guid isPermaLink="false">http://daveyshafik.com/?p=35507</guid>
		<description><![CDATA[As part of my day-job at Engine Yard, I spend a lot of time working with, and writing APIs. For all of the APIs I write, I use the awesome FRAPI API framework; and have been hacking away adding new features and fixing bugs more and more frequently over the last few months. One such feature, was the addition of mimetype support. Mimetype support allows you to specify mimetypes allowed in the Accept header, and to which format the response would be. The reason behind this was that at one point I was working with Githubs API which uses mimetypes [...]]]></description>
				<content:encoded><![CDATA[<p>As part of my day-job at <a href="http://www.engineyard.com/products/orchestra">Engine Yard</a>, I spend a lot of time working with, and writing APIs.</p>
<p>For all of the APIs I write, I use the awesome <a href="http://github.com/frapi/frapi">FR<em>API</em></a> API framework; and have been hacking away adding new features and fixing bugs more and more frequently over the last few months.</p>
<p>One such feature, was the addition of mimetype support. Mimetype support allows you to specify mimetypes allowed in the <code>Accept</code> header, and to which format the response would be.</p>
<p>The reason behind this was that at one point I was working with <a href="http://developer.github.com/">Githubs API</a> which uses mimetypes extensively for various reasons; and at the time, I thought they were very good reasons.</p>
<p>A full github mimetype looks like: <code>application/vnd.github[.version].&lt;param&gt;[+json]</code></p>
<p>So lets break this down:</p>
<dl>
<dt><code>application/</code></dt>
<dd>The media type (this indicates it is intended for an application to work with the data)</dd>
<dt><code>vnd.github</code></dt>
<dd>As specified in <a href="http://tools.ietf.org/html/rfc2048#section-2.1.2">RFC 2048</a>, vendor specific mimetypes should be prefixed with <code>vnd.</code> followed by the producers name</dd>
<dt><code>[.version]</code></dt>
<dd>Next up, we have [optionally] the API version, currently 3</dd>
<dt><code>.&lt;param&gt;</code></dt>
<dd>This is followed by a value that designates the response data type (<code>full</code>, <code>raw</code>, <code>text</code>, or <code>html</code>)</dd>
<dt><code>[+json]</code></dt>
<dd>We finish with the [optional] serialization, always <code>json</code>.</dd>
</dl>
<p>In theory, this looks great; just parse the mimetype and you have the version number, the response type, and potentially any number of serializations (think: XML, jsonp, serialize PHP even!). Simple, right?</p>
<p>Well&#8230; not quite. Lets look at an example API request (using the awesome <a href="http://httpie.org">httpie</a>):</p>
<p><script src="https://gist.github.com/2485502.js?file=1-http-get-user-repos.js"></script></p>
<p>The important line to note here, is <code>Content-Type: application/json; charset=utf-8</code>.</p>
<p>Now lets try again, this time, with the <code>Accept: application/vnd.github.3+json</code>. What this says is: I want you to serve me content of <strong>this</strong> type.</p>
<p><script src="https://gist.github.com/2485502.js?file=2-http-get-user-repos-vnd.txt"></script></p>
<p>Notice that we get the same <strong>type</strong> of response as before, <code>application/json</code>… but this isn&#8217;t what we requested. While it&#8217;s what we <strong>expect</strong> (because we read the docs and we know the entire API uses json); why isn&#8217;t the response <code>Content-Type: application/vnd.github.3+json</code>?</p>
<p>Most likely, it&#8217;s because most clients that understand json (for example those that unserialize it in to native data structures automatically) look for two types: <code>text/json</code> and <code>application/json</code>, others like <a href="https://github.com/jquery/jquery/blob/master/src/ajax.js#L340">jquery</a> just look for <codejson</code> anywhere in the <code>Content-Type</code> response header.</p>
<p>What&#8217;s <em>wrong</em> with this? Well, for starters, what if you request <code>Accept: text/plain</code> and you get back <code>Content-Type: image/jpeg</code>. That&#8217;s not going to work. Secondly, for caching proxies and such, it is isn&#8217;t possible to differentiate between the <code>application/vnd.github.3.full</code> response, and the <code>application/vnd.github.3.raw</code> or <code>application/vnd.github.4.full</code> response.</p>
<p>It would be entirely reasonable to respond with a <code>HTTP/1.1 406 Not Acceptable</code> header in the case where the server cannot respond with an accepted media type.</p>
<p>All in all, I think this use of mimetypes is less than great. Not terrible; definitely within the confines of the spec. So what <em>is</em> the solution?</p>
<p>The solution is part of the MIME RFCs (there are 5 original RFCs, 2045-2049, and dozens of updates) and explained in this context, in the HTTP 1.1 spec (<a href="http://tools.ietf.org/html/rfc2616">RFC 2616</a>), and that solution is <a href="http://tools.ietf.org/html/rfc2616#section-14.1">accept-params</a> or mimetype parameters. You&#8217;ve seen, and used them, regularly I&#8217;d bet, here&#8217;s an example:</p>
<p><code>Content-Type: text/html<strong>;charset=utf-8</strong></code></p>
<p>These exist <strong>explicitly</strong> to pass variable named values along with the mimetype. The one explicitly defined in the HTTP spec is the <code>q</code> parameter for designating preference for mimetypes in the <code>Accept</code> header.</p>
<p>So lets try the github mimetypes using parameters instead:</p>
<p><code>application/json<strong>;version=3;response=raw</strong></code></p>
<p>And in the response:</p>
<p><code>Content-Type: application/json<strong>;version=3;response=raw</strong></code></p>
<p>Not only do we get back the same mimetype, any decent HTTP client will still see the <code>application/json</code>, and caches will respect the parameters, just like they would the <code>charset</code> parameter. You could even drop parameters to indicate it was ignored; add parameters to give more details (e.g. <code>charset</code>) or change the values to indicate what you actually did.</p>
<p>Better yet, we can now do things like use q-values. So, should Github add XML output to their API, we could indicate we can handle both, but prefer json:</p>
<p><code>Accept: <strong>application/xml;q=0.8</strong>;version=3;response=raw, <strong>application/json;q=1.0</strong>;version=3;response=raw</code></p>
<p>Or that we prefer (the future) version 4, but can still handle version 3:</p>
<p><code>Accept: application/json;<strong>q=1.0;version=4</strong>;response=raw, application/json;<strong>q=0.5;version=3</strong>;response=raw</code></p>
<p>All-in-all, I believe this to be more semantically and technically correct, while also being easier (parameters are named (case-insensitive), optionally quoted, and can be in any order except <code>q</code> which must be first)</p>
]]></content:encoded>
			<wfw:commentRss>http://daveyshafik.com/archives/35507-mimetypes-and-apis.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Speaking at phpDay! (Verona, Italy)</title>
		<link>http://daveyshafik.com/archives/35500-speaking-at-phpday-verona-italy.html</link>
		<comments>http://daveyshafik.com/archives/35500-speaking-at-phpday-verona-italy.html#comments</comments>
		<pubDate>Mon, 02 Apr 2012 17:51:33 +0000</pubDate>
		<dc:creator>Davey Shafik</dc:creator>
				<category><![CDATA[tagged]]></category>

		<guid isPermaLink="false">http://daveyshafik.com/?p=35500</guid>
		<description><![CDATA[Update: I will no longer be attending phpDay due to family circumstances. Sorry all! (I will still be at php&#124;tek, DPC and Lonestar PHP) I am adding another date to my summer conference circuit; this time the two-day phpDay conference in Verona, Italy on May 18th and 19th. This time I will be presenting on PHP Streams; this is will be an in-depth look in to the streams layer and is a talk I last gave back in 2008, so there is lots of new material to cover! I love PHP streams, definitely one of the most underrated part of [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Update: I will no longer be attending phpDay due to family circumstances. Sorry all!</strong> (I will still be at php|tek, DPC and Lonestar PHP)</p>
<p>I am adding another date to my summer conference circuit; this time the two-day <a href="http://phpday.it">phpDay</a> conference in Verona, Italy on May 18th and 19th.</p>
<p>This time I will be presenting on PHP Streams; this is will be an in-depth look in to the streams layer and is a talk I last gave back in 2008, so there is lots of new material to cover!</p>
<p>I love PHP streams, definitely one of the most underrated part of PHP in my experience.</p>
<p>Again, if you are able to make it, do come and say Hello!</p>
<p>Also, I will also be at <a href="http://tek.phparch.com">php|tek</a> in Chicago between May 22nd-25th, however I am not speaking. (Actually, I will be there from the 20-21st to the 26th, if you want to hang out!)</p>
]]></content:encoded>
			<wfw:commentRss>http://daveyshafik.com/archives/35500-speaking-at-phpday-verona-italy.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
