<?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>Eirik Hoem&#039;s Blog &#187; PHP</title>
	<atom:link href="http://blog.eirikhoem.net/index.php/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.eirikhoem.net</link>
	<description>PHP, AS3, Flex, Flash</description>
	<lastBuildDate>Mon, 08 Feb 2010 19:54:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Book review: Mastering phpMyAdmin 3.1</title>
		<link>http://blog.eirikhoem.net/index.php/2009/09/12/book-review-mastering-phpmyadmin-31/</link>
		<comments>http://blog.eirikhoem.net/index.php/2009/09/12/book-review-mastering-phpmyadmin-31/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 14:30:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/?p=130</guid>
		<description><![CDATA[Book review: Mastering phpMyAdmin 3.1
ISBN: 9871847197863
Publisher: Packt Publishing
Author: Marc Delisle
I had pretty much forgotten phpMyAdmin when I got a mail from Swati at Packt Publishing asking me to review this book. It&#8217;s been a very long time since I last used phpMyAdmin. When I first started out with web development (under Windows) and PHP I [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_136" class="wp-caption alignleft" style="width: 172px"><a href="http://www.packtpub.com/mastering-phpmyadmin-3-1-fourth-edition/book/mid/260509je891v" onclick="javascript:pageTracker._trackPageview ('/outbound/www.packtpub.com');"><img class="size-full wp-image-136" title="Mastering phpMyAdmin 3.1 Cover" src="http://blog.eirikhoem.net/wp-content/uploads/2009/09/mastering-phpmyadmin-311.jpg" alt="Mastering phpMyAdmin 3.1 Cover" width="162" height="200" /></a><p class="wp-caption-text">Mastering phpMyAdmin 3.1 Cover</p></div>
<p><strong>Book review:</strong> <a href="http://www.packtpub.com/mastering-phpmyadmin-3-1-fourth-edition/book/mid/260509je891v" onclick="javascript:pageTracker._trackPageview ('/outbound/www.packtpub.com');">Mastering phpMyAdmin 3.1</a><br />
<strong>ISBN: </strong>9871847197863<br />
<strong>Publisher:</strong> <a href="http://www.packtpub.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.packtpub.com');">Packt Publishing</a><br />
<strong>Author:</strong> <a href="http://infomarc.info/" onclick="javascript:pageTracker._trackPageview ('/outbound/infomarc.info');">Marc Delisle</a></p>
<p>I had pretty much forgotten <a href="http://www.phpmyadmin.net/home_page/index.php" onclick="javascript:pageTracker._trackPageview ('/outbound/www.phpmyadmin.net');">phpMyAdmin </a>when I got a mail from Swati at Packt Publishing asking me to review this book. It&#8217;s been a very long time since I last used phpMyAdmin. When I first started out with web development (under Windows) and PHP I was hosted on a shared web host. They had phpMyAdmin installed as their main database management tool. With little to no knowledge on databases I was very happy to be able to do my basic list of operations to get stuff working. Needless to say I was a lightweight user.</p>
<p>Fast forward to today. I&#8217;ve moved on to Linux and the way of the command-line as many others, using the <a href="http://dev.mysql.com/downloads/gui-tools/5.0.html" onclick="javascript:pageTracker._trackPageview ('/outbound/dev.mysql.com');">MySQL Gui Tools</a> (Query Browser, Administrator) in addition. The tools from MySQL sure have their quirks and bugs, but they have mostly suited my needs for the last years. So, how does phpMyAdmin hold up, and is this the right book to get you started?</p>
<p>The book, written by <a href="http://infomarc.info/" onclick="javascript:pageTracker._trackPageview ('/outbound/infomarc.info');">Marc Delisle</a>, clocks in at 326 pages, split into 18 chapters. The topics range from basic installation and database / table management to the &#8220;Multi-Table Query Generator&#8221; amd &#8220;The Relational System&#8221;.</p>
<p>The first few pages of the first chapter explains a bit background info on the software, which is pretty much skim-though-if-interested. More interesting, it covers installation for various platforms. The coverage on the installation parts can be a bit short for new users, but should be sufficient in most cases.</p>
<p>I especially liked chapters 2 and 3. Chapter 2 deals with authentication, which is pretty well covered, and the features are surprisingly extensive. Previously I was a bit reluctant to use phpMyAdmin in a production environment due to the lack of proper authentication, but these added features grants it a new evaluation. In chapter 3 the author spends time explaining the GUI itself and how it can be customized. Some parts of this section will definitely be interesting for people doing web hosting as it allows some branding of the software itself as well as laying down some &#8216;ground rules&#8217; on the feature set to expose. In addition there are tips on user-centric adjustments for optimizing the work flow for the developer using the software. When using it on a regular basis this information is very nice to have.</p>
<p>Chapters 4 and 5 and 6 deals with database, table and data management. These chapters will probably be skim-trough material for most experienced developers, as the GUI is quite self-explanatory when it comes to these kind of actions. However, it&#8217;s worth mentioning that the author points out lots of configuration keys for controlling both the GUI, behavior and again features offered. Nothing is crucial for the lightweight user, but if phpMyAdmin is your main tool for the job you&#8217;d want to read these chapters in detail as well.</p>
<p>The coverage of exporting schemas and data is quite well done. Again I was surprised with the list of formats supported by phpMyAdmin. The author takes care to describe the various formats, as well as server-side requirements and how-to&#8217;s where applicable.</p>
<p>There is a chapter dedicated to searching, which I do not think needs a whole chapter on it&#8217;s own since it&#8217;s also very intuitive to use the GUI here. However, the chapter is quite short. The same goes for table and database operations which are also covered. Again I find the GUI clear enough for most of these tasks to be straight forward.</p>
<p>Chapter 11 deals with &#8216;The Relational System&#8217;, which I&#8217;ve never heard about. Turns out it&#8217;s pretty neat! The author does a good job of covering the tool and it&#8217;s features. It takes a bit of extra configuration to get it running (create the phpMyAdmin database). This is basically a tool that lets you work visually with your database, seeing relations between tables etc. I&#8217;ve mainly used MySQL Workbench when I&#8217;ve had to generate a model based on a database. This is a viable replacement. The chapter dealing with system documentation can come in handy if you like to document your schema.</p>
<p>There is also a chapter dedicated to MySql 5.0 and 5.1 features which may come in handy if you are up to date on that front.</p>
<p><strong>Conclusion</strong><br />
I&#8217;ve learned that phpMyAdmin has evolved quite a bit, especially in terms of authentication features and installation scripts. I was quite happy to set up the config by hand, but I think the guided setup script is a quite nice feature to new developers. My impression of phpMyAdmin has definitely changed. I used to view it as a &#8220;hobby-developers-tool&#8221; for database access, but I&#8217;ve come to realize that it offers a wast selection of features that might reduce both time and complexity for database management. For shared web-hosting and development environments it&#8217;s a really nice tool to have.</p>
<p>The book does a very good job at documenting phpMyAdmin. Some parts of the application are really too basic to describe in detail in a book, however the author has tackled this nicely by adding references to configuration tweaks and settings which makes these chapters interesting to the more advanced users.If phpMyAdmin is your weapon of choice when it comes to database management you&#8217;d definitely want to read this book. If you want to take it for a spin first, <a href="http://blog.eirikhoem.net/wp-content/uploads/2009/09/phpmyadmin_samplechapter.pdf" target="_blank">check out this sample chapter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2009/09/12/book-review-mastering-phpmyadmin-31/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Board migration &#8211; Discus 4.x to vBulletin</title>
		<link>http://blog.eirikhoem.net/index.php/2009/03/18/board-migration-discus-4x-to-vbulletin/</link>
		<comments>http://blog.eirikhoem.net/index.php/2009/03/18/board-migration-discus-4x-to-vbulletin/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 21:06:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Discus]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[vBulletin]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/?p=96</guid>
		<description><![CDATA[A short recap of my experiences with migrating a DiscusWare board to vBulletin]]></description>
			<content:encoded><![CDATA[<p>I just finished the initial trial migration of a <a href="http://www.discusware.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.discusware.com');">Discus v4.x</a> based board over to <a href="https://www.vbulletin.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.vbulletin.com');">vBulletin</a>.</p>
<p>Now, I&#8217;d like to write a few words on Discus. I cannot see why anyone looking to set up a new board would choose this software. It&#8217;s actually file based (!). Yes, you heard me. The posts, users and threads are stored in (plain) text files. I was quite surprised the first time I got around to checking out what I was supposed to migrate. If you head over to their site and check out a demo-site or two you&#8217;ll notice that the whole board seems a bit &#8230; unprofessional. It currently sells for 149 USD, which is quite amazing when you can get vBulletin for 180USD, or even <a href="http://www.phpbb.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.phpbb.com');">phpBB </a>for free. I went with vBulletin because they supported (at least partial) import from Discus, as well as the email based service in case I got stuck.</p>
<p>Now, the data migration. Upon purchasing vBulletin I got a migration utility called ImpEx which supports quite a number of boards to import from. Discus is listed as a tier 3 board, meaning it&#8217;s not actively supported anymore.. not a good sign, but still worth a shot.</p>
<p><strong>Here is a quick recap of the required actions:</strong></p>
<p>1. Download vBulletin and ImpEx from vBulletin.com<br />
2. Create a new database for vBulletin<br />
3. Install vBulletin <a href="http://www.vbulletin.com/docs/html/main/install" onclick="javascript:pageTracker._trackPageview ('/outbound/www.vbulletin.com');">as described here</a>.<br />
4. Install the ImpEx tool <a href="http://www.vbulletin.com/docs/html/main/impex_installation" onclick="javascript:pageTracker._trackPageview ('/outbound/www.vbulletin.com');">as described here</a>.<br />
5. Configure ImpEx <a href="http://www.vbulletin.com/docs/html/main/impex_config" onclick="javascript:pageTracker._trackPageview ('/outbound/www.vbulletin.com');">as described here</a>.<br />
6. Run the ImpEx tool for Discus</p>
<p>Now, in step 6 there are some modules to import. Some of them runs in a matter of seconds, while others takes up to 10 minutes in my case. I&#8217;m not sure if the script actually refreshes, so one might want to up maximum execution time for PHP to be safe.</p>
<p>To my surprise everything went absolutely fine. Not a single hickup in the migration scripts. After the data was imported I followed the <a href="http://www.vbulletin.com/docs/html/main/impex_cleanup" onclick="javascript:pageTracker._trackPageview ('/outbound/www.vbulletin.com');">post-migrate instructions</a> and did some data verification. Everything seemed to be present, but I was not able to see any threads in the forums. I could find them with searching, and when I opened a thread it clearly stated that it was belonging in the correct forum. After looking around for some time I discovered that the forums from Discus was now configured to act as categories. I solved this by going to <strong>Edit Forum -&gt; Act as Forum</strong> and set it to <strong>Yes</strong> for each forum. When I got back to the forum listing everything was in order.</p>
<p>The only things left is to move the forums around some, get a proper language pack and some other minor adjustments. All in I&#8217;m quite satisfied with the whole process. Kudos to vBulletin.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2009/03/18/board-migration-discus-4x-to-vbulletin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Internationalization in applications &#8211; Call for discussion</title>
		<link>http://blog.eirikhoem.net/index.php/2009/03/01/internationalization-in-applications-call-for-discussion/</link>
		<comments>http://blog.eirikhoem.net/index.php/2009/03/01/internationalization-in-applications-call-for-discussion/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 13:12:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Internationalization]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/?p=52</guid>
		<description><![CDATA[ At no time is freedom of speech more precious than when a man hits his thumb with a hammer. 
~Marshall Lumsden
This is an experiment in designing an internationalization feature which I&#8217;ve been thinking about for a while. The idea is for people to come up with designs and implementations for the described requirements, and [...]]]></description>
			<content:encoded><![CDATA[<p><em> At no time is freedom of speech more precious than when a man hits his thumb with a hammer. </em></p>
<p>~Marshall Lumsden</p>
<p>This is an experiment in designing an internationalization feature which I&#8217;ve been thinking about for a while. The idea is for people to come up with designs and implementations for the described requirements, and get a healthy discussion going on how to get a feature like this implemented in the best way. I&#8217;ve came up with some features and requirements which should make the design somewhat interesting.</p>
<p>Wanna play? If so, continue reading.</p>
<p>Now, let&#8217;s consider a website, which is to be deployed for several markets (in several countries), and serve both residential and corporate customers.</p>
<p><strong>Requirements</strong></p>
<p>A &#8220;tag&#8221; is an identifier for any given text that may be translated. The &#8220;tag&#8221; can be the text itself in the source language, or an identifier such as LABEL_CLICK_HERE, all depending on the implementation.</p>
<p><strong>A tag&#8217;s content can be translated to any given language</strong></p>
<p>This is the most basic feature, and does not need any explanation.</p>
<p><strong>Any given market should be able to use the application in any given language</strong></p>
<p>Customers in the French market should be able to view the application in German and so on. Does not sound tricky, but see next point.</p>
<p><strong>A tag&#8217;s content *may* have different meaning in different markets</strong></p>
<p>For example, in the US a zipCode validation error will differ from the zipCode validation error used in Spain, but surname validation errors will be the same. This also goes for descriptive texts for features and services which might differ. However, for 90%+ of the translated texts, the English translation in Spain would be the same as the english translation in the US.</p>
<p><strong>A tag&#8217;s content *may* differ based on the context of the user</strong></p>
<p>Imagine the front-page when a used is logged in. A text is presented here with information about available features, instructions on how to use them etc. Now, some of these features are not available for residential customers, while some are exclusive to residential customers. The usage/instructions of the features may be different for corporate customers. In addition, both residential and corporate customers have roles in the application (admin users and regular users), and the content may differ based on the role. Most of the tags will just have one content, but some may have several.<strong> </strong>The available contexts could be visualized as a tree structure, with &#8216;ALL&#8217; at the top, which forks out to corporate and residential, which in turn forks out to admin / user:</p>
<div id="attachment_55" class="wp-caption alignnone" style="width: 410px"><img class="size-full wp-image-55" title="Contexts" src="http://blog.eirikhoem.net/wp-content/uploads/2009/03/rect3155.png" alt="Contexts" width="400" height="227" /><p class="wp-caption-text">Contexts</p></div>
<p>When retrieving content for a tag the system should first look for the user&#8217;s context, for example &#8220;Residential Admin&#8221;, and if no content is present it shall select the parent etc.<strong><br />
</strong><br />
<strong>Any changes to a tags&#8217;s content should be kept in a history log</strong></p>
<p>Every time a tag&#8217;s content is changed, the old version should be kept for historical purposes. A nice bonus would be to be able to change a tag&#8217;s content ahead of time , that is, setting an effective date.</p>
<p>These are the basic requirements I&#8217;ve made up for this experiment. Now, I&#8217;d like to hear how you tackle internationalization in your application, and how you would design a implementation which would sastisfy the requriements described here.  I&#8217;m working on my own implementation for this which I&#8217;d like to share after I&#8217;ve seen what other people come up with. If you have suggestions for more requirements which would make this even more interesting, please send a comment!</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/PHP" rel="tag">PHP</a>, <a href="http://technorati.com/tag/Internationalization" rel="tag">Internationalization</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2009/03/01/internationalization-in-applications-call-for-discussion/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Getting back to business!</title>
		<link>http://blog.eirikhoem.net/index.php/2008/12/18/getting-back-to-business/</link>
		<comments>http://blog.eirikhoem.net/index.php/2008/12/18/getting-back-to-business/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 12:38:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Multi-touch]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Prado]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/12/18/getting-back-to-business/</guid>
		<description><![CDATA[ I&#8217;ve been dormant for quite some time, mainly due to a major project going on at work. This week I&#8217;m starting my vacation, and its time to get back to all things fun. Today I got offered a spot on the Prado Developer Team, which I hope will prove to be both a challenge [...]]]></description>
			<content:encoded><![CDATA[<p> I&#8217;ve been dormant for quite some time, mainly due to a major project going on at work. This week I&#8217;m starting my vacation, and its time to get back to all things fun. Today I got offered a spot on the Prado Developer Team, which I hope will prove to be both a challenge and a great opportunity to improve my knowledge on both the framework and PHP.</p>
<p>As a part-time project I&#8217;ve started building a multi-touch display surface inspired by Microsoft Surface. I&#8217;ve completed a *very* basic edition (<a href="http://blog.eirikhoem.net/wp-admin/%E2%80%9Dhttp://nuigroup.com/forums/viewthread/1731/%E2%80%9D">tutorial here</a>, and I&#8217;ve just started planning a more complicated setup along the lines of <a href="http://blog.eirikhoem.net/wp-admin/%E2%80%9Dhttp://nuigroup.com/forums/viewthread/1561/%E2%80%9D">this project</a>.</p>
<p>I&#8217;ll do some posts on the process as soon as I get some pictures.</p>
<p><code><p>Technorati Tags: <a href="http://technorati.com/tag/PHP" rel="tag">PHP</a>, <a href="http://technorati.com/tag/Prado" rel="tag"> Prado</a>, <a href="http://technorati.com/tag/Multi-touch" rel="tag"> Multi-touch</a></p>                                        </code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2008/12/18/getting-back-to-business/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VCL/PHP followup</title>
		<link>http://blog.eirikhoem.net/index.php/2008/08/26/vclphp-followup/</link>
		<comments>http://blog.eirikhoem.net/index.php/2008/08/26/vclphp-followup/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 10:09:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Delphi for PHP]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Prado]]></category>
		<category><![CDATA[VCL4PHP]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/08/26/vclphp-followup/</guid>
		<description><![CDATA[



 	 	
 	 	
After receiving quite some feedback on my post “Why Delphi for PHP should have used Prado instead of VCL” I decided to do a follow up to that post. Some of the feedback was quite interesting, hence this post was born.
First and foremost I&#8217;d like to address the feedback I got [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-0056923567680782";
/* default */
google_ad_slot = "6546082201";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8" /> 	<title></title> 	<meta name="GENERATOR" content="OpenOffice.org 2.4  (Linux)" /></p>
<style type="text/css"> 	<!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } 	--> 	</style>
<p style="margin-bottom: 0in">After receiving quite some feedback on my post “<a href="http://blog.eirikhoem.net/index.php/2007/09/14/why-delphi-for-php-should-have-used-prado-instead-of-vcl/">Why Delphi for PHP should have used Prado instead of VCL</a>” I decided to do a follow up to that post. Some of the feedback was quite interesting, hence this post was born.</p>
<p style="margin-bottom: 0in">First and foremost I&#8217;d like to address the feedback I got regarding the class name prefixing in VCL/PHP. I argued that the lack of class prefixes could create problems in the future, and used Prado&#8217;s T notation as as sample of something that would at least be a bit better. Let&#8217;s take a look at two VCL/PHP classes named Collection and Object. These two names are often reserved in programming langues (atleast object oriented ones). If PHP decides to introduce these two classes the VCL/PHP guys would be pretty screwed. It would involve refactoring the framework as well as applications which uses those classes. Prado on the other hand has a prefix (TCollection etc. minor, but it&#8217;s a world of difference). I assume that the VCL/PHP authors will introduce namespace support with PHP 5.3, so this issue will hopefully be a thing of the past when 5.3 ships. That said, I&#8217;m a bit curious to see how the migration / backwards compability would turn out if VCL/PHP adopt namespaces.</p>
<p style="margin-bottom: 0in">What I miss in the feedback I got from my previous post was people acually using VCL/PHP for enterprise applications and how that is working. From what I can tell the usage of Exceptions is still limited to the 3<sup>rd</sup> party libs such as Zend Framework which are included with VCL/PHP. That&#8217;s a bit interesting.</p>
<p style="margin-bottom: 0in">I&#8217;d like to touch on the comment made by <cite>Pieter Viljoen</cite><cite><span style="font-style: normal"> for <a href="http://blog.eirikhoem.net/index.php/2007/09/14/why-delphi-for-php-should-have-used-prado-instead-of-vcl/">my original post</a>. I agree that Codegear pushed quite a toolset for the PHP community in a short time, but the underlying code is not enterprise quality. One can argue that PHP is ugly and flawed (not sure I agree on that part), but that does not mean that one should not strive for good architecture and methodology when developing frameworks on top of PHP. I see  the point that VCL/PJP offers features that are interesting for starting PHP developers, but for large scale applications I just don&#8217;t see it. I&#8217;d be pretty cautious pulling in a framework without exception support if I was to create an application.</span></cite></p>
<p style="margin-bottom: 0in"><cite><span style="font-style: normal">Again, I&#8217;m really interested in some feedback from someone that actually has built applications with VCL/PHP.  </span></cite></p>
<p>I&#8217;ve also noticed that there is not much activity in the <a href="http://vcl4php.svn.sourceforge.net/viewvc/vcl4php/trunk/vcl/" onclick="javascript:pageTracker._trackPageview ('/outbound/vcl4php.svn.sourceforge.net');">VCL/PHP SVN repository</a>. Anyone know what&#8217;s going on there?</p>
<p><code><p>Technorati Tags: <a href="http://technorati.com/tag/PHP" rel="tag">PHP</a>, <a href="http://technorati.com/tag/Prado" rel="tag"> Prado</a>, <a href="http://technorati.com/tag/VCL4PHP" rel="tag"> VCL4PHP</a></p>                                       </code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2008/08/26/vclphp-followup/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Comments moved from old blog</title>
		<link>http://blog.eirikhoem.net/index.php/2008/08/26/comments-moved-from-old-blog/</link>
		<comments>http://blog.eirikhoem.net/index.php/2008/08/26/comments-moved-from-old-blog/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 08:13:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/08/26/comments-moved-from-old-blog/</guid>
		<description><![CDATA[If some of you recently got email saying you just made a comment here, it&#8217;s most likely due to that I moved some comments over from my old blog (http://eirikhoem.wordpress.com/). I&#8217;ll get around to answering any questions later today. Thanks for commenting!
]]></description>
			<content:encoded><![CDATA[<p>If some of you recently got email saying you just made a comment here, it&#8217;s most likely due to that I moved some comments over from my old blog (http://eirikhoem.wordpress.com/). I&#8217;ll get around to answering any questions later today. Thanks for commenting!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2008/08/26/comments-moved-from-old-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple config management for PHP</title>
		<link>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/</link>
		<comments>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/#comments</comments>
		<pubDate>Fri, 30 May 2008 07:30:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/</guid>
		<description><![CDATA[When doing complex applications it&#8217;s often nice to have some sort of system for handling settings. PHP has a nice function called parse_ini_file which can be used to create a basic but still usable setting file feature. A simple class which loads the configuration file and offers some methods to retrieve the values for a [...]]]></description>
			<content:encoded><![CDATA[<p>When doing complex applications it&#8217;s often nice to have some sort of system for handling settings. PHP has a nice function called <a href="http://no2.php.net/parse_ini_file" onclick="javascript:pageTracker._trackPageview ('/outbound/no2.php.net');">parse_ini_file</a> which can be used to create a basic but still usable setting file feature. A simple class which loads the configuration file and offers some methods to retrieve the values for a given key is all that&#8217;s needed. The example I&#8217;m providing is pretty basic, but it&#8217;s still very usable and can be added to almost any application.</p>
<p>First, we need to create a file to hold the settings. It&#8217;s ordinary plaintext and follows the INI format.</p>
<p><strong> Here is a quick sample of some key / value pairs:</strong></p>
<p>[general]<br />
locale = no_NO<br />
company.name = MyCompany</p>
<p>datasource.host = localhost<br />
datasource.database = mydb<br />
datasource.username = user<br />
datasource.password = 1234</p>
<p><strong>The class for accessing the file:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">class</span> MyConfigClass<span style="color: #66cc66;">&#123;</span>
  protected <span style="color: #0000ff;">$config</span>;
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">config</span> = <span style="color: #000066;">parse_ini_file</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'../conf/myapp.ini'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getConfig<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$key</span> = <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
      <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$key</span> !== <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066;">isset</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">config</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$key</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#123;</span>
          <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">config</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$key</span><span style="color: #66cc66;">&#93;</span>;
        <span style="color: #66cc66;">&#125;</span>
        <span style="color: #b1b100;">else</span>
        <span style="color: #66cc66;">&#123;</span>
          throw <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Unknown key '$key' in configuration&quot;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
      <span style="color: #66cc66;">&#125;</span>
      <span style="color: #b1b100;">else</span>
      <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">config</span>;
      <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setConfig<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$config</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
&nbsp;
      <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">config</span> = <span style="color: #0000ff;">$config</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Usage:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php"><span style="color: #0000ff;">$configManager</span> = <span style="color: #000000; font-weight: bold;">new</span> MyConfigClass<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$value</span> = <span style="color: #0000ff;">$configManager</span>-&gt;<span style="color: #006600;">getConfig</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'datasource.host'</span><span style="color: #66cc66;">&#93;</span>;</pre></td></tr></table></div>

<p>Now, when working on larger application one usually have a application like class, and that&#8217;s a nice place to put this code. When using Prado I usually place the config code in the TApplication class.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/PHP" rel="tag">PHP</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Handy online regex tool for PHP, Perl, JS and Python</title>
		<link>http://blog.eirikhoem.net/index.php/2008/04/29/handy-online-regex-tool-for-php-perl-js-and-python/</link>
		<comments>http://blog.eirikhoem.net/index.php/2008/04/29/handy-online-regex-tool-for-php-perl-js-and-python/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 10:32:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/04/29/handy-online-regex-tool-for-php-perl-js-and-python/</guid>
		<description><![CDATA[



A coworker of mine has been working on a ajax enabled regex tool which lets you evaluate regex expressions in several languages (including PHP PCRE and PHP POSIX) with instant results. You can choose which functions to use, such as match, match all, replace, split etc. It also offers some basic help and hints. It&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-0056923567680782";
/* default */
google_ad_slot = "6546082201";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
A coworker of mine has been working on a ajax enabled regex tool which lets you evaluate regex expressions in several languages (including PHP PCRE and PHP POSIX) with instant results. You can choose which functions to use, such as match, match all, replace, split etc. It also offers some basic help and hints. It&#8217;s really handy when working on those painful expressions.</p>
<p>You can check it out at <a href="http://regex.larsolavtorvik.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/regex.larsolavtorvik.com');">http://regex.larsolavtorvik.com/</a>. Stop by <a href="http://larsolavtorvik.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/larsolavtorvik.com');">his blog</a> as well.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/PHP" rel="tag">PHP</a>, <a href="http://technorati.com/tag/Perl" rel="tag">Perl</a>, <a href="http://technorati.com/tag/JavaScript" rel="tag">JavaScript</a>, <a href="http://technorati.com/tag/Python" rel="tag">Python</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2008/04/29/handy-online-regex-tool-for-php-perl-js-and-python/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Populate PDF templates with PHP / FPDF / FPDI</title>
		<link>http://blog.eirikhoem.net/index.php/2008/04/28/populate-pdf-templates-with-php-fpdf-fpdi/</link>
		<comments>http://blog.eirikhoem.net/index.php/2008/04/28/populate-pdf-templates-with-php-fpdf-fpdi/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 13:52:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/04/28/populate-pdf-templates-with-php-fpdf-fpdi/</guid>
		<description><![CDATA[
Ever wanted to generated PDF documents on the fly with PHP? Perhaps populate a standard contract with a customers name and address? FPDF and FPDI are two neat libraries which greatly helps when working with PDF files. FPDF is the main library for handling PDF files, while FPDI lets your import existing PDF documents into [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#shortadd--><br />
Ever wanted to generated PDF documents on the fly with PHP? Perhaps populate a standard contract with a customers name and address? FPDF and FPDI are two neat libraries which greatly helps when working with PDF files. FPDF is the main library for handling PDF files, while FPDI lets your import existing PDF documents into the FPDF documents. In the code sample I&#8217;ve prepared here I&#8217;m importing a PDF template document, writing some information to the document, then sending it to the &#8220;customer&#8221;. FPDF offers several neat ways to expose the generated document, such as a stream to the browser, a string, or just storing it to file. You can download <a href="http://blog.eirikhoem.net/wp-content/uploads/2008/04/pdf_sample.zip" title="PDF Sample code">PDF Sample code</a> to test it.</p>
<p>Be sure to head on over to the <a href="http://www.fpdf.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.fpdf.org');">FPDF site</a> and <a href="http://www.setasign.de/products/pdf-php-solutions/fpdi/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.setasign.de');">FPDI site</a> for more information on these two libs. <a href="http://blog.eirikhoem.net/wp-content/uploads/2008/04/pdf_sample.zip" title="PDF Sample code"></a></p>
<p><strong>Related posts:</strong><br />
<a href="http://blog.eirikhoem.net/index.php/2007/06/15/generated-pdfs-over-https-with-internet-explorer/">Generated PDFs over HTTPS with Internet Explorer</a></p>
<p>Technorati Tags: <a href="http://technorati.com/tag/PHP" rel="tag">PHP</a>, <a href="http://technorati.com/tag/PDF" rel="tag">PDF</a>, <a href="http://technorati.com/tag/Frameworks" rel="tag">Frameworks</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2008/04/28/populate-pdf-templates-with-php-fpdf-fpdi/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Google does a Selenium framework?</title>
		<link>http://blog.eirikhoem.net/index.php/2008/04/25/google-does-a-selenium-framework/</link>
		<comments>http://blog.eirikhoem.net/index.php/2008/04/25/google-does-a-selenium-framework/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 08:00:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/04/25/google-does-a-selenium-framework/</guid>
		<description><![CDATA[
I just came across this post by Mike Henke, where he writes about a presentation from the Google Automating Testing Conference. Google is working on a framework based on Selenium which they use internally. The post contains some interesting slides in addition to a presentation video.  I&#8217;ve embedded the video in this post for [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#shortadd--><br />
I just came across this post by <a href="http://henke.ws/machblog/index.cfm?event=showEntry&amp;entryId=6CE7497E-19B9-BA51-EE3B15FA0CAB9A2D" onclick="javascript:pageTracker._trackPageview ('/outbound/henke.ws');">Mike Henke</a>, where he writes about a presentation from the Google Automating Testing Conference. Google is working on a framework based on Selenium which they use internally. The post contains some interesting slides in addition to a presentation video.  I&#8217;ve embedded the video in this post for your convenience, but I suggest you give Mike a visit.</p>
<p><strong>Update: Video removed, please check the links above.</strong></p>
<p>Technorati Tags: <a href="http://technorati.com/tag/PHP" rel="tag">PHP</a>, <a href="http://technorati.com/tag/Testing" rel="tag">Testing</a>, <a href="http://technorati.com/tag/Frameworks" rel="tag">Frameworks</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2008/04/25/google-does-a-selenium-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
