<?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>thinsoldier.com &#187; php</title>
	<atom:link href="http://thinsoldier.com/wordpress/archives/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://thinsoldier.com/wordpress</link>
	<description>what the !@#%! were you expecting?</description>
	<lastBuildDate>Mon, 09 Aug 2010 14:54:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title></title>
		<link>http://thinsoldier.com/wordpress/archives/51</link>
		<comments>http://thinsoldier.com/wordpress/archives/51#comments</comments>
		<pubDate>Fri, 05 Feb 2010 21:11:44 +0000</pubDate>
		<dc:creator>thinsoldier</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[designpatterns]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://thinsoldier.com/wordpress/?p=51</guid>
		<description><![CDATA[This is a comment I had about <a href="http://www.phpdesignpatterns.com/design-patterns/pattern-decorator/">an article on the Decorator pattern </a>

I think some people may overlook the importance/usefulness of the decorator pattern since all you're doing in the examples could be accomplished by just concatenating P and /P around the getData() wherever it is you were going to display it. <a href="http://thinsoldier.com/wordpress/archives/51">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is a comment I had about <a href="http://www.phpdesignpatterns.com/design-patterns/pattern-decorator/">an article on the Decorator pattern </a></p>
<p>I think some people may overlook the importance/usefulness of the decorator pattern since all you&#8217;re doing in the examples could be accomplished by just concatenating P and /P around the getData() wherever it is you were going to display it.</p>
<p>I find the decorator pattern is best for when you have a lot of parts to the data that need a lot of manipulation of their values and a lot of html but not so much html that it warrants a full page/template/view.</p>
<p>For example <span id="more-51"></span> in my (poorly written) real estate site I have an object that represents a property for sale in the listings table of the DB. All 126 fields of the property record!</p>
<p>When it&#8217;s time to show info about the property to a visitor I only need to show them about a dozen fields. But most of those fields need to be manipulated. I need to ucfirst() the property status text, convert the price to Euros/Pounds/USD/BSD, attach the http://www.site.com/listings/&#8230; onto the permalink text of the listing, convert 3.5 into &#8220;3 1/2 Bath&#8221;, convert the square feet values into Acres if they are over 1 acres in size and lots of other stuff. Also all these fields had to be wrapped in html tags and ids and css classes etc.</p>
<p>At first I had all that stuff as part of the code that happens _before_ the data is saved to the database. Then other clients came along who wanted the same system (but different) and I realized a lot of those manipulations were only relevant to the site visitors. So then I put those instructions in the main class file as $listing-&gt;displayOverview() method.</p>
<p>But then some more clients came along who wanted something other than the default set of info in the default format. Some clients wanted the category value to link to a search results page of everything in that category. Some wanted the neighbourhood value to do the same. Some didn&#8217;t want the category or neighbourhood value to be shown. Sure I could have just use css to hide the neighbourhood span but some high end clients don&#8217;t want anyone to know where their house is located so the neighbourhood/address values weren&#8217;t allowed to be anywhere in the markup. They had to be taken out at the code level.</p>
<p>It unfortunately took a looong time and a lot of clients on this system to realize I needed to take this segment of my code and turn it into a custom decorator for each client that needed one.</p>
<p>Before that realization, at one point I had a site identifier variable and a ton of IF statements strewn throughout the code that made it a nightmare to read!</p>
<p>For another good example of decorator usage see this <a href="http://www.zend.com/en/webinar/Framework/webinar-leveraging-zend_form-decorators-20091216.flv">Zend Framework Zend_Form screencast</a> (requires having a zend.com account).</p>
]]></content:encoded>
			<wfw:commentRss>http://thinsoldier.com/wordpress/archives/51/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XDebug option missing from Zend Studio 7&#8230;AGAIN!</title>
		<link>http://thinsoldier.com/wordpress/archives/23</link>
		<comments>http://thinsoldier.com/wordpress/archives/23#comments</comments>
		<pubDate>Mon, 21 Sep 2009 22:32:04 +0000</pubDate>
		<dc:creator>thinsoldier</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://thinsoldier.com/wordpress/?p=23</guid>
		<description><![CDATA[I wanted to try out the Zend Studio 7 beta but AGAIN there was no option for XDebug showing up in the preferences despite the fact that XDebug works fine on my system. I&#8217;m hoping it&#8217;s the same issue I &#8230; <a href="http://thinsoldier.com/wordpress/archives/23">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I wanted to try out the Zend Studio 7 beta but AGAIN there was no option for XDebug showing up in the preferences despite the fact that XDebug works fine on my system.</p>
<p>I&#8217;m hoping it&#8217;s the same issue I had with Zend Studio 6. It seems Zend hates XDebug or something. People say PDT (upon which zend studio is based) works fine with XDebug but for some reason the Zend people chose to hard-code the XDebug option OUT of the Zend studio preferences.</p>
<p>After a lot of searching I finally tracked down remnants of the instructions that got XDebug to work in my old Zend Studio 6. I&#8217;ll repeat them here if they work for 7.</p>
<blockquote><p>distreff &#8211; see dtaylor7&#8242;s post above yours for steps on how to get XDebug enabled again. Having a Mac, I started with the steps I&#8217;d worked out for PDT (http://www.makovec.net/software/39-software/55-eclipse-pdt-with-debug-on-leopard.html), then did the following from Terminal.app:</p>
<p>cd /Applications/Zend/Zend\ Studio\ for\ Eclipse\ -\ 6.0.1/plugins<br />
mkdir disabled<br />
mv com.zend.php.debug.* disabled<br />
/Applications/Zend/Zend\ Studio\ for\ Eclipse\ -\ 6.0.1/ZendStudio.app/Contents/MacOS/ZendStudio -clean</p>
<p>After you&#8217;ve done all that from the command line, your XDebug options will be back. You can then quit out and go back to loading up ZSE from the desktop.</p>
<p>&#8211; http://devzone.zend.com/article/2930<br />
&#8211; http://devzone.zend.com/member/5810-dmakovec</p></blockquote>
<p>The specific commands that worked for me:<br />
<code><br />
:: cd /Applications<br />
:: cd Zend<br />
:: cd Zend\ Studio\ -\ 7.0.0<br />
:: cd plugins<br />
:: mkdir disabled<br />
:: mv com.zend.php.debug.* disabled<br />
:: cd ..<br />
:: cd ZendStudio.app/Contents/MacOS/<br />
:: ./ZendStudio -clean</code></p>
]]></content:encoded>
			<wfw:commentRss>http://thinsoldier.com/wordpress/archives/23/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
