<?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>Claus Witt &#187; php</title> <atom:link href="http://www.clauswitt.com/tag/php/feed/" rel="self" type="application/rss+xml" /><link>http://www.clauswitt.com</link> <description>software and web developer</description> <lastBuildDate>Thu, 24 Jun 2010 20:07:03 +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>Writing your own PHP Framework</title><link>http://www.clauswitt.com/writing-your-own-php-framework/</link> <comments>http://www.clauswitt.com/writing-your-own-php-framework/#comments</comments> <pubDate>Thu, 19 Mar 2009 06:30:07 +0000</pubDate> <dc:creator>Claus Witt</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[php]]></category><guid isPermaLink="false">http://www.clauswitt.com/?p=192</guid> <description><![CDATA[Writing your own PHP Framework, should you do it? While I worked at Wildside in Århus, Denmark, I wrote a MVC Framework for using in Typo3 extensions. The reason for this was that we were working on an application which required such a framework to structure the project to be as maintainable as possible without [...]]]></description> <content:encoded><![CDATA[<p>Writing your own PHP Framework, should you do it?</p><p>While I worked at <a href="http://www.wildside.dk/">Wildside in Århus, Denmark</a>, I wrote a MVC Framework for using in Typo3 extensions. The reason for this was that we were working on an application which required such a framework to structure the project to be as maintainable as possible without loosing performance. We started looking at different options, and none of them seemed right for the job, and most of them were either not usable in the context of Typo3, or not mature enough for production use.</p><p>When the project started there was a tight coupling to Typo3 since the application was pretty much just an extension to the website.</p><p>Since then a lot have changed, and I am now working directly for the client, who was a customer of my old company 9iA as well. The system is now more of a standalone web application and the requirements of the framework has changed many times since its first version in may last year.</p><p>The framework is, however still tight coupled to Typo3, but Typo3 is pretty much only used for templating and authentication.</p><p>In the last year and a half I have worked with a lot of php frameworks &#8211; saying that I have used all of them is off course an exaggeration, but I have been using most of the top ones in some way or the other. And not one of them work in exactly the way I would want them to.</p><p>Now I am wondering wether to rewrite my mvc framework to be standalone. It would not demand more than 30-50 hours of work to do that, and on top of that be able to integrate <a href="http://framework.zend.com/manual/en/">Zend Frameworks Components</a> and an existing ORM like perhaps <a href="http://www.doctrine-project.org/">Doctrine</a>.</p><p>The other possibility is to rewrite the application to use an existing well tested framework. If Flow3 had been ready for production (and working in php 5.2.x) that would probably had been the case. But now I&#8217;m just not sure.</p><p>No mather what we decide to do, the current version will go live without any kind of rewrite. But the learning experience from <a href="http://anantgarg.com/2009/03/13/write-your-own-php-mvc-framework-part-1/">writing your own PHP MVC Framework</a> might be nice to gain, at some point &#8211; even though most of it is written allready.</p><p>What would you do? And if you would use an existing framework &#8211; which one would you recommend?</p><p>Btw, no mather what we choose to do, the framework will be released to the public as soon as all bugs that I have found have been fixed, and some basic documentation have been written.</p> ]]></content:encoded> <wfw:commentRss>http://www.clauswitt.com/writing-your-own-php-framework/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>10 Principles of the PHP Masters</title><link>http://www.clauswitt.com/10-principles-of-the-php-masters/</link> <comments>http://www.clauswitt.com/10-principles-of-the-php-masters/#comments</comments> <pubDate>Tue, 17 Mar 2009 06:30:09 +0000</pubDate> <dc:creator>Claus Witt</dc:creator> <category><![CDATA[Web development]]></category> <category><![CDATA[php]]></category><guid isPermaLink="false">http://www.clauswitt.com/?p=188</guid> <description><![CDATA[I found an article about 10 principles of the php masters. There is an interesting thing about the list however. Number 7 and 8 on the list will be impossible to follow at the same time for example. The list is as follows:Use PHP Only When You Need it &#8211; Rasmus Lerdorf Use Many Tables [...]]]></description> <content:encoded><![CDATA[<p>I found an article about <a href="http://net.tutsplus.com/articles/10-principles-of-the-php-masters/">10 principles of the php masters</a>. There is an interesting thing about the list however. Number 7 and 8 on the list will be impossible to follow at the same time for example.</p><p>The list is as follows:</p><ul><li>Use PHP Only When You Need it &#8211; Rasmus Lerdorf</li><li>Use Many Tables With PHP and MYSQL for Scalability &#8211; Matt Mullenweg</li><li>Never, ever trust your users &#8211; Dave Child</li><li>Invest in PHP Caching &#8211; Ben Balbo</li><li>Speed up PHP Development with an IDE, Templates and Snippets &#8211; Chad Kieffer</li><li>Make Better Use of PHP&#8217;s Filter Functions &#8211; Joey Sochacki</li><li>Use a PHP Framework &#8211; Josh Sharp</li><li>Don&#8217;t use a PHP Framework &#8211; Rasmus Lerdorf</li><li>Use Batch Processing &#8211; Jack D. Herrington</li><li>Turn on Error Reporting Immediately &#8211; David Cummings</li></ul><p>Take a look at <a href="http://net.tutsplus.com/articles/10-principles-of-the-php-masters/">the original post</a> to get an explanation of each of the statements.</p> ]]></content:encoded> <wfw:commentRss>http://www.clauswitt.com/10-principles-of-the-php-masters/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>SSO For Webapplications</title><link>http://www.clauswitt.com/sso-for-webapplications/</link> <comments>http://www.clauswitt.com/sso-for-webapplications/#comments</comments> <pubDate>Mon, 09 Mar 2009 06:30:35 +0000</pubDate> <dc:creator>Claus Witt</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Web development]]></category> <category><![CDATA[cas]]></category> <category><![CDATA[ideas]]></category> <category><![CDATA[php]]></category> <category><![CDATA[sso]]></category><guid isPermaLink="false">http://www.clauswitt.com/?p=130</guid> <description><![CDATA[As I have talked about several times, I am planning several saas projects in the future. The amount of ideas vastly surpasses the amount of time available to create these projects, but one of the things I can do until I (and possibly a small team of other people) decide to actually do any concrete [...]]]></description> <content:encoded><![CDATA[<p>As I have talked about several times, I am planning several saas projects in the future. The amount of ideas vastly surpasses the amount of time available to create these projects, but one of the things I can do until I (and possibly a small team of other people) decide to actually do any concrete work is to collect some methods of doing things that all apps will have to have. One of these are SSO. We would definitely like all our applications to share some kind of login information, and probably other information as well, when the time is right. Applications should in my opinion be as integrated as possible with shared api conventions, shared user-schemes and possibly even shared design and workflow elements. I personally hate it when a company releases several webapplications and I nothing in application A looks/seems/works like anything in application B. It should be &#8211; at least in my head &#8211; simple to do some kind of shared vision of the app&#8217;s.</p><p>A long text for post a link. But here goes. I found a post about <a href="http://mattfleming.com/node/297">how to create SSO for webapplications</a>. I have earlier looked at <a href="http://www.jasig.org/cas">CAS for SSO</a> and that looks like a good implementation. But I guess some experimentation is in order. More on this later&#8230;</p> ]]></content:encoded> <wfw:commentRss>http://www.clauswitt.com/sso-for-webapplications/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Persistent Key-Value Object Storage with MemcacheDB</title><link>http://www.clauswitt.com/persistent-key-value-object-storage-with-memcachedb/</link> <comments>http://www.clauswitt.com/persistent-key-value-object-storage-with-memcachedb/#comments</comments> <pubDate>Sat, 07 Mar 2009 08:30:14 +0000</pubDate> <dc:creator>Claus Witt</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Web development]]></category> <category><![CDATA[caching]]></category> <category><![CDATA[memcached]]></category> <category><![CDATA[php]]></category><guid isPermaLink="false">http://www.clauswitt.com/?p=143</guid> <description><![CDATA[While looking at a post about using memcache for a simple message queue, which by the way sounds very interesting in its own right. I once again found a link to the MemcacheDB project. They have made memcache persistent. It is some sort of and intermediate between regular memcached and a database. I can think [...]]]></description> <content:encoded><![CDATA[<p>While looking at a post about <a href="http://3.rdrail.net/blog/memcached-based-message-queues/">using memcache for a simple message queue</a>, which by the way sounds very interesting in its own right. I once again found a link to the <a href="http://memcachedb.org/">MemcacheDB project</a>. They have made memcache persistent. It is some sort of and intermediate between regular memcached and a database. I can think of several scenarios where memcachedb would be useful. One that comes to mind is persistent storage of user- og and settings- objects in the system that I am currently working on, for <a href="http://www.voicearchive.com/">Voicearchive.com</a>.</p> ]]></content:encoded> <wfw:commentRss>http://www.clauswitt.com/persistent-key-value-object-storage-with-memcachedb/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>ASP2PHP</title><link>http://www.clauswitt.com/asp2php/</link> <comments>http://www.clauswitt.com/asp2php/#comments</comments> <pubDate>Fri, 06 Mar 2009 21:41:26 +0000</pubDate> <dc:creator>Claus Witt</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Just for fun]]></category> <category><![CDATA[Web development]]></category> <category><![CDATA[asp]]></category> <category><![CDATA[links]]></category> <category><![CDATA[php]]></category><guid isPermaLink="false">http://www.clauswitt.com/?p=128</guid> <description><![CDATA[I haven&#8217;t tried it (yet), and it&#8217;s probably not something that a lot of people would find that interesting/useful. But I just found an open source ASP 2 PHP compiler, which will take any asp page (written in vbscript) and create a corresponding php page. Sounds fun. If only I had some of my asp [...]]]></description> <content:encoded><![CDATA[<p>I haven&#8217;t tried it (yet), and it&#8217;s probably not something that a lot of people would find that interesting/useful. But I just found an open source <a href="http://asp2php.naken.cc/">ASP 2 PHP compiler</a>, which will take any asp page (written in vbscript) and create a corresponding php page. Sounds fun. If only I had some of my asp based projects from 2001/2002 lying around somewhere&#8230; But that would require me to go back in time, and tell my self to make backups.</p> ]]></content:encoded> <wfw:commentRss>http://www.clauswitt.com/asp2php/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Memcached Boosts Performance</title><link>http://www.clauswitt.com/memcached-boosts-performance/</link> <comments>http://www.clauswitt.com/memcached-boosts-performance/#comments</comments> <pubDate>Mon, 02 Mar 2009 15:09:40 +0000</pubDate> <dc:creator>Claus Witt</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Web development]]></category> <category><![CDATA[memcached]]></category> <category><![CDATA[php]]></category> <category><![CDATA[typo3]]></category> <category><![CDATA[web]]></category><guid isPermaLink="false">http://www.clauswitt.com/?p=116</guid> <description><![CDATA[For a while we have worked on making our website at work more responsive. We have a lot of visitors looking for voice over talents, and since we primarily do business across the web, mainly through our website, it is important to us that it is as responsive as possible. Apart from the classic guidelines [...]]]></description> <content:encoded><![CDATA[<p>For a while we have worked on making our website at work more responsive. We have a lot of visitors looking for <a href="http://www.voicearchive.com/" title="Voice Over Talents">voice over talents</a>, and since we primarily do business across the web, mainly through our website, it is important to us that it is as responsive as possible. Apart from the classic guidelines you always hear when running a website, we have experimented with a hacked version of Typo3 to  enable the use of Memcached as a page cache.</p><p>And as I suspected, performance was highly impacted by this. Through all our optimizations we have reduced the load time of the page to an absolut minimal. Next we will look at ways to reduce the amount of javascript needed for some of our features.</p> ]]></content:encoded> <wfw:commentRss>http://www.clauswitt.com/memcached-boosts-performance/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Upload Progress Bar using Php and Dojo</title><link>http://www.clauswitt.com/upload-progress-bar-using-php-and-dojo/</link> <comments>http://www.clauswitt.com/upload-progress-bar-using-php-and-dojo/#comments</comments> <pubDate>Wed, 25 Feb 2009 12:00:56 +0000</pubDate> <dc:creator>Claus Witt</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Web development]]></category> <category><![CDATA[dojo]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[php]]></category><guid isPermaLink="false">http://www.clauswitt.com/?p=101</guid> <description><![CDATA[For a long time I have wanted my applications to have progress bars on uploads, but I have always thought that this was impossible when the server language was php. Unless of course you wanted to do some mixing of languages, and handle the upload via perl. I, however, wanted complete integration of the code, [...]]]></description> <content:encoded><![CDATA[<p>For a long time I have wanted my applications to have progress bars on uploads, but I have always thought that this was impossible when the server language was php. Unless of course you wanted to do some mixing of languages, and <a href="http://www.raditha.com/php/progress.php" target="_blank">handle the upload via perl</a>. I, however, wanted complete integration of the code, and wanted my mvc framework to be able to output the wanted information. A while ago my boss at <a title="VoiceArchive.com - the internet voice talent agency" href="http://www.voicearchive.com" target="_blank">Voicearchive</a> asked me if we could get a progress bar for uploads on the system that we are developing. Once again I found myself searching for possible solutions.</p><p>This time around, however, I found what I was looking for. I found an article about <a title="HOWTO: PHP and jQuery upload progress bar" href="http://t.wits.sg/2008/06/25/howto-php-and-jquery-upload-progress-bar/" target="_blank">PHP and jQuery upload progress bar</a>. In this article I learned about the <a title="pecl package uploadprogress" href="http://pecl.php.net/package/uploadprogress">PECL extension uploadprogress</a>. I began trying to make this solution work.</p><p>First thing, was that I found the extension did not work as I wanted. After a while I found that installing newest version, required installing it via &#8220;pecl install channel://pecl.php.net/uploadprogress-0.9.2&#8243; &#8211; which gave me the latest beta release of the extension. Now it returned the correct information when I uploaded a file.</p><p>The solution consists of 5 parts.</p><ol><li>The Pecl extension</li><li>The form</li><li>The progressbar widget</li><li>The javascript</li><li>and the controller which sends the data from uploadprogress as json to the client</li></ol><p>After the installation was managed, I changed the form to have the required hidden UPLOAD_IDENTIFIER value included.</p><pre name="code" class="xhtml">
<input id="addFileProgressKey" name="UPLOAD_IDENTIFIER" type="hidden" value="" />
</pre><p>The value of the field is set when the dialogbox containing the upload form is revealed, and saved in a variable, that can be used when the script needs to poll for the result.</p><pre name="code" class="javascript">
lastFileProgressKey = guid();
console.log(lastFileProgressKey);
dojo.byId('addFileProgressKey').value = lastFileProgressKey;
dijit.byId('addFileDialog').show();
</pre><p>The guid function is just a simple function which generates a guid-like random string. The value is then set to the form, and the dialog is revealed.</p><p>When the upload button on the form is pressed it calls a event handler which handles the actual upload. Before the upload is started however the following function is called.</p><pre name="code" class="javascript">
startUploadCheck(lastFileProgressKey);
</pre><p>These function do the actual work.</p><pre name="code" class="javascript">
function updateProgressBar(response) {
	if(response) {
		totalBytes = parseInt(response.bytes_total);
		uploadedBytes = parseInt(response.bytes_uploaded);
		percentage = Math.floor(100 * uploadedBytes/ totalBytes);
		uploadProgressBar.update({ progress: percentage+'%'});
		if(lastUploadId!='') {
			setTimeout("checkUpload()", 1000);
		}
	} else {
		if(lastUploadId!='') {
			setTimeout("checkUpload()", 1000);
		}
	}
}

