<?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>dead fish</title>
	<atom:link href="http://www.thomaskeller.biz/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thomaskeller.biz/blog</link>
	<description>only dead fish swim with the stream</description>
	<lastBuildDate>Mon, 01 Mar 2010 15:15:50 +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>openSUSE madness</title>
		<link>http://www.thomaskeller.biz/blog/2010/03/01/opensuse-madness/</link>
		<comments>http://www.thomaskeller.biz/blog/2010/03/01/opensuse-madness/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 15:11:05 +0000</pubDate>
		<dc:creator>tommyd</dc:creator>
				<category><![CDATA[Free Software]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://www.thomaskeller.biz/blog/?p=567</guid>
		<description><![CDATA[Just in case you wonder why a simple sudo zypper install sometimes loads dozens or more unneeded, but possibly related packages, its not a bug, its a feature!

While Debian by default only hints you to these additional packages during the install phase, openSUSE installs them all by default. Try it with git and you&#8217;ll get [...]]]></description>
			<content:encoded><![CDATA[<p>Just in case you wonder why a simple <code>sudo zypper install</code> sometimes loads dozens or more unneeded, but possibly related packages, its not a bug, its a feature!</p>

<p>While Debian by default only hints you to these additional packages during the install phase, openSUSE installs them all by default. Try it with <code>git</code> and you&#8217;ll get everything here: <code>cvsps git git-core git-cvs git-email git-gui gitk git-svn git-web libpurple-tcl subversion-perl tcl tk xchat-tcl</code>.</p>

<p>There are two ways to get rid of this nasty behaviour:</p>

<ol>
<li>Temporarily by adding the <code>--no-recommends</code> option to your call</li>
<li>Permanently by editing <code>/etc/zypp/zypper.conf</code> and configuring <code>installRecommends = no</code> in the <code>[solver]</code> section.</li>
</ol>

<p>Hey, at least they have an option to disable it, though its completely beyond me why somebody wants to have this enabled by default. Maybe they get a cookie for every additional package download&#8230;?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomaskeller.biz/blog/2010/03/01/opensuse-madness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony development</title>
		<link>http://www.thomaskeller.biz/blog/2010/02/25/symfony-development/</link>
		<comments>http://www.thomaskeller.biz/blog/2010/02/25/symfony-development/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 11:14:49 +0000</pubDate>
		<dc:creator>tommyd</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.thomaskeller.biz/blog/?p=562</guid>
		<description><![CDATA[Last week the second incarnation of Symfony Live came to an end and I just had the time to check a couple of shared slides from the event.

Definitely interesting stuff going on there, especially the preview release of Symfony 2.0 whose code is available on GitHub since a couple of weeks and which makes major [...]]]></description>
			<content:encoded><![CDATA[<p>Last week the second incarnation of Symfony Live came to an end and I just had the time to check <a href="http://www.symfony-project.org/blog/2010/02/17/symfony-live-day-1">a couple of shared slides</a> from the event.</p>

<p>Definitely interesting stuff going on there, especially the preview release of <a href="http://www.slideshare.net/fabpot/symfony-20-revealed">Symfony 2.0</a> whose code is available on <a href="http://github.com/symfony/symfony">GitHub</a> since a couple of weeks and which makes major changes to the &#8220;good old way&#8221; one used to write symfony applications (actions are now &#8220;controllers&#8221; and extensions &#8220;bundles&#8221; and well, a dozen of other things changed as well of course&#8230; you can read everything in detail <a href="http://symfony-reloaded.org/learn">here</a>).</p>

<p>Also, <a href="http://www.slideshare.net/jwage/doctrine-2-not-the-same-old-php-orm">Doctrine 2.0</a> seems to be the first PHP ORM which decouples the modelling approach from the actual database abstraction layer, skips the need for base classes and enables the model definition via annotations. Also, they seem to fight against the overly complex magic from Doctrine 1.x (one of my top complaints on Doctrine in comparison to, f.e. Propel) &#8211; maybe I&#8217;ll revisit Doctrine again when the next version gets stable.</p>

<p>The guys at Sensio labs do really have a fast development pace and I get more and more the impression that the Symfony ecosystem is the major competitor for the Zend framework. Community-wise I think Symfony is already much bigger than any other PHP framework.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomaskeller.biz/blog/2010/02/25/symfony-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter</title>
		<link>http://www.thomaskeller.biz/blog/2010/02/19/twitter/</link>
		<comments>http://www.thomaskeller.biz/blog/2010/02/19/twitter/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 11:29:24 +0000</pubDate>
		<dc:creator>tommyd</dc:creator>
				<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://www.thomaskeller.biz/blog/?p=559</guid>
		<description><![CDATA[A hail to all the twitter users posting &#8220;I&#8217;m currently at XXX&#8221; status messages, otherwise useful information like those on pleaserobme.com would not be possible.

Darling, do you happen to know where I&#8217;ve put my lock pick in&#8230;?
]]></description>
			<content:encoded><![CDATA[<p>A hail to all the twitter users posting &#8220;I&#8217;m currently at XXX&#8221; status messages, otherwise useful information like those on <a href="http://pleaserobme.com">pleaserobme.com</a> would not be possible.</p>

<p><em>Darling, do you happen to know where I&#8217;ve put my lock pick in&#8230;?</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomaskeller.biz/blog/2010/02/19/twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>guitone 1.0rc1 released</title>
		<link>http://www.thomaskeller.biz/blog/2010/02/15/guitone-1-0rc1-released/</link>
		<comments>http://www.thomaskeller.biz/blog/2010/02/15/guitone-1-0rc1-released/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 14:16:03 +0000</pubDate>
		<dc:creator>tommyd</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[guitone]]></category>
		<category><![CDATA[monotone]]></category>

		<guid isPermaLink="false">http://www.thomaskeller.biz/blog/?p=553</guid>
		<description><![CDATA[I&#8217;m proud to announce the immediate release of guitone-1.0rc1. This is the first release in a series of smaller releases which aims at the stabilization of the guitone codebase. Many (if not most) of the features one would consider needed for a &#8220;1.0&#8243; release have been implemented, a couple of outstanding bugs (noticable FS#39, FS#41 [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m proud to announce the immediate release of guitone-1.0rc1. This is the first release in a series of smaller releases which aims at the stabilization of the guitone codebase. Many (if not most) of the features one would consider needed for a &#8220;1.0&#8243; release have been implemented, a couple of outstanding bugs (noticable <a href="https://guitone.thomaskeller.biz/flyspray/index.php?do=details&#038;task_id=39&#038;project=2&#038;status%5B0%5D=open">FS#39</a>, <a href="https://guitone.thomaskeller.biz/flyspray/index.php?do=details&#038;task_id=41&#038;project=2&#038;status%5B0%5D=open">FS#41</a> and
<a href="https://guitone.thomaskeller.biz/flyspray/index.php?do=details&#038;task_id=42&#038;project=2&#038;status%5B0%5D=open">FS#42</a>) have to get fixed beforehand though before that happens. Please test and <a href="https://guitone.thomaskeller.biz/g/tracker">report bugs</a> if possible.</p>

<p>Outstanding news of this release:</p>

<ul>
<li>Synchronization with other monotone nodes is no possible</li>
<li>Workspace action implementation almost feature-complete (add, drop, revert, rename, ignore, unignore and update finally work)</li>
<li>guitone can now create new monotone databases and setup new projects</li>
<li>Much improved key management with the ability to change the passphrase of keys, filter the key output and also drop keys</li>
<li>Many more bugfixes and smaller improvements as well as stabilization of the codebase</li>
</ul>

<p>For a complete list of changes please check the <a href="https://guitone.thomaskeller.biz/releases/latest/NEWS">NEWS</a> file. I&#8217;ll try and prepare a Windows binary in the next couple of days, but probably won&#8217;t get to that before Wednesday, so if you want to help out, drop me
a note. A binary for Mac OS X should be come shortly as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomaskeller.biz/blog/2010/02/15/guitone-1-0rc1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip: Enforce specific key usage for a single SSH connection</title>
		<link>http://www.thomaskeller.biz/blog/2010/02/04/tip-enforce-specific-key-usage-for-a-single-ssh-connection/</link>
		<comments>http://www.thomaskeller.biz/blog/2010/02/04/tip-enforce-specific-key-usage-for-a-single-ssh-connection/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 09:46:32 +0000</pubDate>
		<dc:creator>tommyd</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.thomaskeller.biz/blog/?p=544</guid>
		<description><![CDATA[In case you have to access a very restricted SSH server which only accepts a single key (ie. the one which is set up in ~/.ssh/authorized_keys) and otherwise fails, its the easiest to set the specific key in your local ~/.ssh/config file as follows:


Host very.secure.server
    IdentityFile ~/.ssh/id_dsa
    IdentitiesOnly true


The [...]]]></description>
			<content:encoded><![CDATA[<p>In case you have to access a very restricted SSH server which only accepts a single key (ie. the one which is set up in <code>~/.ssh/authorized_keys</code>) and otherwise fails, its the easiest to set the specific key in your local <code>~/.ssh/config</code> file as follows:</p>

<p><pre>
Host very.secure.server
    IdentityFile ~/.ssh/id_dsa
    IdentitiesOnly true
</pre></p>

<p>The second entry, <code>IdentitiesOnly</code>, forces SSH to only use known identity files and not look for more available identities f.e. from a running <code>ssh_agent</code> instance (which are always tried in first instance as it seems).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomaskeller.biz/blog/2010/02/04/tip-enforce-specific-key-usage-for-a-single-ssh-connection/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Never trust doctrine:data-dump&#8230;</title>
		<link>http://www.thomaskeller.biz/blog/2010/01/29/never-trust-doctrinedata-dump/</link>
		<comments>http://www.thomaskeller.biz/blog/2010/01/29/never-trust-doctrinedata-dump/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 16:52:33 +0000</pubDate>
		<dc:creator>tommyd</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.thomaskeller.biz/blog/?p=537</guid>
		<description><![CDATA[&#8230;and especially not if you get the impression that the dump will afterwards be readable by the doctrine:data-load command of symfony.

It was a costly lesson today when I tried to reimport a dump of a couple of Sympal tables. One of them, the one which models the menu items, has a nested set behaviour, and [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230;and especially not if you get the impression that the dump will afterwards be readable by the <code>doctrine:data-load</code> command of <a href="http://www.symfony-project.org">symfony</a>.</p>

<p>It was a costly lesson today when I tried to reimport a dump of a couple of <a href="http://www.sympalphp.org">Sympal</a> tables. One of them, the one which models the menu items, has a nested set behaviour, and apparently this one cannot be restored properly by <a href="http://www.doctrine-project.org">doctrine</a>:</p>

<p><pre>[Doctrine_Record_UnknownPropertyException]<br />
  Unknown record property / related component "children" 
  on "sfSympalMenuItem"</pre></p>

<p>Apparently this particular issue popped up a couple of times in the past for other people as well (<a href="http://www.google.com/search?q=doctrine+data-load+%22nested+set%22">Google for it</a>) and while the help of <code>doctrine:data-dump</code> still (Doctrine 1.2) blatantly states</p>

<p><pre> The doctrine:data-dump task dumps database data:</pre></p>

<p>./symfony doctrine:data-dump</p>

<p>The task dumps the database data in data/fixtures/%target%.</p>

<p>The dump file is in the YML format and can be reimported
 by using the doctrine:data-load task.</p>

<p>./symfony doctrine:data-load
</p>

<p><small>(with the emphasis of &#8220;can be reimported&#8221;)</small></p>

<p>the author of Doctrine, Jonathan Wage, told me today on Sympal&#8217;s IRC (shortened):</p>

<blockquote>
&lt;jonwage> we don&#8217;t want people to think you can dump and then restore
&lt;jonwage> that is not what the data fixtures are for
&lt;jonwage> b/c dumping and then loading will never work
&lt;jonwage> an ORM modifies data on the way and and the way out
&lt;me> I mean the least thing doctrine could do there is that if it detects the nested set behaviour it should error out clearly on dump
&lt;jonwage> so you can&#8217;t dump the data through an ORM and then try and reload it
&lt;jonwage> i.e. hashed passwords
&lt;me> if dumping is &#8220;never&#8221; going to work &#8211; why do you support dumping into yaml at all?!
&lt;jonwage> if we do that then we would have to throw errors in sooooooo many other cases too
&lt;jonwage> because it is at least a little bit of a convenience
&lt;me> its like a half-baked feature then
&lt;jonwage> we dump the raw data
&lt;jonwage> and you can tweak it
&lt;jonwage> thats my point though, it will ALWAYS be a half baked feature thats why we document it that way
&lt;jonwage> it can NEVER work 100% the way you want it to
&lt;jonwage> so if we fix that one thing, a million other things will be reported that we cannot fix
&lt;jonwage> bc an ORM is not a backup and restore tool
&lt;jonwage> it is impossible
</blockquote>

<p>Now I know that as well. My only problem was that I struggled &#8220;what is wrong with my fixtures&#8221; the whole time and never dared to ask &#8220;what is wrong with doctrine&#8221;&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomaskeller.biz/blog/2010/01/29/never-trust-doctrinedata-dump/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tip: Logging with Symfony &gt;= 1.2</title>
		<link>http://www.thomaskeller.biz/blog/2010/01/25/tip-logging-with-symfony-1-2/</link>
		<comments>http://www.thomaskeller.biz/blog/2010/01/25/tip-logging-with-symfony-1-2/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 15:00:31 +0000</pubDate>
		<dc:creator>tommyd</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.thomaskeller.biz/blog/?p=529</guid>
		<description><![CDATA[Imagine you have a business method in your model which needs to be accessed by two environments: once from a symfony task and once from the web. So far so good, now what if this business method should be able to log contents somewhere visibly, in case of the command line task to console and [...]]]></description>
			<content:encoded><![CDATA[<p>Imagine you have a business method in your model which needs to be accessed by two environments: once from a symfony task and once from the web. So far so good, now what if this business method should be able to log contents somewhere visibly, in case of the command line task to console and to a file and in case of the web application to the default logging mechanisms used there?</p>

<p>Getting the logger in web context is easy, all you have to do is</p>

<div class="geshi no php"><ol><li class="li1"><div class="de1"><span class="re1">$logger</span> <span class="sy0">=</span> sfContext<span class="sy0">::</span><span class="me2">getInstance</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">-&gt;</span><span class="me1">getLogger</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li></ol></div>

<p>but its a little harder to do for the command line task.</p>

<p>By default no symfony context is created for a command line task and even if it is created, the above call returns an instance of <code>sfNoLogger</code>. Logging in command applications happens through the <code>sfTask::logSection()</code> method, which basically throws an event at the created dispatcher in <code>SYMFONYDIR/lib/command/cli.php</code>. There you can also see that an instance of <code>sfCommandLogger</code> is created, but there is no way to get your fingers at this instance, because its purely local.</p>

<p>So what can we do? Parametricizing the business method with the <code>sfTask</code> instance and using the <code>logSection()</code> is obviously no solution, because this would break in web context where no such sfTask instance exists&#8230;</p>

<p>My solution was a bit more straight forward &#8211; I simply decided to not use the task-supplied logging schema at all, but created my own logger like this:</p>

<div class="geshi no php"><ol><li class="li1"><div class="de1"><span class="re1">$dispatcher</span> <span class="sy0">=</span> <span class="kw2">new</span> sfEventDispatcher<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1"><span class="re1">$logger</span> <span class="sy0">=</span> <span class="kw2">new</span> sfAggregateLogger<span class="br0">&#40;</span><span class="re1">$dispatcher</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1"><span class="re1">$logger</span><span class="sy0">-&gt;</span><span class="me1">addLogger</span><span class="br0">&#40;</span><span class="kw2">new</span> sfCommandLogger<span class="br0">&#40;</span><span class="re1">$dispatcher</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1"><span class="co1">// optionally add another file logger</span></div></li>
<li class="li1"><div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span><span class="re1">$logToFile</span><span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="re1">$logger</span><span class="sy0">-&gt;</span><span class="me1">addLogger</span><span class="br0">&#40;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">new</span> sfFileLogger<span class="br0">&#40;</span><span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">dispatcher</span><span class="sy0">,</span> <span class="sy0">&#8230;</span><span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li></ol></div>

<p>Hope this helps somebody.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomaskeller.biz/blog/2010/01/25/tip-logging-with-symfony-1-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>monotone 0.46 released</title>
		<link>http://www.thomaskeller.biz/blog/2010/01/18/monotone-0-46-released/</link>
		<comments>http://www.thomaskeller.biz/blog/2010/01/18/monotone-0-46-released/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 23:17:43 +0000</pubDate>
		<dc:creator>tommyd</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[monotone]]></category>

		<guid isPermaLink="false">http://www.thomaskeller.biz/blog/?p=526</guid>
		<description><![CDATA[The monotone developers are proud to announce the release of version 0.46. The highlights in this release are bisection support &#8211; thanks to Derek Scherger! &#8211; and the possibility to call the automation interface over the network &#8211; thanks to Timothy Brownawell!

Please note that stdio interface has been changed in an backwards-incompatible way. More information [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://monotone.ca/">monotone developers</a> are proud to announce the release of version 0.46. The highlights in this release are bisection support &#8211; thanks to Derek Scherger! &#8211; and the possibility to call the automation interface over the network &#8211; thanks to Timothy Brownawell!</p>

<p>Please note that stdio interface has been changed in an backwards-incompatible way. More information can be found in <a href="http://monotone.ca/docs/Automation.html#Automation">the documentation</a> and in <a href="http://www.thomaskeller.biz/blog/2009/12/27/monotone-automate-stdio-overhauled/">an earlier blog</a> post of me.</p>

<p>Thanks again to everybody who made this release possible! <a href="http://monotone.ca/downloads/0.46/monotone-0.46.tar.gz">Grab it</a> while its hot &#8211; <a href="http://www.macports.org">MacPorts</a> already has the new version and other binaries should follow shortly after this announcement.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomaskeller.biz/blog/2010/01/18/monotone-0-46-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doctrine Horror</title>
		<link>http://www.thomaskeller.biz/blog/2010/01/15/doctrine-horror/</link>
		<comments>http://www.thomaskeller.biz/blog/2010/01/15/doctrine-horror/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 13:47:30 +0000</pubDate>
		<dc:creator>tommyd</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.thomaskeller.biz/blog/?p=523</guid>
		<description><![CDATA[My latest Symfony project uses Doctrine as ORM, which is considered to be a lot better than Propel by many people&#8230;

Well, not by me. Doctrine seems to have a couple of very good concepts, amongst them built-in validators, a powerful query language, and last but not least, an easy schema language. (Though to be fair, [...]]]></description>
			<content:encoded><![CDATA[<p>My latest <a href="http://www.symfony-project.com">Symfony</a> project uses <a href="http://www.doctrine-project.org">Doctrine</a> as ORM, which is considered to be a lot better than <a href="http://propel.phpdb.org">Propel</a> by many people&#8230;</p>

<p>Well, not by me. Doctrine seems to have a couple of very good concepts, amongst them built-in validators, a powerful query language, and last but not least, an easy schema language. (Though to be fair, Propel will gain most of these useful things in the future as well or already has, f.e. with its <code>PropelQuery</code> feature.)</p>

<p>But Doctrine also fails in many areas; the massive use of overloads everywhere makes it very hard to debug and even worse, it tries to outsmart you (the developer) in many areas, which makes it even more hard to debug stuff which Doctrine doesn&#8217;t get right.</p>

<p>A simple example &#8211; consider this schema:</p>

<div class="geshi no yaml"><ol><li class="li1"><div class="de1">Foo:
</div></li>
<li class="li1"><div class="de1">&nbsp; columns:
</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp;id: { type: integer(5), primary: true, autoincrement: true }
</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp;name: { type: string }
</div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li1"><div class="de1">Bar:
</div></li>
<li class="li1"><div class="de1">&nbsp; columns:
</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp;id: { type: integer(5), primary: true, autoincrement: true }
</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp;name: { type: string }
</div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li1"><div class="de1">FooBarBaz:
</div></li>
<li class="li1"><div class="de1">&nbsp; columns:
</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp;foo_id: { type: integer(5), primary: true }
</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp;bar_id: { type: integer(5), primary: true }
</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp;name: { type: string }</div></li></ol></div>

<p>(I&#8217;ll skip the relation setup here, Doctrine should find them all with an additional <code>detect_relations: true</code>)</p>

<p>So what do you expect you see when you call this?</p>

<div class="geshi no php"><ol><li class="li1"><div class="de1"><span class="re1">$obj</span> <span class="sy0">=</span> <span class="kw2">new</span> FooBarBaz<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1"><span class="kw3">print_r</span><span class="br0">&#40;</span><span class="re1">$obj</span><span class="sy0">-&gt;</span><span class="me1">toArray</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li></ol></div>

<p>Well, I expected to get an empty object, with a <code>NULL</code>ed <code>foo_id</code> and <code>bar_id</code>, but I didn&#8217;t! For me <code>foo_id</code> was filled with a 1. Wait, where does this come from?</p>

<p>After I digged deep enough in Doctrine_Record, I saw that this was automatically assigned in the constructor, coming from a statically incremented <code>$_index</code> variable. I could revert this by using my own constructor and call <code>assignIdentifier()</code> like this:</p>

<div class="geshi no php"><ol><li class="li1"><div class="de1"><span class="kw2">class</span> FooBarBaz <span class="kw2">extends</span> BaseFooBarBaz </div></li>
<li class="li1"><div class="de1"><span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp;<span class="kw2">public</span> <span class="kw2">function</span> __construct<span class="br0">&#40;</span><span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp;<span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; parent<span class="sy0">::</span>__construct<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; <span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">assignIdentifier</span><span class="br0">&#40;</span><span class="kw2">false</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp;<span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li></ol></div>

<p>but now this object could no longer be added to a <code>Doctrine_Collection</code> (which is a bummer, because if you want to extend object lists with &#8220;default&#8221; empty objects, you most likely stumble upon a Doctrine_Collection, which is the default data structure returned for every SQL query).</p>

<p>So you might ask &#8220;Why the hell does all this impose a problem for you?&#8221;</p>

<p>Well, if you work with the <code>FooForm</code> created by the doctrine plugin for you in Symfony and you want to add <code>FooBarBazForm</code> via <code>sfForm::embedFormForEach</code> a couple of times (similar to the use case <a href="http://blog.barros.ws/2009/01/01/using-embedformforeach-in-symfony-part-ii/">described here</a>), you suddenly have the problem that your embedded form for the appended new <code>FooBarBaz</code> object &#8220;magically&#8221; gets a foo_id of a wrong (maybe not existing) <code>Foo</code> object and you wonder where the heck this comes from&#8230;</p>

<p>I have my lesson learned for the last one and a half days. I promise I&#8217;ll never <em>ever</em> create a table in Doctrine with a multi-key primary key again and I&#8217;m returing back to Propel for my next project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomaskeller.biz/blog/2010/01/15/doctrine-horror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>monotone automate stdio overhauled [Update]</title>
		<link>http://www.thomaskeller.biz/blog/2009/12/27/monotone-automate-stdio-overhauled/</link>
		<comments>http://www.thomaskeller.biz/blog/2009/12/27/monotone-automate-stdio-overhauled/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 14:54:26 +0000</pubDate>
		<dc:creator>tommyd</dc:creator>
				<category><![CDATA[monotone]]></category>

		<guid isPermaLink="false">http://www.thomaskeller.biz/blog/?p=517</guid>
		<description><![CDATA[Yesterday my &#8220;automate-out-of-band&#8221; branch finally made it into monotone&#8217;s trunk. This is a prerequisite for the support of netsync commands in guitone I&#8217;ve blogged about earlier, as it makes in-stream informational, error and ticker messages possible, even for remote connections!

While I was at it, several other small things have been changed in stdio &#8211; f.e. [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday my &#8220;automate-out-of-band&#8221; branch finally made it into monotone&#8217;s trunk. This is a prerequisite for the support of netsync commands in guitone I&#8217;ve blogged about <a href="http://www.thomaskeller.biz/blog/2009/10/19/monotone-guitone-update/">earlier</a>, as it makes in-stream informational, error and ticker messages possible, even for remote connections!</p>

<p>While I was at it, several other small things have been changed in stdio &#8211; f.e. the error code is now only issued once as payload of the &#8216;l&#8217; stream-, which mean unfortunately that monotone 0.46 will break compatibility with clients which only understand the pre-0.46 output format. To avoid another hard break like this in the future, a new header section has been added to both stdio&#8217;s and the first header which is issued there is the &#8220;format-version&#8221; header:</p>

<p><pre>
$ mtn au stdio
format-version: 2</pre></p>

<p>[...actual output...]
</p>

<p><code>stdio-version</code> is promised to stay constant as long as the output format doesn&#8217;t change and will be incremented by &#8216;1&#8242; if there is any other major dealbreaker in the future. This is actually different from the <code>interface_version</code> number we also have in the automate interface, whose major number will raise everytime an incompatible change is made to <em>any</em> automate command. We&#8217;ll possibly change this behaviour to something more client-friendly in the future, but there is no ETA on this yet, as the current system is still good enough.</p>

<p>All changes for (remote) stdio will be clearly documented in the manual once 0.46 is out. Before this release happens though, I plan to finish the &#8220;automate-netsync&#8221; branch as well&#8230; Holiday time is hacking time <img src='http://www.thomaskeller.biz/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p><strong>[Update:</strong> It was decided to name the version header "format-version" instead of "stdio-version"; I've updated my example accordingly<strong>]</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomaskeller.biz/blog/2009/12/27/monotone-automate-stdio-overhauled/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
