<?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>From Accessibility to Zope &#187; PHP</title>
	<atom:link href="http://blog.mauveweb.co.uk/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mauveweb.co.uk</link>
	<description>experiments in contemporary web development</description>
	<lastBuildDate>Thu, 18 Aug 2011 23:26:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP4 is dead. Long live PHP4!</title>
		<link>http://blog.mauveweb.co.uk/2007/08/03/php4-is-dead-long-live-php4/</link>
		<comments>http://blog.mauveweb.co.uk/2007/08/03/php4-is-dead-long-live-php4/#comments</comments>
		<pubDate>Fri, 03 Aug 2007 10:50:19 +0000</pubDate>
		<dc:creator>mauve</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.mauveweb.co.uk/2007/08/03/php4-is-dead-long-live-php4/</guid>
		<description><![CDATA[PHP4 is apparently going to be supported only until the end of the year. The idea is to push developers towards PHP5. Matt Mullenweg notes that PHP4 is adequate for a lot of developers, but also claims that PHP5 adoption is poor because PHP5 hasn't been marketed properly to developers. I don't believe this. PHP5 [...]]]></description>
			<content:encoded><![CDATA[<p>PHP4 is apparently going to be supported only until the end of the year. The idea is to push developers towards PHP5. Matt Mullenweg notes that <a href="http://photomatt.net/2007/07/13/on-php/">PHP4 is adequate for a lot of developers</a>, but also claims that PHP5 adoption is poor because PHP5 hasn't been marketed properly to developers. I don't believe this. PHP5 is patently a better language, resolving the single most dreadful language problem that PHP4 exhibits: object copying on reference. Expert developers know this, amateur developers are unaware of the problem and use PHP5 with a kind of religious zealotry.</p>
<p>This migration poses a particular challenge. Rarely does a language change so drastically without offering a simple migration strategy. Vast amounts of legacy code simply don't work on PHP5. mod_php4 and mod_php5 don't run in the same Apache instance so it's not trivial to configure a box to serve some sites with PHP4 and some with PHP5. There is no solution that does not require a lot of sysadmin work setting up proxies, or even virtual machines, and of course, this is not the kind of thing distros do out of the box.</p>
<p><acronym title="PHP: Hypertext Preprocessor">PHP</acronym> developers seem lacking in conscientiousness about the community they are supporting, as attested by this quote from the<a href="http://www.php.net/manual/en/migration5.php"> PHP4 to 5 migration documentation</a>:</p>
<blockquote><p>Many <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> programmers aren't even aware of the copying quirks of the old  object model and, therefore, the majority of <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> applications will work out of the box, or with very few modifications.</p></blockquote>
<p>In fact, that entire subsection of the documentation carries the tone that compatibility problems are inconsequential. I think it's telling that the <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> documentation can't produce a complete list of <a href="http://www.php.net/manual/en/reserved.php">reserved keywords</a>. As the user-submitted comments note, there are at least half a dozen missing from the list.</p>
<p>I've also discovered that PHP4  is simply not available for Ubuntu Feisty. While I can understand that there is a genuine desire to move the PHPosphere forward, it's incredibly dumb to gauge whether people are ready to ditch PHP4 by looking at supported, off-the-shelf web applications, rather than considering the volume of cheap legacy applications. Many people simply need both.</p>
<p>For myself, I'm happy to carry out the migration, but it's annoying that it's been handled so badly that my job in doing so is so very much harder. Hard enough that I've already put it off for years.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.mauveweb.co.uk/2007/08/03/php4-is-dead-long-live-php4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Superclass constructor</title>
		<link>http://blog.mauveweb.co.uk/2007/06/11/php-superclass-constructor/</link>
		<comments>http://blog.mauveweb.co.uk/2007/06/11/php-superclass-constructor/#comments</comments>
		<pubDate>Mon, 11 Jun 2007 10:32:20 +0000</pubDate>
		<dc:creator>mauve</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.mauveweb.co.uk/2007/06/11/php-superclass-constructor/</guid>
		<description><![CDATA[I have just found this expression in some PHP code I wrote around two years ago:

// Call the constructor of the parent class
$this->{get_parent_class(__CLASS__)}();

I've never seen this syntax before, and I couldn't find any reference to it in the PHP documentation. The closest I found was a brief mention that curly brackets could be used to [...]]]></description>
			<content:encoded><![CDATA[<p>I have just found this expression in some <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> code I wrote around two years ago:</p>
<pre lang="php">
// Call the constructor of the parent class
$this->{get_parent_class(__CLASS__)}();
</pre>
<p>I've never seen this syntax before, and I couldn't find any reference to it in the <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> documentation. The closest I found was a brief mention that curly brackets could be used to resolve ambiguity in expressions like <code>$<span style="color: #66cc66;">&#123;</span><span style="color: #0000ff;">$a</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span></code>. I have probably pasted it from somewhere after taking a dislike to some of the other ways of calling the superclass constructor (which must be done explicitly in <acronym title="PHP: Hypertext Preprocessor">PHP</acronym>).</p>
<p>This looks like it might be useful in a variety of situations, except that I'm reluctant to use what is, AFAICT, undocumented syntax.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.mauveweb.co.uk/2007/06/11/php-superclass-constructor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Gotcha</title>
		<link>http://blog.mauveweb.co.uk/2007/01/30/php-gotcha/</link>
		<comments>http://blog.mauveweb.co.uk/2007/01/30/php-gotcha/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 00:56:39 +0000</pubDate>
		<dc:creator>mauve</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.mauveweb.co.uk/2007/01/30/php-gotcha/</guid>
		<description><![CDATA[While it has become quite common practice for me to berate PHP, I really never imagined I would come across actual rock-solid evidence that PHP is just one big practical joke the Zend people are playing on me. Noel Edmonds is probably hiding somewhere waiting to pop out and present a trophy, and then pour [...]]]></description>
			<content:encoded><![CDATA[<p>While it has become quite common practice for me to berate <acronym title="PHP: Hypertext Preprocessor">PHP</acronym>, I really never imagined I would come across <strong>actual rock-solid evidence</strong> that <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> is just one big practical joke the Zend people are playing on me. Noel Edmonds is probably hiding somewhere waiting to pop out and present a trophy, and then pour gunge all over all <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> developers and just generally be weird.</p>
<p>You know <strong>classes</strong>, right? Those things which are, by definition, not <code><span style="color: #000000; font-weight: bold;">null</span></code>? That are in fact, the exact opposite of <code><span style="color: #000000; font-weight: bold;">null</span></code>?</p>
<pre><code><span style="color: #000000; font-weight: bold;">&lt;?php</span>

<span style="color: #000000; font-weight: bold;">class</span> TestCls <span style="color: #66cc66;">&#123;</span> <span style="color: #66cc66;">&#125;</span>;

<span style="color: #0000ff;">$a</span> = <span style="color: #000000; font-weight: bold;">new</span> TestCls<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;

<a href="http://www.php.net/print"><span style="color: #000066;">print</span></a> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$a</span> == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> ? <span style="color: #ff0000;">'null'</span>: <span style="color: #ff0000;">'not null'</span>;

<span style="color: #000000; font-weight: bold;">?&gt;</span></code></pre>
<p>Guess. Go on. I'll give you one guess what <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> prints.</p>
<p>Yes, I know it works if I use a === rather than an ==. But that doesn't mean the == behaviour isn't sick and wrong.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.mauveweb.co.uk/2007/01/30/php-gotcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Burning SQL bras</title>
		<link>http://blog.mauveweb.co.uk/2007/01/25/burning-sql-bras/</link>
		<comments>http://blog.mauveweb.co.uk/2007/01/25/burning-sql-bras/#comments</comments>
		<pubDate>Thu, 25 Jan 2007 01:52:45 +0000</pubDate>
		<dc:creator>mauve</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[RDF]]></category>

		<guid isPermaLink="false">http://blog.mauveweb.co.uk/2007/01/25/burning-sql-bras/</guid>
		<description><![CDATA[RDF makes me feel so liberated now that I've actually got it all up and running! Storing data in a freeform RDF graph is so easy when you don't have to worry about setting up tables or writing queries or anything. Add an arc, remove an arc. It's that simple.
Liberation is not enough of an [...]]]></description>
			<content:encoded><![CDATA[<p><acronym title="Resource Description Framework">RDF</acronym> makes me feel so liberated now that I've actually got it all up and running! Storing data in a freeform <acronym title="Resource Description Framework">RDF</acronym> graph is so easy when you don't have to worry about setting up tables or writing queries or anything. Add an arc, remove an arc. It's that simple.</p>
<p>Liberation is not enough of an incentive on its own, perhaps, but the fact that your web applications are trivially Semantic Web-ready when using an <acronym title="Resource Description Framework">RDF</acronym> database means that this is definitely the way I will be writing web applications from now on! (Subject to caveats about speed and optimisation and legacy code and pure appropriateness).</p>
<p>In particular, I've been able to write a single, easy-to-use class that displays a configurable form, pre-filled from the model, and saves changes back to the model on submit. Code for this looks like this:</p>
<pre><code><span style="color: #0000ff;">$form</span>=<span style="color: #000000; font-weight: bold;">new</span> RDFForm<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$model</span>, <span style="color: #0000ff;">$me</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$form</span>-&gt;<span style="color: #006600;">setAction</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'profile.php?view=basics'</span><span style="color: #66cc66;">&#41;</span>;

<span style="color: #0000ff;">$form</span>-&gt;<span style="color: #006600;">addMultipleFieldMapping</span><span style="color: #66cc66;">&#40;</span>vocab<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'foaf:name'</span><span style="color: #66cc66;">&#41;</span>,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">new</span> StringLiteralProperty<span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/_"><span style="color: #000066;">_</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Name'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;

<span style="color: #0000ff;">$form</span>-&gt;<span style="color: #006600;">addFieldMapping</span><span style="color: #66cc66;">&#40;</span>vocab<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'foaf:title'</span><span style="color: #66cc66;">&#41;</span>,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">new</span> StringLiteralProperty<span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/_"><span style="color: #000066;">_</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Title'</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;

<span style="color: #0000ff;">$form</span>-&gt;<span style="color: #006600;">addFieldMapping</span><span style="color: #66cc66;">&#40;</span>vocab<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'foaf:givenName'</span><span style="color: #66cc66;">&#41;</span>,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> StringLiteralProperty<span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/_"><span style="color: #000066;">_</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'First Name'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;

<span style="color: #0000ff;">$form</span>-&gt;<span style="color: #006600;">addFieldMapping</span><span style="color: #66cc66;">&#40;</span>vocab<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'foaf:surname'</span><span style="color: #66cc66;">&#41;</span>,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> StringLiteralProperty<span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/_"><span style="color: #000066;">_</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Surname'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;

<span style="color: #0000ff;">$form</span>-&gt;<span style="color: #006600;">addMultipleFieldMapping</span><span style="color: #66cc66;">&#40;</span>vocab<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'foaf:nick'</span><span style="color: #66cc66;">&#41;</span>,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> StringLiteralProperty<span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/_"><span style="color: #000066;">_</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Nickname'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;

<span style="color: #0000ff;">$gender</span>=<span style="color: #000000; font-weight: bold;">new</span> LiteralEnumProperty<span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/_"><span style="color: #000066;">_</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Gender'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$gender</span>-&gt;<span style="color: #006600;">addOption</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'male'</span>, _<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Male'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$gender</span>-&gt;<span style="color: #006600;">addOption</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'female'</span>, _<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Female'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$form</span>-&gt;<span style="color: #006600;">addFieldMapping</span><span style="color: #66cc66;">&#40;</span>vocab<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'foaf:gender'</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #0000ff;">$gender</span><span style="color: #66cc66;">&#41;</span>;

<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #000066;">isset</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_POST</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'save'</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>
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$form</span>-&gt;<span style="color: #006600;">updateModel</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>

<span style="color: #0000ff;">$form</span>-&gt;<span style="color: #006600;">render</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</code></pre>
<p>Of course, this is possible with relational databases too given enough layers of wrappers, but this approach makes it trivial to<br />
implement new fields and new field types. Here is a screenshot of how this appears on the page.</p>
<p><a href="http://blog.mauveweb.co.uk/wp-content/uploads/2007/01/rdfform.jpg" title="RDF Form Screenshot"><img src="http://blog.mauveweb.co.uk/wp-content/uploads/2007/01/rdfform.thumbnail.jpg" alt="RDF Form Screenshot" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mauveweb.co.uk/2007/01/25/burning-sql-bras/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP4 must die</title>
		<link>http://blog.mauveweb.co.uk/2007/01/09/php4-must-die/</link>
		<comments>http://blog.mauveweb.co.uk/2007/01/09/php4-must-die/#comments</comments>
		<pubDate>Tue, 09 Jan 2007 00:19:45 +0000</pubDate>
		<dc:creator>mauve</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.mauveweb.co.uk/2007/01/09/php4-must-die/</guid>
		<description><![CDATA[Sitting down this evening to code some PHP from scratch after a couple of months of working exclusively in Python, I am stunned to realise how bad plain PHP (PHP4, we're talking about) is. The shop code provides a fairly comprehensive framework on top of standard PHP, wrapping database, output and error handling. Without it, [...]]]></description>
			<content:encoded><![CDATA[<p>Sitting down this evening to code some <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> from scratch after a couple of months of working exclusively in Python, I am stunned to realise how bad plain <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> (PHP4, we're talking about) is. The shop code provides a fairly comprehensive framework on top of standard <acronym title="PHP: Hypertext Preprocessor">PHP</acronym>, wrapping database, output and error handling. Without it, <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> is so much more dreadful than I remember.</p>
<p>I'm actually amazed that <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> doesn't print a stack trace when there's an error. You're clearly not supposed to write <em>functions</em>.</p>
<p>Perhaps I will make the jump to PHP5. There are compatibility issues even now, but maybe it's simply time.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.mauveweb.co.uk/2007/01/09/php4-must-die/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web apps need scriptable interfaces</title>
		<link>http://blog.mauveweb.co.uk/2006/11/01/web-apps-need-scriptable-interfaces/</link>
		<comments>http://blog.mauveweb.co.uk/2006/11/01/web-apps-need-scriptable-interfaces/#comments</comments>
		<pubDate>Wed, 01 Nov 2006 00:59:06 +0000</pubDate>
		<dc:creator>mauve</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://blog.mauveweb.co.uk/2006/11/01/web-apps-need-scriptable-interfaces/</guid>
		<description><![CDATA[I was just working on a set of separate Joomla installations for a client today when I realised that I really needed to be able to run scripts against the different installations.
I was trying to install three different Mambots (one of Joomla's three different types of extensions) in about 8 installations of Joomla &#8211; each [...]]]></description>
			<content:encoded><![CDATA[<p>I was just working on a set of separate <a href="http://joomla.org/">Joomla</a> installations for a client today when I realised that I really needed to be able to run scripts against the different installations.</p>
<p>I was trying to install three different Mambots (one of Joomla's three different types of extensions) in about 8 installations of Joomla &#8211; each with different database configurations and paths, and having started out with a Bash script to merely copy the plugin files into place, I realised that because automating the whole operation would involve reading a configuration file in <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> syntax and performing some queries in MySQL with it, coding this would probably take longer than installing the plugins manually.</p>
<p>There are not very many web apps which have any kind of scriptable <acronym title="	Application Programming Interface">API</acronym>. In fact, I only really know of <a href="http://www.gnu.org/software/mailman/">Mailman</a>, which is only partly a web application. But it's a feature I've used frequently in Mailman &#8211; there is a script <code>bin/withlist</code> which acquires locks and opens the list, allows you to modify the list as a Python object, and saves it on exit. Mailman provides a few <acronym title="Command-Line Interface">CLI</acronym> tools too which can be used in scripting but which are really only trivial examples of the power of the scriptable <acronym title="	Application Programming Interface">API</acronym>.</p>
<p>When I began writing <a href="http://www.mauveinternet.co.uk/products.xml">Mailhammer</a>, my own announcement-only mailing list software, I took this scriptability even futher based on my positive experience with Mailman's scriptable <acronym title="	Application Programming Interface">API</acronym>. All of the working parts are implemented in Python, and the <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> is just an <acronym title="HyperText Markup Language">HTML</acronym> wrapper which opens and talks to a <acronym title="Command-Line Interface">CLI</acronym> Python script over pipes. This means that the <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> is kept extremely simple, and the Python core is a very clean and simple <acronym title="	Application Programming Interface">API</acronym>, and that the <acronym title="Command-Line Interface">CLI</acronym> can do everything reliably. It's a cleanly divided implementation of an <em>n</em>-tier architecture. In fact in practice, I only use the web interface for viewing the data already in the database. Consequently, that interface isn't very powerful &#8211; yet!</p>
<p>Python is well-suite for scriptable <acronym title="	Application Programming Interface">APIs</acronym> &#8211; its interactive interpreter and neat object model mean that it's easy to perform arbitrary operations interactively on complex, persistent data structures. In <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> web applications it might be more feasible to build an <acronym title="eXtensible Markup Language">XML</acronym>-<acronym title="Remote Procedure Call">RPC</acronym> interface of some kind and provide a command-line client.</p>
<p>I don't think that scriptability is considered as even a <em>potential</em> feature for almost any web application I've tried;  their operation is tied inextricably to their unique interfaces.</p>
<p>For anybody developing a new web application please ask yourself this: will administrators using your software want to be locked in to your pretty and easy-to-use interface, or will they end up cursing you for failing to provide them with power beyond what <acronym title="HyperText Markup Language">HTML</acronym> can provide?</p>]]></content:encoded>
			<wfw:commentRss>http://blog.mauveweb.co.uk/2006/11/01/web-apps-need-scriptable-interfaces/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>More PHP segfaults</title>
		<link>http://blog.mauveweb.co.uk/2006/10/16/more-php-segfaults/</link>
		<comments>http://blog.mauveweb.co.uk/2006/10/16/more-php-segfaults/#comments</comments>
		<pubDate>Mon, 16 Oct 2006 22:39:56 +0000</pubDate>
		<dc:creator>mauve</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.mauveweb.co.uk/2006/10/16/more-php-segfaults/</guid>
		<description><![CDATA[Another case of PHP segfaulting. This time, at least, it was behaving deterministically and by inserting
print &#34;Meep!&#34;;
flush&#40;&#41;;
throughout various bits of the code I managed to track down the problem. It was segfaulting trying to read a config file to which it didn't have read permissions.
PHP is bad.]]></description>
			<content:encoded><![CDATA[<p>Another case of <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> segfaulting. This time, at least, it was behaving deterministically and by inserting</p>
<p><code><a href="http://www.php.net/print"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;Meep!&quot;</span>;<br />
<a href="http://www.php.net/flush"><span style="color: #000066;">flush</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</code></p>
<p>throughout various bits of the code I managed to track down the problem. It was segfaulting trying to read a config file to which it didn't have read permissions.</p>
<p><acronym title="PHP: Hypertext Preprocessor">PHP</acronym> is bad.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.mauveweb.co.uk/2006/10/16/more-php-segfaults/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mauvesoft Gallery</title>
		<link>http://blog.mauveweb.co.uk/2006/09/20/mauvesoft-gallery/</link>
		<comments>http://blog.mauveweb.co.uk/2006/09/20/mauvesoft-gallery/#comments</comments>
		<pubDate>Wed, 20 Sep 2006 17:35:44 +0000</pubDate>
		<dc:creator>mauve</dc:creator>
				<category><![CDATA[Open-source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://blog.mauveweb.co.uk/?p=15</guid>
		<description><![CDATA[One of my old online friends, Twisted, messaged me this morning to say that he was having problems with his installation of Mauvesoft Gallery. He had reinstalled in on a new Ubuntu box but it was not thumbnailing properly: first it was not generating thumbnails; then, having fixed that, he found that it was not [...]]]></description>
			<content:encoded><![CDATA[<p>One of my old online friends, Twisted, messaged me this morning to say that he was having problems with his installation of <a href="http://www.mauvesoft.co.uk/scripts/">Mauvesoft Gallery</a>. He had reinstalled in on a new Ubuntu box but it was not thumbnailing properly: first it was not generating thumbnails; then, having fixed that, he found that it was not caching them.</p>
<p>Anyway, I tarballed up my unstable development version, 1.5, which adds a few features and fixes a few bugs.</p>
<p><strong>Changelog</strong></p>
<ul>
<li>Feature: <acronym title="PHP: Hypertext Preprocessor">PHP</acronym>-based templates</li>
<li>Feature: Watermarking of thumbnails</li>
<li>Feature: Images now support <acronym title="EXchangeable Image File">EXIF</acronym> captions and titles</li>
<li>Theme: New theme 'corporate'</li>
<li>Theme: 'slides' rewritten in <acronym title="eXtensible HyperText Markup Language">XHTML</acronym> and <acronym title="Cascading Style Sheets">CSS</acronym></li>
<li>Bug: Thumbnail transparent <acronym title="Portable Network Graphics">PNGs</acronym> with GD</li>
<li>Bug: .JPG extensions not considered images</li>
<li>Bug: Directory names containing '+' character</li>
<li>Bug: Imagemagick engine doesn't work with <acronym title="Cyan Magenta Yellow blacK">CMYK</acronym> <acronym title="Joint Photographic Experts Group Image">JPEGs</acronym></li>
</ul>
<p>He installed that and after a few permissions bugs, it's <a href="http://twisted.evangelion.nu/~twisted/gallery-1.5/">up and running</a>.</p>
<p>I suppose this makes it almost ready for an <acronym title="Release Candidate">RC</acronym>. The first alpha is already running on a site I did a couple of months ago for a client, <a href="http://test.photography2you.co.uk/">Photography2you</a>.</p>
<p>When I actually package this for release I'm going to use shar, which I am fairly confident I can use to configure the installation after it has unpacked. All webapps suffer from this installation problem, and there doesn't seem to be a generic solution for installing them, even though there is a very limited range of things that need to be configured to get them off the ground on a single-vhost basis. I can't imagine that it would be hard to write a package manager for them. Mauvesoft Gallery works on Windows and even <acronym title="Internet Information Services">IIS</acronym> too I believe (although I've not tested it recently), but Windows is much more lax on the permissions (although I've not tried Server 2003), so a normal <acronym title="PkZip Archive">ZIP</acronym> file may suffice.</p>
<p>It also occurs to me that as part of this shell-based installer I could offer the user the option to scan their $HOME and symlink any directory it find containing photos (for some definition of photo&#8230; perhaps <acronym title="Joint Photographics Experts Group"><acronym title="Joint Photographic Experts Group Image">JPEG</acronym></acronym> image over 1 Megapixel?) into the Albums root. Zero-configuration installs here we come. The goal is to make Mauvesoft Gallery simpler to install and use than any other gallery software.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.mauveweb.co.uk/2006/09/20/mauvesoft-gallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

