<?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>seeking immortality &#187; php</title>
	<atom:link href="http://blag.sebacean.net/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blag.sebacean.net</link>
	<description>where are we going, and why am i in this handbasket</description>
	<lastBuildDate>Tue, 22 Dec 2009 23:26:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Horde on Webspace (no shell) Part2</title>
		<link>http://blag.sebacean.net/2008/12/horde-on-webspace-no-shell-part2/</link>
		<comments>http://blag.sebacean.net/2008/12/horde-on-webspace-no-shell-part2/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 16:07:36 +0000</pubDate>
		<dc:creator>me</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[horde]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blag.sebacean.net/?p=63</guid>
		<description><![CDATA[After uploading the (now smaller) Horde with our FTP client we can continue with Part 2 The Database Since without shell access we can&#8217;t use Horde&#8217;s setup (./scripts/setup.php) to do this for us we have to manually set up the database for Horde. This step depends on your webhosters so i&#8217;ll just make it quick:]]></description>
			<content:encoded><![CDATA[<p>After uploading the (<a href="http://blag.sebacean.net/2008/12/14/horde-on-webspace-no-shell-part1/">now</a> smaller) Horde with our FTP client we can continue with</p>
<p><strong>Part 2 The Database</strong><br />
Since without shell access we can&#8217;t use Horde&#8217;s setup (./scripts/setup.php) to do this for us we have to manually set up the database for Horde.</p>
<p>This step depends on your webhosters so i&#8217;ll just make it quick:<br />
First create a database with your webhost, then find: hostname (often locahost), username, password, type (often tcp) and databasename for that database.</p>
<p>Now your webhoster probably offers some kind of management frontend (mostly phpmyadmin). There you navigate to your database and select the &#8220;SQL&#8221; tab.</p>
<p>In the editbox you will find there you have to paste some of the lines from the .sql file provided with Horde that matches your database. I use mysql so i used ./scripts/sql/create.mysql.sql.</p>
<p>Out host already created the database, the user etc. so we only need lines that create tables. In my file this would be lines 52 -> end (look for the first CREATE TABLE statement). Copy&#038;Paste and press Submit. This should have given you no errors and created ~18 tables in your database.</p>
<p>In the next step we will create a basic configuration that allows Horde to run so we can do the rest of the setup from within it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blag.sebacean.net/2008/12/horde-on-webspace-no-shell-part2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Horde on Webspace (no shell) Part1</title>
		<link>http://blag.sebacean.net/2008/12/horde-on-webspace-no-shell-part1/</link>
		<comments>http://blag.sebacean.net/2008/12/horde-on-webspace-no-shell-part1/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 01:19:09 +0000</pubDate>
		<dc:creator>me</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[horde]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blag.sebacean.net/?p=57</guid>
		<description><![CDATA[Because i don't like the webmailer my host has chosen for me (roundcube) i decided to try installing Horde on the webspace that came with it.
This experiment will most likely fail because i don't have shell access and the php installation is probably missing vital modules .. but what else is there to do on a saturday evening]]></description>
			<content:encoded><![CDATA[<p>Because i don&#8217;t like the webmailer my host has chosen for me (roundcube) i decided to try installing Horde on the webspace that came with it.</p>
<p>This experiment will most likely fail because i don&#8217;t have shell access and the php installation is probably missing vital modules .. but what else is there to do on a saturday evening<br />
<strong><br />
Part1: Horde is f***ing huge!<br />
</strong><br />
<code><br />
du -sch .<br />
108M    total<br />
</code></p>
<p>I&#8217;ll start by making horde a little slimer&#8230;<br />
This will give me all the folders with locales other than german or english (cd to horde first)<br />
<code><br />
find -iname ??_?? -type d | grep -v de_DE | grep -v en_US | grep -v en_GB<br />
</code><br />
and this will delete them<br />
<code><br />
find -iname ??_?? -type d | grep -v de_DE | grep -v en_US | grep -v en_GB | xargs rm -r<br />
</code></p>
<p>The same for the &#8220;.po&#8221; files:<br />
<code><br />
find -iname ??_??.po -type f | grep -v de_DE | grep -v en_US | grep -v en_GB | xargs rm -r<br />
</code></p>
<p><code><br />
du -sch .<br />
51M     total<br />
</code><br />
Half the size, nice <img src='http://blag.sebacean.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blag.sebacean.net/2008/12/horde-on-webspace-no-shell-part1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP DateTime bugs:  i hate i18n</title>
		<link>http://blag.sebacean.net/2008/03/php-datetime-bugs-i-hate-i18n/</link>
		<comments>http://blag.sebacean.net/2008/03/php-datetime-bugs-i-hate-i18n/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 18:36:58 +0000</pubDate>
		<dc:creator>me</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blag.sebacean.net/2008/03/11/php-datetime-bugs-i-hate-i18n/</guid>
		<description><![CDATA[Handling different dates and timezones in an application is &#8211; like most aspects of i18n &#8211; very annoying (to put it mildly)&#8230; Recently we discovered the following behaviour at work&#8230; If you create a DateTime object like this (in the current stable version of php, 5.2.3): &#60;?php $oDateTest = new DateTime("@0", new DateTimeZone(date_default_timezone_get())); echo "tz:]]></description>
			<content:encoded><![CDATA[<p>Handling different dates and timezones in an application is &#8211; like most aspects of i18n &#8211; very annoying (to put it mildly)&#8230; Recently we discovered the following behaviour at work&#8230;</p>
<p>If you create a DateTime object like this (in the current stable version of php, 5.2.3):</p>
<pre name="code" class="php:nogutter">&lt;?php
$oDateTest = new DateTime("@0", new DateTimeZone(date_default_timezone_get()));
echo "tz: ".$oDateTest-&gt;getTimezone()-&gt;getName()."\n";
echo "date: ". $oDateTest-&gt;format("Y-m-d H:i:s")."\n";
?&gt;</pre>
<p>It will be in the default timezone (&#8216;Europe/Berlin&#8217; in my case) but say the date is 1970-01-01 00:00. This is wrong. The Unix timestamp &#8220;0&#8243; stands for that exact date, but in another timezone: UTC. It should be 01:00 in Berlin.</p>
<p>This bug was reported multiple times, but with sometimes confusing bug reports. But someone had managed to submit a clear bug report with code to reproduce the behaviour (<a href="http://bugs.php.net/bug.php?id=43003">PHP Bug 43003</a>) and the php developers acknowledged the bug and issued a fix that i verified to be (at least) in the following snapshots: php5.2-200803111530 and php5.3-200803111530.</p>
<p>Sadly, this fix is at best &#8220;unintuitive&#8221;, maybe it even qualifies as &#8220;still broken&#8221;. The above code gives the following output in these snapshots:</p>
<blockquote><p> tz: +00:00<br />
date: 1970-01-01 00:00:00</p></blockquote>
<p>So, the DateTime object now knows that UNIX timestamps always are given in UTC and sets it&#8217;s timezone accordingly. But is this what it should do in this case? I &#8211; the programmer &#8211; clearly stated i wanted the DateTime object to be in my default timezone! Even if i explicitly give the timezone as &#8216;Europe/Berlin&#8217; during construction, the object&#8217;s timezone still is UTC afterwards.</p>
<p>So instead of knowing that i have to manually set the DateTime to UTC, then back to my desired timezone when working with an UNIX timestamp i now have to know that a DateTime will be in UTC after setting it up with a UNIX timestamp. Personally i hate having to know things, IMHO it&#8217;s a sign of weak design. The API has to be clear, i don&#8217;t give a rat&#8217;s backside about the inner workings and struggles of the objects i use.</p>
<p>We went from this:</p>
<pre name="code" class="php:nogutter">// FIXME: DateTime issue... needs the conversion to and from UTC...
$oDateTest = new DateTime("@0", new DateTimeZone('UTC'));
$oDateTest-&gt;setTimezone(new DateTimeZone("Europe/Berlin"));
</pre>
<p>To this:</p>
<pre name="code" class="php:nogutter">// FIXME: DateTime issue... will always be UTC afterwards...
$oDateTest = new DateTime("@0", new DateTimeZone('Europe/Berlin')); // or UTC, or what/ever....
$oDateTest-&gt;setTimezone(new DateTimeZone("Europe/Berlin"));
</pre>
<p>Is this better or worse?</p>
]]></content:encoded>
			<wfw:commentRss>http://blag.sebacean.net/2008/03/php-datetime-bugs-i-hate-i18n/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
