<?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>The Deployer</title>
	<atom:link href="http://thedeployer.com/feed" rel="self" type="application/rss+xml" />
	<link>http://thedeployer.com</link>
	<description>Technology and Development Today</description>
	<lastBuildDate>Fri, 11 Jun 2010 11:28:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP on steroids &#8211; HipHop PHP</title>
		<link>http://thedeployer.com/2010-04-php-on-steroids-hiphop-php</link>
		<comments>http://thedeployer.com/2010-04-php-on-steroids-hiphop-php#comments</comments>
		<pubDate>Thu, 08 Apr 2010 18:31:13 +0000</pubDate>
		<dc:creator>Lucian Daniliuc</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://thedeployer.com/?p=296</guid>
		<description><![CDATA[HipHop transforms your PHP source code into highly optimized C++ and then compiles it with g++ to build binary files. You keep coding in simpler PHP, then HipHop executes your source code in a semantically equivalent manner and sacrifices some rarely used features &#8211; such as eval() &#8211; in exchange for improved performance.
More info here:

News: [...]]]></description>
			<content:encoded><![CDATA[<p>HipHop transforms your PHP source code into highly optimized C++ and then compiles it with g++ to build binary files. You keep coding in simpler PHP, then HipHop executes your source code in a semantically equivalent manner and sacrifices some rarely used features &#8211; such as eval() &#8211; in exchange for improved performance.</p>
<p>More info here:</p>
<ul>
<li><a href="http://developers.facebook.com/news.php?story=358&#038;blog=1">News: HipHop for PHP: Move Fast</a></li>
<li><a href="http://developers.facebook.com/hiphop-php/">Facebook Open-Sources HipHop PHP Compiler Software</a></li>
<li><a href="http://wiki.github.com/facebook/hiphop-php/">git &#8211; Facebook / HipHop-PHP</a></li>
<li><a href="http://groups.google.com/group/hiphop-php-dev?pli=1">Google Groups &#8211; HipHop for PHP Dev</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://thedeployer.com/2010-04-php-on-steroids-hiphop-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why You Can’t Work at Work</title>
		<link>http://thedeployer.com/2010-03-why-you-can%e2%80%99t-work-at-work</link>
		<comments>http://thedeployer.com/2010-03-why-you-can%e2%80%99t-work-at-work#comments</comments>
		<pubDate>Tue, 30 Mar 2010 10:19:33 +0000</pubDate>
		<dc:creator>Lucian Daniliuc</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rapid development]]></category>

		<guid isPermaLink="false">http://thedeployer.com/?p=291</guid>
		<description><![CDATA[Lovely presentation, except the fact that it is advertising the products of 37signals, it does hold some truth:

If the embed doesn&#8217;t work, check it out here: http://bigthink.com/ideas/18522
]]></description>
			<content:encoded><![CDATA[<p>Lovely presentation, except the fact that it is advertising the products of 37signals, it does hold some truth:</p>
<p><script src="http://video.bigthink.com/player.js?deepLinkEmbedCode=03NG42MTqVnn6kOnuDv8k_iDC2HEGniT&#038;embedCode=03NG42MTqVnn6kOnuDv8k_iDC2HEGniT&#038;height=288&#038;autoplay=0&#038;width=512"></script></p>
<p>If the embed doesn&#8217;t work, check it out here: <a href="http://bigthink.com/ideas/18522">http://bigthink.com/ideas/18522</a></p>
]]></content:encoded>
			<wfw:commentRss>http://thedeployer.com/2010-03-why-you-can%e2%80%99t-work-at-work/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kohana &amp; FastCGI routing problems</title>
		<link>http://thedeployer.com/2009-10-kohana-fastcgi-routing-problems</link>
		<comments>http://thedeployer.com/2009-10-kohana-fastcgi-routing-problems#comments</comments>
		<pubDate>Sat, 03 Oct 2009 18:11:54 +0000</pubDate>
		<dc:creator>Lucian Daniliuc</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[kohana php router]]></category>

		<guid isPermaLink="false">http://thedeployer.com/?p=289</guid>
		<description><![CDATA[If you&#8217;re developing on Kohana framework and your server is setup with Apache and FastCGI, you&#8217;ll run into some weird trouble regarding URL processing. This is happening because Kohana&#8217;s Router class is not looking at the REQUEST_URI key in the $_SERVER global, and gets the PHP_SELF instead that always returns the index.php file.
This has a [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re developing on Kohana framework and your server is setup with Apache and FastCGI, you&#8217;ll run into some weird trouble regarding URL processing. This is happening because Kohana&#8217;s Router class is not looking at the REQUEST_URI key in the $_SERVER global, and gets the PHP_SELF instead that always returns the index.php file.</p>
<p>This has a workaround: either you alter the find_uri() method in the Router class, or you change the way the parameters are sent to the script via .htaccess&#8217;s mod_rewrite rules, as described in <a href="http://projects.kohanaphp.com/issues/1923">http://projects.kohanaphp.com/issues/1923</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thedeployer.com/2009-10-kohana-fastcgi-routing-problems/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating a Subversion (SVN) repository</title>
		<link>http://thedeployer.com/2009-07-migrating-a-subversion-svn-repository</link>
		<comments>http://thedeployer.com/2009-07-migrating-a-subversion-svn-repository#comments</comments>
		<pubDate>Sat, 25 Jul 2009 07:18:25 +0000</pubDate>
		<dc:creator>Lucian Daniliuc</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://thedeployer.com/?p=283</guid>
		<description><![CDATA[Recently I have a brand new stand-alone server for my repositories and other minor thingies. And the challenging thing: moving the repositories from my home desktop computer to this server.
My setup was this: I have my home desktop computer that runs Windows XP, and the repositories were stored and managed using VisualSVN, a great tool [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have a brand new stand-alone server for my repositories and other minor <a href="http://www.urbandictionary.com/define.php?term=thingy">thingies</a>. And the challenging thing: moving the repositories from my home desktop computer to this server.</p>
<p>My setup was this: I have my home desktop computer that runs Windows XP, and the repositories were stored and managed using VisualSVN, a great tool to manage SVN repositories, if you&#8217;re running Windows. The applications were deployed on my Windows machine (for developing purposes) and on the hosting server (live, production deployment) that runs Linux. And here&#8217;s what I&#8217;ve done&#8230;</p>
<p><strong>On the source, Windows machine</strong></p>
<p>I&#8217;ve stopped the SVN service, so no svn updates/commits would be initiated. I&#8217;ve opened up a console and ran the following command:<br />
<code>svnadmin dump d:\Repositories\repo_a > repo_a.dump</code></p>
<p>Then I&#8217;ve packed the repo_a.dump file because it&#8217;s almost plaintext and copied the archive to the destination server.</p>
<p><strong>On the destination, Linux machine</strong></p>
<p>I&#8217;ve unpacked the dump file and then:<br />
<code>svnadmin create repo_a<br />
svnadmin load repo_a < repo_a.dump</code></p>
<p>After that, I needed to <code>chown -R www-data:www-data ./*</code> to make the files belong to apache, and then add the authentication back.</p>
<p>This is just about it for the relocation of the repositories. But we need to do one more thing: alter all the checkouts to point to the new repositories. This is done in a way on a Windows machine, and a bit different on a linux machine.</p>
<p><strong>Checked out repositories fixing</strong></p>
<p>To make all the deployed checkouts point to the new server, you need to edit every file called "entries" that is located in every ".svn" folder of a checked out repository.</p>
<p>To do that, on Windows you can use <a href="http://tools.tortoisesvn.net/grepWin" target="_blank">grepWin</a>, a lovely tool that does all the work:</p>
<p><a href="http://thedeployer.com/wp-content/uploads/2009/07/grepwin.png"><img src="http://thedeployer.com/wp-content/uploads/2009/07/grepwin-300x275.png" alt="grepwin" title="grepwin" width="300" height="275" class="aligncenter size-medium wp-image-284" /></a></p>
<p>There you have it. On linux, you'll need perl:<br />
<code>find ./ -name "entries"|xargs perl -w -i -p -e "s/svn\.example\.com/new\.server\.com/g"</code></p>
<p>This command replaces all the occurences of "svn.example.com" with "new.server.com" in all the files named "entries" in the current folder and below. Replace for your own needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://thedeployer.com/2009-07-migrating-a-subversion-svn-repository/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Listing files in a directory with PHP</title>
		<link>http://thedeployer.com/2009-05-listing-files-in-a-directory-with-php</link>
		<comments>http://thedeployer.com/2009-05-listing-files-in-a-directory-with-php#comments</comments>
		<pubDate>Mon, 18 May 2009 08:27:57 +0000</pubDate>
		<dc:creator>Lucian Daniliuc</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[directory]]></category>

		<guid isPermaLink="false">http://thedeployer.com/?p=277</guid>
		<description><![CDATA[Listing the files in a directory in PHP is as simple as 1 line:

$aList = scandir&#40; '/tmp' &#41;;
print_r&#40; $aList &#41;;

This will retrieve all the files in the specified directory (including &#8220;.&#8221; and &#8220;..&#8221;):

Array
&#40;
    &#91;0&#93; =&#62; .
    &#91;1&#93; =&#62; ..
    &#91;2&#93; =&#62; uioeng34890gn34.dat
&#41;

]]></description>
			<content:encoded><![CDATA[<p>Listing the files in a directory in PHP is as simple as 1 line:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$aList</span> <span style="color: #339933;">=</span> <span style="color: #990000;">scandir</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'/tmp'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$aList</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This will retrieve all the files in the specified directory (including &#8220;.&#8221; and &#8220;..&#8221;):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">Array</span>
<span style="color: #009900;">&#40;</span>
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #339933;">.</span>
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #339933;">..</span>
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> uioeng34890gn34<span style="color: #339933;">.</span>dat
<span style="color: #009900;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://thedeployer.com/2009-05-listing-files-in-a-directory-with-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why should we use PHP constants inside classes</title>
		<link>http://thedeployer.com/2009-04-why-should-we-use-php-constants-inside-classes</link>
		<comments>http://thedeployer.com/2009-04-why-should-we-use-php-constants-inside-classes#comments</comments>
		<pubDate>Tue, 14 Apr 2009 20:58:19 +0000</pubDate>
		<dc:creator>Lucian Daniliuc</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[constants]]></category>

		<guid isPermaLink="false">http://thedeployer.com/?p=237</guid>
		<description><![CDATA[constant
A constant is an identifier (name) for a simple value. As the name suggests, that value cannot change during the execution of the script (except for magic constants, which aren&#8217;t actually constants). A constant is case-sensitive by default. By convention, constant identifiers are always uppercase.

Practically, it&#8217;s as easy as:

define&#40;'DATABASE', 'thedatabase'&#41;;

Constants are useful in a lot [...]]]></description>
			<content:encoded><![CDATA[<dl>
<dt><strong>constant</strong></dt>
<dd>A constant is an identifier (name) for a simple value. As the name suggests, that value cannot change during the execution of the script (except for <a href="http://www.php.net/manual/en/language.constants.predefined.php">magic constants</a>, which aren&#8217;t actually constants). A constant is case-sensitive by default. By convention, constant identifiers are always uppercase.</dd>
</dl>
<p>Practically, it&#8217;s as easy as:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DATABASE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thedatabase'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Constants are useful in a lot of cases:
<ul>
<li><b>Configuration directives</b>
<p>Storing database connection information is plain easy and available everywhere.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'DATABASE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thedatabase'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'USERNAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'theuser'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'PASSWORD'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thepass'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'HOSTNAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'localhost'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</p>
<p>These have global scope, cannot be tempered with and can be accessed from everywhere. How easy is that?</p>
</li>
<li><b>Anti-hack techniques</b>
<p>You can make sure nobody accesses and uses your files remotely by checking a constant that you only define in one place, unaccessible from the web.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ANTIHACK_FG3N4890FN4334G3GH'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'You naughty'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</li>
<li><b>Various flags</b>
<p>Usually you need here and there to set some flags that activate or dezactivate some functionalities in your application, including debug flags.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'USE_CACHE'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//.... some code....</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">constant</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'USE_CACHE'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">//... cache data here</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>By using
<pre>constant()</pre>
<p>, we don&#8217;t get a notice if the constant is not defined, and to disable the cache, you can take any approach you find suited: either set the defined constant to &#8220;false&#8221;, or comment it, the outcome is the same and you don&#8217;t get notices and warnings in your code, even if you completely remove the constant from your code.</p>
</li>
</ul>
<p>So, you define the constants with <b>define()</b>, you check to see if certain constant is defined with the <b>defined()</b> function and you get the value of a constant that could or could not be defined using <b>constant()</b>.</p>
<p><strong>Using constants in classes</strong></p>
<p>Along with the wonders of OOP in PHP 5 came the possibility to define constants inside classes. For example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> AppSettings <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">const</span> DATABASE <span style="color: #339933;">=</span> <span style="color: #0000ff;">'thedeployer'</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">const</span> HOSTNAME <span style="color: #339933;">=</span> <span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">const</span> USERNAME <span style="color: #339933;">=</span> <span style="color: #0000ff;">'deployer'</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">const</span> PASSWORD <span style="color: #339933;">=</span> <span style="color: #0000ff;">'thepassword'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'database = `'</span> <span style="color: #339933;">.</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">DATABASE</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'`'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'hostname = `'</span> <span style="color: #339933;">.</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">HOSTNAME</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'`'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'username = `'</span> <span style="color: #339933;">.</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">USERNAME</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'`'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'password = `'</span> <span style="color: #339933;">.</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">PASSWORD</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'`'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// END constructor</span>
<span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// END class</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'database from outside = '</span> <span style="color: #339933;">.</span> AppSettings<span style="color: #339933;">::</span><span style="color: #004000;">DATABASE</span><span style="color: #339933;">;</span></pre></div></div>

<p>Basically, the constants ar a part of the class definition, you don&#8217;t have to actually execute code to define the constants and they are available immediately for use. And most important, you don&#8217;t have to instantiate a class to access it&#8217;s constants, and you always know where to look for the definition.</p>
<p>The advantages and differences that one should remember when using constants and the reasons to use constants in classes rather than just floating around in your code are:</p>
<ul>
<li><strong>Constants defined in classes do not show up in the global scope.</strong>
<p>There is a stack where PHP holds all the constants and it&#8217;s a rather large list. It&#8217;s nothing like the variables which are a total of 4 superglobals that exists when a script starts. To see the list of defined constants, just run:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">get_defined_constants</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>You&#8217;ll get a huge list of approximately 1760 defined constants when your script hasn&#8217;t got a line. This is a required compromise, because these constants include TRUE, FALSE, error codes, constants defined by enabled extensions and some other useful constants. This is why your constants shouldn&#8217;t go here. If you define your constants as part of some classes, they remain within the class definition and don&#8217;t end up in the constants pool. And don&#8217;t worry, even if they&#8217;re defined within a class, they are available everywhere, just like a normal constant.</p>
</li>
<li><strong>Grouping the same type of data together.</strong>
<p>Usually, you can define a class that just deals with every piece of configuration data your application needs, just like de example above. This means that all your constants are in one place, and if you need to change a constant, you only need to find where the class is defined and change your info. You even have the class name, because you&#8217;ll be using the constants defined in some class this way:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'database from outside = '</span> <span style="color: #339933;">.</span> AppSettings<span style="color: #339933;">::</span><span style="color: #004000;">DATABASE</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// this means that the &quot;DATABASE&quot; constant is defined in the &quot;AppSettings&quot; class.</span></pre></div></div>

<p>How easy is that?</p>
</li>
<li><strong>Available without executing code.</strong>
<p>Since the constants are part of the class definition, they&#8217;re available before even the first line of actual code is executed.</p>
</li>
<li><strong>Class autoloading power.</strong>If you have the autoload feature in use in your application, you&#8217;ll get another advantage. You&#8217;ll have the constants defined with a single call to the wanted class that contain the constants. The autoloader will locate an load you class.</li>
</ul>
<p>These are just a few things that need to be said and noted when addressing constants. Be careful not to use constants where they&#8217;re not appropriate. For example in internationalization. Don&#8217;t define the i18n labels in constants. That&#8217;s a very greedy approach. Use <a href="http://www.php.net/gettext">gettext</a> extension or some other dedicated solution for this. Using constants is just bad.</p>
<p>Happy coding and have a nice day!</p>
]]></content:encoded>
			<wfw:commentRss>http://thedeployer.com/2009-04-why-should-we-use-php-constants-inside-classes/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CodeIgniter 1.6 + Rapyd library download</title>
		<link>http://thedeployer.com/2009-04-codeigniter-16-rapyd-library-download</link>
		<comments>http://thedeployer.com/2009-04-codeigniter-16-rapyd-library-download#comments</comments>
		<pubDate>Tue, 14 Apr 2009 05:00:06 +0000</pubDate>
		<dc:creator>Lucian Daniliuc</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[rapyd]]></category>

		<guid isPermaLink="false">http://thedeployer.com/?p=221</guid>
		<description><![CDATA[When I need to develop a fast-growing, flexible and complex management application that needs to be done in a very short time, I use a CodeIgniter &#8211; Rapyd &#8220;bundle&#8221; that I&#8217;ve built to work, which can be turned into a really complex application.
Actually, I&#8217;ve built a complex management application, and then stripped down all it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>When I need to develop a fast-growing, flexible and complex management application that needs to be done in a very short time, I use a CodeIgniter &#8211; Rapyd &#8220;bundle&#8221; that I&#8217;ve built to work, which can be turned into a really complex application.</p>
<p>Actually, I&#8217;ve built a complex management application, and then stripped down all it&#8217;s business logic so that only the framework to build another remained.</p>
<p>As you may know, Rapyd is no longer being maintained for CI, but has moved to Kohana framework. So, if you need a solid framework to build you application and you don&#8217;t want to loose any time with the building blocks for basic functionality like displaying a data table, filtering, sorting, adding, modifying and deleting entries, just use this.</p>
<p><a title="CodeIgniter and Rapyd Bundle" href="http://thedeployer.com/downloads/rapydcodeigniter.zip"><strong>Download CodeIgniter 1.6 + Rapyd</strong></a></p>
<p>Here are some screenshots of what can be done in just a few hours&#8230;</p>
<p><a href="http://thedeployer.com/wp-content/uploads/2009/04/rapyd-screenshot1.jpg"><img class="aligncenter size-full wp-image-228" title="rapyd-screenshot1" src="http://thedeployer.com/wp-content/uploads/2009/04/rapyd-screenshot1.jpg" alt="rapyd-screenshot1" width="500" height="300" /></a></p>
<p><a href="http://thedeployer.com/wp-content/uploads/2009/04/rapyd-screenshot2.jpg"><img class="aligncenter size-full wp-image-229" title="rapyd-screenshot2" src="http://thedeployer.com/wp-content/uploads/2009/04/rapyd-screenshot2.jpg" alt="rapyd-screenshot2" width="500" height="300" /></a></p>
<p><a href="http://thedeployer.com/wp-content/uploads/2009/04/rapyd-screenshot3.jpg"><img class="aligncenter size-full wp-image-227" title="rapyd-screenshot3" src="http://thedeployer.com/wp-content/uploads/2009/04/rapyd-screenshot3.jpg" alt="rapyd-screenshot3" width="500" height="300" /></a></p>
<p>Happy coding and have a nice day!</p>
]]></content:encoded>
			<wfw:commentRss>http://thedeployer.com/2009-04-codeigniter-16-rapyd-library-download/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Menu Generator</title>
		<link>http://thedeployer.com/2009-04-css-menu-generator</link>
		<comments>http://thedeployer.com/2009-04-css-menu-generator#comments</comments>
		<pubDate>Mon, 13 Apr 2009 17:57:51 +0000</pubDate>
		<dc:creator>Lucian Daniliuc</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[menu]]></category>

		<guid isPermaLink="false">http://thedeployer.com/?p=216</guid>
		<description><![CDATA[cssmenumaker.com has quite a few ready-made CSS menus that just need to be copy-pasted in your site.
You can choose from drop-down menu, horizontal or vertical menu style and after that, you just copy-paste the code, or you can customize your menu.
Menus are usually compatible with Firefox, Internet Explorer 6 &#38; 7, Safari and Opera.
]]></description>
			<content:encoded><![CDATA[<p><a title="CSS Menu Maker" href="http://www.cssmenumaker.com/index.php" target="_blank">cssmenumaker.com</a> has quite a few ready-made CSS menus that just need to be copy-pasted in your site.</p>
<p>You can choose from drop-down menu, horizontal or vertical menu style and after that, you just copy-paste the code, or you can customize your menu.</p>
<p>Menus are usually compatible with Firefox, Internet Explorer 6 &amp; 7, Safari and Opera.</p>
]]></content:encoded>
			<wfw:commentRss>http://thedeployer.com/2009-04-css-menu-generator/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to create iPhone themes</title>
		<link>http://thedeployer.com/2009-04-how-to-create-iphone-themes</link>
		<comments>http://thedeployer.com/2009-04-how-to-create-iphone-themes#comments</comments>
		<pubDate>Sun, 12 Apr 2009 07:45:44 +0000</pubDate>
		<dc:creator>Lucian Daniliuc</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[Online Resources]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://thedeployer.com/?p=210</guid>
		<description><![CDATA[I found a great website that teaches you how to make and use Winterboard themes.
This nice tutorial explains, step by step, how to:

Create a basic theme
Change the program icons
Change the battery icons
Change the carrier logos
Change the wifi signal strength icons
Change the cellular signal strength bars
Change the keyboard
Change the sliders
Change the progress wheels
Change the system sounds
Change [...]]]></description>
			<content:encoded><![CDATA[<p>I found a great website that teaches you how to make and use Winterboard themes.</p>
<div id="attachment_211" class="wp-caption aligncenter" style="width: 510px"><a href="http://thedeployer.com/wp-content/uploads/2009/04/hackthatiphone-wintthemes.jpg"><img class="size-full wp-image-211" title="hackthatiphone.com" src="http://thedeployer.com/wp-content/uploads/2009/04/hackthatiphone-wintthemes.jpg" alt="hackthatiphone.com" width="500" height="315" /></a><p class="wp-caption-text">hackthatiphone.com</p></div>
<p>This nice tutorial explains, step by step, how to:</p>
<ul>
<li><a href="http://www.hackthatphone.com/20/themes_with_winterboard_section2.html" target="_blank">Create a basic theme</a></li>
<li><a href="http://www.hackthatphone.com/20/themes_with_winterboard_section3.html" target="_blank">Change the program icons</a></li>
<li><a href="http://www.hackthatphone.com/20/themes_with_winterboard_section4.html" target="_blank">Change the battery icons</a></li>
<li><a href="http://www.hackthatphone.com/20/themes_with_winterboard_section5.html" target="_blank">Change the carrier logos</a></li>
<li><a href="http://www.hackthatphone.com/20/themes_with_winterboard_section6.html" target="_blank">Change the wifi signal strength icons</a></li>
<li><a href="http://www.hackthatphone.com/20/themes_with_winterboard_section7.html" target="_blank">Change the cellular signal strength bars</a></li>
<li><a href="http://www.hackthatphone.com/20/themes_with_winterboard_section8.html" target="_blank">Change the keyboard</a></li>
<li><a href="http://www.hackthatphone.com/20/themes_with_winterboard_section9.html" target="_blank">Change the sliders</a></li>
<li><a href="http://www.hackthatphone.com/20/themes_with_winterboard_section10.html" target="_blank">Change the progress wheels</a></li>
<li><a href="http://www.hackthatphone.com/20/themes_with_winterboard_section11.html" target="_blank">Change the system sounds</a></li>
<li><a href="http://www.hackthatphone.com/20/themes_with_winterboard_section12.html" target="_self">Change the page indicators (the bullets)</a></li>
<li><a href="http://www.hackthatphone.com/20/themes_with_winterboard_section14.html" target="_blank">Customize the dialer keypad</a></li>
<li><a href="http://www.hackthatphone.com/20/themes_with_winterboard_section15.html" target="_blank">Change the fonts and colors</a></li>
<li><a href="http://www.hackthatphone.com/20/themes_with_winterboard_section19.html" target="_blank">Animate the lockscreen images</a></li>
</ul>
<p>Everything starts here:</p>
<p><a title="Creating and using themes with Winterboard" href="http://www.hackthatphone.com/20/themes_with_winterboard.html" target="_blank"><strong>http://www.hackthatphone.com/20/themes_with_winterboard.html</strong></a></p>
<p>Happy theming and don&#8217;t forget to share your themes.</p>
]]></content:encoded>
			<wfw:commentRss>http://thedeployer.com/2009-04-how-to-create-iphone-themes/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Unlocking (jailbreaking) your iPhone 3G (2.2.1)</title>
		<link>http://thedeployer.com/2009-04-unlocking-jailbreaking-your-iphone-3g</link>
		<comments>http://thedeployer.com/2009-04-unlocking-jailbreaking-your-iphone-3g#comments</comments>
		<pubDate>Thu, 09 Apr 2009 18:17:41 +0000</pubDate>
		<dc:creator>Lucian Daniliuc</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[jailbreak]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://thedeployer.com/?p=165</guid>
		<description><![CDATA[The background and &#8220;the why?&#8221;
Apple has a very evolved sense of security and thus you won&#8217;t be able to install any application not listed in the AppStore. In order for you to be able to install WinterBoard (a replacement for that main menu), themes, sounds, ringtones, wallpapers and all those goodies, you need to jailbreak [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The background and &#8220;the why?&#8221;</strong></p>
<p>Apple has a very evolved sense of security and thus you won&#8217;t be able to install any application not listed in the AppStore. In order for you to be able to install WinterBoard (a replacement for that main menu), themes, sounds, ringtones, wallpapers and all those goodies, you need to jailbreak your iPhone which means you have to make it be able to install any software you choose.</p>
<p>Each time you update to a new firmware version, a new QuickPWN tool is necessary. This article covers the update to 2.2.1, but it is exactly the same for any older version (I&#8217;ve tried them all).</p>
<p>Warning! This is not the same as unlocking your phone, which means making it work with any GSM operator out there. This article is not about this. Unlocking is illegal, while jailbreaking is legal and usually doesn&#8217;t break your warranty.</p>
<p><strong>How to jailbreak your iPhone</strong></p>
<p><strong>1. Update</strong></p>
<p>The first thing to do is have the latest version of iTunes installed in order to update your iPhone to the latest firmware. Just connect it to a internet-enabled computer with iTunes and you&#8217;ll instantly get the message to download and install the latest firmware, if you haven&#8217;t done so already.</p>
<p><strong>2. Get the tool</strong></p>
<p>Go to  <a href="http://www.quickpwn.com/2009/01/official-quickpwn-221-and-pwnagetool-jailbreak-for-windowsmac.html" target="_blank"><strong>http://www.quickpwn.com/2009/01/official-quickpwn-221-and-pwnagetool-jailbreak-for-windowsmac.html</strong></a> and download <strong>QuickPWN 2.2.1 for Windows</strong>. It&#8217;s small piece of software that does exactly this: jailbreak your phone.</p>
<div id="attachment_184" class="wp-caption aligncenter" style="width: 510px"><a href="http://thedeployer.com/wp-content/uploads/2009/04/quickpwn.jpg"><img class="size-full wp-image-184" title="QuickPWN Official website" src="http://thedeployer.com/wp-content/uploads/2009/04/quickpwn.jpg" alt="QuickPWN Official website" width="500" height="264" /></a><p class="wp-caption-text">QuickPWN Official website</p></div>
<p>When the 3.0 version will be out, this is where you should come and get the latest version.</p>
<p>A word of caution. I&#8217;ve seen that fresly releases of QuickPWN tools for fresh firmware versions are not fail-proof and you may run into trouble. You should wait for at least a month before jailbreaking your phone after a new version is released just to make sure that most of the bugs are identified and fixed. That is what I do.</p>
<p><strong>3. Start the tool</strong></p>
<p>Have the iPhone connected via USB cable to the computer and fire up the downloaded QuickPWN tool. It will show up like this:</p>
<div id="attachment_170" class="wp-caption aligncenter" style="width: 310px"><a href="http://thedeployer.com/wp-content/uploads/2009/04/12.jpg"><img class="size-medium wp-image-170" title="QuickPWN Tool startup screenshot" src="http://thedeployer.com/wp-content/uploads/2009/04/12-300x261.jpg" alt="QuickPWN Tool startup screenshot" width="300" height="261" /></a><p class="wp-caption-text">QuickPWN Tool startup screenshot</p></div>
<p>Do not worry, the procedure is easy and it&#8217;s very unlikely that something will go wrong.</p>
<p><strong>4. Firwmare file</strong></p>
<p>Select the upgraded firmware. Once iTunes upgrades your iPhone firmware version to 2.2.1, it automaticaly saves the firmware somewhere on your drive. QuickPWN tools needs this file in order to patch it and reapply it to your iPhone.</p>
<p>If you have the file, is already selected in the textbox, if not, you can download it from <a title="Apple iPhone 3G 2.2.1 firmware" href="http://www.quickpwn.com/2009/01/iphone-221-and-ipod-touch-221-firmware-released.html" target="_blank">here</a>. After selecting it, or if you already had it selected, a progress circle starts spinning telling you that he&#8217;s working on patching the selected file. It does it in some backup file, so have no fear.</p>
<div id="attachment_171" class="wp-caption aligncenter" style="width: 310px"><a href="http://thedeployer.com/wp-content/uploads/2009/04/13.jpg"><img class="size-medium wp-image-171" title="QuickPWN select firmware page" src="http://thedeployer.com/wp-content/uploads/2009/04/13-300x261.jpg" alt="QuickPWN select firmware page" width="300" height="261" /></a><p class="wp-caption-text">QuickPWN select firmware page</p></div>
<p><strong>5. Touching the firmware file</strong></p>
<p>After the tool patches the firmware file, you&#8217;ll see a big checkmark next to the phone picture. Click on the left arrow to go to the next step.</p>
<div id="attachment_172" class="wp-caption aligncenter" style="width: 310px"><a href="http://thedeployer.com/wp-content/uploads/2009/04/14.jpg"><img class="size-medium wp-image-172" title="QuickPWN patched the firmware successfuly" src="http://thedeployer.com/wp-content/uploads/2009/04/14-300x261.jpg" alt="QuickPWN patched the firmware successfuly" width="300" height="261" /></a><p class="wp-caption-text">QuickPWN patched the firmware successfuly</p></div>
<p><strong>6. Select what you wish to install</strong></p>
<p>Installing application will still be done from the iPhone, but there are two very nice applications to help you in doing that: Cydia and Installer. You should leave them both checked and go to the next page.</p>
<div id="attachment_173" class="wp-caption aligncenter" style="width: 310px"><a href="http://thedeployer.com/wp-content/uploads/2009/04/15.jpg"><img class="size-medium wp-image-173" title="QuickPWN selecting Cydia and Installer" src="http://thedeployer.com/wp-content/uploads/2009/04/15-300x261.jpg" alt="QuickPWN selecting Cydia and Installer" width="300" height="261" /></a><p class="wp-caption-text">QuickPWN selecting Cydia and Installer</p></div>
<p><strong>7. Check the USB connection</strong></p>
<p>This is where things will start to be applied to your phone and for that check that the phone is correctly connected to the PC and click next.</p>
<div id="attachment_175" class="wp-caption aligncenter" style="width: 310px"><a href="http://thedeployer.com/wp-content/uploads/2009/04/17.jpg"><img class="size-medium wp-image-175" title="QuickPWN checking the USB connection" src="http://thedeployer.com/wp-content/uploads/2009/04/17-300x261.jpg" alt="QuickPWN checking the USB connection" width="300" height="261" /></a><p class="wp-caption-text">QuickPWN checking the USB connection</p></div>
<p>During the jailbreaking you will be asked to keep the Start button pressed for a few seconds, then (while still keeping the Start button pressed) you will be asked to also push and keep pushed the power button for a number of seconds, and then, without releasing the Start button, to release the Power button and keep the Start button pressed for some more seconds.</p>
<p>Don&#8217;t panic, even if you don&#8217;t get it right the first time, you cand just try and try again. Just have your fingers correctly positioned and click next. This operations are required to put your iPhone in firmware upgrade mode, which cannot be done by software.</p>
<p><strong>8. The jailbreaking</strong></p>
<p>This is where the real process starts. As the iPhone connects in Recovery Mode you&#8217;ll see the firmware upgrade indicated on your phone.</p>
<div id="attachment_181" class="wp-caption aligncenter" style="width: 310px"><a href="http://thedeployer.com/wp-content/uploads/2009/04/dsc04889.jpg"><img class="size-medium wp-image-181" title="iPhone in Recovery Mode" src="http://thedeployer.com/wp-content/uploads/2009/04/dsc04889-300x225.jpg" alt="iPhone in Recovery Mode" width="300" height="225" /></a><p class="wp-caption-text">iPhone in Recovery Mode</p></div>
<p>After entering Recovery Mode, the jailbreaking procedure will start:</p>
<div id="attachment_176" class="wp-caption aligncenter" style="width: 310px"><a href="http://thedeployer.com/wp-content/uploads/2009/04/18.jpg"><img class="size-medium wp-image-176" title="QuickPWN jailbreaking your iPhone" src="http://thedeployer.com/wp-content/uploads/2009/04/18-300x227.jpg" alt="QuickPWN jailbreaking your iPhone" width="300" height="227" /></a><p class="wp-caption-text">QuickPWN jailbreaking your iPhone</p></div>
<p>While the jailbreaking is in progress, your iPhone will show this screen:</p>
<div id="attachment_182" class="wp-caption aligncenter" style="width: 310px"><a href="http://thedeployer.com/wp-content/uploads/2009/04/dsc04904.jpg"><img class="size-medium wp-image-182" title="QuickPWN jailbreaking almost complete." src="http://thedeployer.com/wp-content/uploads/2009/04/dsc04904-300x225.jpg" alt="QuickPWN jailbreaking almost complete." width="300" height="225" /></a><p class="wp-caption-text">QuickPWN jailbreaking almost complete.</p></div>
<p>This is going to take a few minutes. Don&#8217;t worry, this is perfectly normal.</p>
<p>Just before it ends, your iPhone will restart and show up a progress bar indicating the final touches:</p>
<div id="attachment_183" class="wp-caption aligncenter" style="width: 310px"><a href="http://thedeployer.com/wp-content/uploads/2009/04/dsc04922.jpg"><img class="size-medium wp-image-183" title="QuickPWN reboots the iPhone and adds the final touch." src="http://thedeployer.com/wp-content/uploads/2009/04/dsc04922-300x225.jpg" alt="QuickPWN reboots the iPhone and adds the final touch." width="300" height="225" /></a><p class="wp-caption-text">QuickPWN reboots the iPhone and adds the final touch.</p></div>
<p><strong>9. Hurray!</strong> Your iPhone is out of it&#8217;s cage, and you can start benefiting from the tons and tons of applications, games, utilities and themes out there. How to install applications by using Cydia and Installer will be the subject of another article.</p>
<p><strong>DISCLAIMER: </strong>I am <strong>not </strong>responsible if, for whatever reason, your phone, PC, ego or anything else is damaged or harmed in following this how-to. People all around the world jailbreak thousands of iPhones and have no problems, but you may have, for no apparent reason. Do this on your own risk!</p>
]]></content:encoded>
			<wfw:commentRss>http://thedeployer.com/2009-04-unlocking-jailbreaking-your-iphone-3g/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