function checkUpload() {
	dojo.xhrGet( {
		url :'/uploadprogress/check?uploadid='+lastUploadId,
		handleAs: 'json',
		preventCache: true,
		load: updateProgressBar,
		error: function(data) {
			if(lastUploadId!='') {
				setTimeout("checkUpload()", 1000);
			}
		}
	});
}

function startUploadCheck(uploadid) {
	dijit.byId('uploadProgressDialog').show();
	lastUploadId = uploadid;
	checkUpload( uploadid );
}

function hideProgressDialog() {
	lastUploadId = '';
	dijit.byId('uploadProgressDialog').hide();
}
</pre><p>The dojo widget used is the <a href="http://www.dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/user-assistance-and-feedback/progress-bar" target="_blank" title="Dojo ProgressBar">ProgressBar</a>.</p><p>The controller is the simplest part of the equation.</p><pre name="code" class="php">
public function check() {
    $formUploadId = $this->request['uploadid'];
    return json_encode(uploadprogress_get_info($formUploadId));
}
</pre><p>All the legwork is done by uploadprogress_get_info, which then is passed through json_encode.</p> ]]></content:encoded> <wfw:commentRss>http://www.clauswitt.com/upload-progress-bar-using-php-and-dojo/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Continuous Integration with Xinc</title><link>http://www.clauswitt.com/continuous-integration-with-xinc/</link> <comments>http://www.clauswitt.com/continuous-integration-with-xinc/#comments</comments> <pubDate>Mon, 23 Feb 2009 06:30:57 +0000</pubDate> <dc:creator>Claus Witt</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Web development]]></category> <category><![CDATA[ci]]></category> <category><![CDATA[phing]]></category> <category><![CDATA[php]]></category> <category><![CDATA[xinc]]></category><guid isPermaLink="false">http://www.clauswitt.com/?p=54</guid> <description><![CDATA[At my company Arnsbo Media, responsible for one of the largest archive of voiceover talents in the world, we use Xinc for Continuous Integration. Every five minutes the CI server checks if there has been updates to the trunk of each of our software projects. If this is the case it runs the phing buildscript [...]]]></description> <content:encoded><![CDATA[<p>At my company Arnsbo Media, responsible for one of <a title="The Internet Voice Talent Agency" href="http://www.voicearchive.com/" target="_blank">the largest archive of voiceover talents</a> in the world, we use <a title="Xinc Continous Integration" href="http://code.google.com/p/xinc/" target="_blank">Xinc</a> for Continuous Integration. Every five minutes the CI server checks if there has been updates to the trunk of each of our software projects. If this is the case it runs the <a title="Phing" href="http://phing.info/trac/" target="_blank">phing buildscript</a> which is responsible for updating the svn checkout, checking the source with a codesniffer, creating documentation and running all tests. If all is ok, Xinc is happy, and the latest version of the given software is ready as a zip file, documentation is ready for browsing. If anything fails a mail will be sent to notify everyone involved in the project.</p> ]]></content:encoded> <wfw:commentRss>http://www.clauswitt.com/continuous-integration-with-xinc/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Flow3 on Mac OS X</title><link>http://www.clauswitt.com/flow3-on-mac-os-x/</link> <comments>http://www.clauswitt.com/flow3-on-mac-os-x/#comments</comments> <pubDate>Sat, 21 Feb 2009 01:03:49 +0000</pubDate> <dc:creator>Claus Witt</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Web development]]></category> <category><![CDATA[flow3]]></category> <category><![CDATA[links]]></category> <category><![CDATA[mac]]></category> <category><![CDATA[php]]></category><guid isPermaLink="false">http://www.clauswitt.com/?p=33</guid> <description><![CDATA[t3blog.de has a post (in German) about installing php 5.3 (required for Flow3) on a Mac OS X installation with MacPorts. ]]></description> <content:encoded><![CDATA[<p><a title="Howto install FLOW3 on Mac OS X 10.5 (MacPorts)" href="http://t3blog.de/2008/12/14/flow3-auf-mac-os-x-105-installieren-macports/" target="_blank">t3blog.de has a post (in German) about installing php 5.3 (required for Flow3) on a Mac OS X installation with MacPorts. </a></p> ]]></content:encoded> <wfw:commentRss>http://www.clauswitt.com/flow3-on-mac-os-x/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached (user agent is rejected)
Database Caching using memcached

Served from: www.clauswitt.com @ 2010-07-30 04:21:29 -->