<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>/usr/portage βeta — Lars Strojny</title>
    <link>http://usrportage.de/</link>
    <description></description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.5.3 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Drupal as a Content Repository — a few months later</title>
    <link>http://usrportage.de/archives/932-Drupal-as-a-Content-Repository-a-few-months-later.html</link>
    
    <comments>http://usrportage.de/archives/932-Drupal-as-a-Content-Repository-a-few-months-later.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=932</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=932</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    	&lt;p&gt;I’ve recently blogged about &lt;a href=&quot;http://usrportage.de/archives/931-Drupal-as-a-Content-Repository.html&quot;&gt;how we use Drupal as a Content Repository&lt;/a&gt;. I wanted to write a lessons learned follow up post to see what worked out and what we needed to adjust.&lt;/p&gt;

	&lt;h3&gt;Where we are&lt;/h3&gt;

	&lt;p&gt;We still use Drupal as a Content Repository and just consume it’s content data via webservices to let our application do the complicated rendering. We launched the external part of our content in November 2011 (see our &lt;a href=&quot;http://www.internations.org/magazine&quot;&gt;Expat Magazine&lt;/a&gt; and our &lt;a href=&quot;http://www.internations.org/guide/all&quot;&gt;Country &amp;amp; City Guides&lt;/a&gt;) and the internal part in December (you need to &lt;a href=&quot;http://www.internations.org/&quot;&gt;request an account&lt;/a&gt; to see it). Development of both parts was smooth, but we reached some limits of what one can do with Drupal’s view module and we needed to adjust our &lt;em&gt;&amp;#8220;no custom code&amp;#8221;&lt;/em&gt; to &lt;em&gt;&amp;#8220;as little custom code as possible&amp;#8221;&lt;/em&gt;.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://usrportage.de/archives/932-Drupal-as-a-Content-Repository-a-few-months-later.html#extended&quot;&gt;Continue reading &quot;Drupal as a Content Repository — a few months later&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 15 Jan 2012 13:49:03 +0100</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/932-guid.html</guid>
    <category>CMS</category>
<category>Content Repository</category>
<category>Drupal</category>
<category>PHP</category>
<category>Webservices</category>
<category>XML/RPC</category>

</item>
<item>
    <title>Drupal as a Content Repository</title>
    <link>http://usrportage.de/archives/931-Drupal-as-a-Content-Repository.html</link>
    
    <comments>http://usrportage.de/archives/931-Drupal-as-a-Content-Repository.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=931</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=931</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    	&lt;p&gt;As one of my first projects at &lt;a href=&quot;http://www.internations.org&quot;&gt;InterNations&lt;/a&gt; we want to introduce rich content management functionality for internal usage. We have a custom made &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; application and want to publish a bunch of content to provide our customers with an even richer experience and greater service. Our requirements can be read along the lines of:&lt;/p&gt;

	&lt;ul&gt;
		&lt;li&gt;Provide an easy to use interface for content and media management for our editorial team&lt;/li&gt;
		&lt;li&gt;A limited set of fairly complex content types (multi page articles, etc.)&lt;/li&gt;
		&lt;li&gt;&lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; features like versioning, custom attributes, workflows&lt;/li&gt;
		&lt;li&gt;Deep integration into our custom application&lt;/li&gt;
		&lt;li&gt;Halfway complex rules based on categories (or taxonomies, as Drupal takes it)&lt;/li&gt;
		&lt;li&gt;A few edits per day, not many per hour&lt;/li&gt;
	&lt;/ul&gt; &lt;br /&gt;&lt;a href=&quot;http://usrportage.de/archives/931-Drupal-as-a-Content-Repository.html#extended&quot;&gt;Continue reading &quot;Drupal as a Content Repository&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 24 Nov 2011 17:04:00 +0100</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/931-guid.html</guid>
    <category>CMS</category>
<category>Content Repository</category>
<category>Drupal</category>
<category>PHP</category>
<category>Webservices</category>
<category>XML/RPC</category>

</item>
<item>
    <title>Dependency Injection Container Refactorings, Part Two</title>
    <link>http://usrportage.de/archives/928-Dependency-Injection-Container-Refactorings,-Part-Two.html</link>
    
    <comments>http://usrportage.de/archives/928-Dependency-Injection-Container-Refactorings,-Part-Two.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=928</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=928</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    	&lt;p&gt;&lt;em&gt;This is part of a mini-series about typical refactorings when using DI containers. Read&lt;/em&gt; &lt;a href=&quot;http://usrportage.de/archives/926-Dependency-Injection-Container-Refactorings,-Part-One.html&quot;&gt;&lt;em&gt;part one&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

	&lt;p&gt;&lt;img src=&quot;http://usrportage.de/uploads/injection.jpg&quot; alt=&quot;&quot;  /&gt;&lt;br /&gt;
(c) &lt;a href=&quot;http://www.flickr.com/photos/jill_a_brown/&quot;&gt;Jil A. Brown&lt;/a&gt;&lt;/p&gt;

	&lt;h3&gt;Introduce Parameter&lt;/h3&gt;

	&lt;p&gt;When configuring objects you will stumble upon occurrences of duplicated configuration. As configuration duplication is as bad as code duplication, making refactorings and maintenance time-intense and error-prone, we try to avoid them. Occurrences I had, started from defining the same hosts over and over for different services and quasi hard-coded upload prefixes for files sprinkled all over my configuration. I will illustrate this refactoring with the image upload example. We configure &lt;code&gt;Zend_File_Transfer&lt;/code&gt; and add a few validators to allow image uploads but only specific ones:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?xml version=&amp;#34;1.0&amp;#34;?&amp;#62;
&amp;#60;container&amp;#62;
   &amp;#60;services&amp;#62;
      &amp;#60;service id=&amp;#34;fileTransferService&amp;#34; class=&amp;#34;Zend_File_Transfer&amp;#34;&amp;#62;
          …
         &amp;#60;call method=&amp;#34;addValidator&amp;#34;&amp;#62;
            &amp;#60;argument&amp;#62;Count&amp;#60;/argument&amp;#62;
            …
            &amp;#60;argument&amp;#62;photo&amp;#60;/argument&amp;#62;
         &amp;#60;/call&amp;#62;
         &amp;#60;call method=&amp;#34;addValidator&amp;#34;&amp;#62;
            &amp;#60;argument&amp;#62;Size&amp;#60;/argument&amp;#62;
            …
            &amp;#60;argument&amp;#62;photo&amp;#60;/argument&amp;#62;
         &amp;#60;/call&amp;#62;
         &amp;#60;call method=&amp;#34;addValidator&amp;#34;&amp;#62;
            &amp;#60;argument&amp;#62;MimeType&amp;#60;/argument&amp;#62;
            …
            &amp;#60;argument&amp;#62;photo&amp;#60;/argument&amp;#62;
         &amp;#60;/call&amp;#62;
         &amp;#60;call method=&amp;#34;addValidator&amp;#34;&amp;#62;
            &amp;#60;argument&amp;#62;ImageSize&amp;#60;/argument&amp;#62;
            …
            &amp;#60;argument&amp;#62;photo&amp;#60;/argument&amp;#62;
         &amp;#60;/call&amp;#62;
      &amp;#60;/service&amp;#62;
   &amp;#60;services&amp;#62;
&amp;#60;/container&amp;#62;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;When adding validators to &lt;code&gt;Zend_File_Transfer&lt;/code&gt; the fourth argument (in this case &lt;code&gt;photo&lt;/code&gt;) is the name of the array key of the file. In our case the markup would look like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;input type=&amp;#34;file&amp;#34; name=&amp;#34;photo&amp;#34;/&amp;#62;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The specific key is important if you allow the upload of various file types in one request. Now we change the requirements and allow not only photos but photos and PDFs (in the same input as photos, so that the user does not need to use different inputs based on file formats). To not mislead the next programmer working on this piece of code, we should change the markup to something like this (give me a better name please):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;input type=&amp;#34;file&amp;#34; name=&amp;#34;photoOrPdf&amp;#34;/&amp;#62;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Now we open our container configuration and change every occurrence of &amp;#8220;photo&amp;#8221; to &amp;#8220;photoOrPdf&amp;#8221; and hope not to forget one. Except the one you’ll find out two month later. To avoid this duplication of configuration, we introduce a parameter and our container configuration changes.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?xml version=&amp;#34;1.0&amp;#34;?&amp;#62;
&amp;#60;container&amp;#62;
   &amp;#60;parameters&amp;#62;
       &amp;#60;parameter key=&amp;#34;filePrefix&amp;#34;&amp;#62;photoOrPdf&amp;#60;/parameter&amp;#62;
   &amp;#60;/parameters&amp;#62;
   &amp;#60;services&amp;#62;
      &amp;#60;service id=&amp;#34;fileTransferService&amp;#34; class=&amp;#34;Zend_File_Transfer&amp;#34;&amp;#62;
          …
          &amp;#60;call method=&amp;#34;addValidator&amp;#34;&amp;#62;
             &amp;#60;argument&amp;#62;Count&amp;#60;/argument&amp;#62;
             …
             &amp;#60;argument&amp;#62;%filePrefix%&amp;#60;/argument&amp;#62;
          &amp;#60;/call&amp;#62;
          &amp;#60;call method=&amp;#34;addValidator&amp;#34;&amp;#62;
             &amp;#60;argument&amp;#62;Size&amp;#60;/argument&amp;#62;
             …
             &amp;#60;argument&amp;#62;%filePrefix%&amp;#60;/argument&amp;#62;
          &amp;#60;/call&amp;#62;
          &amp;#60;call method=&amp;#34;addValidator&amp;#34;&amp;#62;
             &amp;#60;argument&amp;#62;MimeType&amp;#60;/argument&amp;#62;
             …
             &amp;#60;argument&amp;#62;%filePrefix%&amp;#60;/argument&amp;#62;
          &amp;#60;/call&amp;#62;
          &amp;#60;call method=&amp;#34;addValidator&amp;#34;&amp;#62;
             &amp;#60;argument&amp;#62;ImageSize&amp;#60;/argument&amp;#62;
             …
             &amp;#60;argument&amp;#62;%filePrefix%&amp;#60;/argument&amp;#62;
          &amp;#60;/call&amp;#62;
       &amp;#60;/service&amp;#62;
   &amp;#60;/services&amp;#62;
&amp;#60;/container&amp;#62;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;To make things even more smooth we could inject that parameter into the view and into the controller to make sure, configuration value duplication is no longer an issue with this specific module.&lt;/p&gt;

	&lt;h3&gt;Parametererize Service&lt;/h3&gt;

	&lt;p&gt;Excluded, as I no longer think this is actually a good idea.&lt;/p&gt;

	&lt;h3&gt;Allow Environment Specific configuration&lt;/h3&gt;

	&lt;p&gt;When you have a development process where you pass several acceptance stages before an artefact goes into production, these stages are typically slightly different from each other. Starting from different service IP addresses over single machine vs. multi machine, there will definitely be some variance among them. Typical variances are:&lt;/p&gt;

	&lt;ul&gt;
		&lt;li&gt;Logger settings: severity filters, logging targets like file on development, syslog on the rest&lt;/li&gt;
		&lt;li&gt;Database settings master with fake slave a.k.a. read only database user on development, master slave on the rest&lt;/li&gt;
		&lt;li&gt;Error handling modes especially for more introspective components: &amp;#8220;Hard fail&amp;#8221; vs. &amp;#8220;soft fail and log&amp;#8221;&lt;/li&gt;
		&lt;li&gt;Caching: no caching on development, caching enabled on testing and production stages&lt;/li&gt;
		&lt;li&gt;Code generation and building: &amp;#8220;rebuild on request&amp;#8221; on development, once per deployment on testing and production&lt;/li&gt;
	&lt;/ul&gt;

	&lt;p&gt;One way to do so is to sprinkle conditions all over your application and check on which host you are but that will lead to an application well beyond manageability. That’s why I was never happy (at least for large applications &gt;100 person-days) with typical &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; application configurations like the preposterous &lt;code&gt;config.inc.php&lt;/code&gt;. Having a touring complete programming language at hand for configuration will eventually introduce ugly conditionals making configurations unreadable. But I digress.&lt;/p&gt;

	&lt;p&gt;There are various models for stage configuration, including inheritance from each former stage, inheritance from a main configuration, standalone configuration and all mixes of these models. All of them are well implementable with the Symfony 2 dependency injection container. Let’s start with the most simplistic one, standalone configuration for each stage:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?php
$container = new ContainerBuilder();
$loader = new XmlFileLoader($container, new FileLocator(…));
$loader-&amp;#62;import($currentStage . &amp;#39;.xml&amp;#39;);
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;A more complicated one is main configuration + override per stage:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?php
$container = new ContainerBuilder();
$baseLoader = new XmlFileLoader($container, new FileLocator(…));
$baseLoader-&amp;#62;import(&amp;#39;main.xml&amp;#39;);
$stageLoader = new XmlFileLoader($container, new FileLocator(…));
$stageLoader-&amp;#62;import($currentStage . &amp;#39;.xml&amp;#39;);
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The most &amp;#8220;complicated&amp;#8221; would be linear inheritance, where testing extends development, staging extends testing and so on:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?php
$container = new ContainerBuilder();
$loader = new XmlFileLoader($container, new FileLocator(…));
foreach (array(&amp;#39;development&amp;#39;, &amp;#39;testing&amp;#39;, &amp;#39;staging&amp;#39;, &amp;#39;production&amp;#39;) as $stage) {
    $loader-&amp;#62;import($stage . &amp;#39;.xml&amp;#39;);
    if ($stage == $currentStage) {
        break;
    }
}
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;With this kind of setup you can override configuration.&lt;/p&gt;

	&lt;p&gt;Example &lt;code&gt;main.xml&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?xml version=&amp;#34;1.0&amp;#34;?&amp;#62;
&amp;#60;container&amp;#62;
   &amp;#60;parameters&amp;#62;
        &amp;#60;parameter key=&amp;#34;database.name&amp;#34;&amp;#62;application&amp;#60;/parameter&amp;#62;
        …
   &amp;#60;/parameter&amp;#62;
   &amp;#60;services&amp;#62;
       &amp;#60;service id=&amp;#34;component&amp;#34; class=&amp;#34;MyComponent&amp;#34;/&amp;#62;
       &amp;#60;service id=&amp;#34;component2&amp;#34; class=&amp;#34;MyComponent2&amp;#34;/&amp;#62;
   &amp;#60;/services&amp;#62;
&amp;#60;/container&amp;#62;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;&lt;code&gt;testing.xml&lt;/code&gt; with different database name and an alternative for &lt;code&gt;component2&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?xml version=&amp;#34;1.0&amp;#34;?&amp;#62;
&amp;#60;container&amp;#62;
   &amp;#60;parameters&amp;#62;
        &amp;#60;parameter key=&amp;#34;database.name&amp;#34;&amp;#62;another_database&amp;#60;/parameter&amp;#62;
   &amp;#60;/parameter&amp;#62;
   &amp;#60;services&amp;#62;
      &amp;#60;service id=&amp;#34;component2&amp;#34; class=&amp;#34;MyAlternativeComponent2&amp;#34;/&amp;#62;
   &amp;#60;/services&amp;#62;
&amp;#60;/container&amp;#62;
&lt;/code&gt;&lt;/pre&gt; 
    </content:encoded>

    <pubDate>Fri, 06 May 2011 17:56:00 +0200</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/928-guid.html</guid>
    <category>Patterns</category>
<category>PHP</category>
<category>Refactoring</category>
<category>Symfony</category>

</item>
<item>
    <title>PECL mogilefs 0.9.0 released</title>
    <link>http://usrportage.de/archives/927-PECL-mogilefs-0.9.0-released.html</link>
    
    <comments>http://usrportage.de/archives/927-PECL-mogilefs-0.9.0-released.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=927</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=927</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    	&lt;p&gt;I just released 0.9.0 of &lt;a href=&quot;http://pecl.php.net/package/mogilefs&quot;&gt;&lt;span class=&quot;caps&quot;&gt;PECL&lt;/span&gt; mogilefs&lt;/a&gt;. This is release comes with a few but small &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; breaks. Basically whenever there was no open connection, we returned &lt;code&gt;false&lt;/code&gt; in the past. We no longer do that, instead we throw an exception of type &lt;code&gt;MogileFsException&lt;/code&gt;. So the &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; breakage will be fairly visible. The complete list of changes:&lt;/p&gt;

	&lt;ul&gt;
		&lt;li&gt;Adding new methods &lt;code&gt;setReadTimeout(float readTimeout)&lt;/code&gt; and &lt;code&gt;getReadTimeout()&lt;/code&gt;. This can be used to set a differing read timeout to the connect timeout. In the past releases, the connect timeout (to the tracker) was used as a read timeout (to the storage nodes). From my experience the read timeout should be a little bit higher than the connect timeout.&lt;/li&gt;
		&lt;li&gt;Remove &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; max version limit so we no longer have to release a new version when &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; is released. This is what other &lt;span class=&quot;caps&quot;&gt;PECL&lt;/span&gt; packages are doing, so I think this will work better.&lt;/li&gt;
		&lt;li&gt;Comply with stricter c99 standard. Yeah, nerd stuff&lt;/li&gt;
		&lt;li&gt;Fixed tests and made them more robust. Try them: &lt;code&gt;PHP_TEST_EXECUTABLE=&amp;#60;php&amp;#62; php tests.php&lt;/code&gt;&lt;/li&gt;
		&lt;li&gt;Optimized &lt;code&gt;mogilefs_sock_read()&lt;/code&gt; and introduced maximum message size (based on a patch from Andre Pascha of kwick.de). Less allocs, less frees. Good stuff&lt;/li&gt;
		&lt;li&gt;&lt;code&gt;MogileFs::put()&lt;/code&gt; throws more exceptions: as said before&lt;/li&gt;
	&lt;/ul&gt;

	&lt;p&gt;Comments, ideas, patches and anything else are more than welcome. Have fun with this release.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 22 Apr 2011 09:20:09 +0200</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/927-guid.html</guid>
    
</item>
<item>
    <title>Dependency Injection Container Refactorings, Part One</title>
    <link>http://usrportage.de/archives/926-Dependency-Injection-Container-Refactorings,-Part-One.html</link>
    
    <comments>http://usrportage.de/archives/926-Dependency-Injection-Container-Refactorings,-Part-One.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=926</wfw:comment>

    <slash:comments>15</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=926</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    	&lt;p&gt;&lt;em&gt;This is part of a mini-series about typical refactorings when using DI containers. Read&lt;/em&gt; &lt;a href=&quot;http://usrportage.de/archives/928-Dependency-Injection-Container-Refactorings,-Part-Two.html&quot;&gt;&lt;em&gt;part two&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

	&lt;p&gt;&lt;img src=&quot;http://usrportage.de/uploads/injection.jpg&quot; alt=&quot;&quot;  /&gt;&lt;br /&gt;
(c) &lt;a href=&quot;http://www.flickr.com/photos/jill_a_brown/&quot;&gt;Jil A. Brown&lt;/a&gt;&lt;/p&gt;

	&lt;p&gt;Working heavily with the Symfony2 Dependency Injection Container, I feel that we found some typical refactorings towards a DI container that emerge during the introduction of such a component. I want to write down the preliminary results of trying to systematize more or less as a draft. I will use the Symfony2 DI container configuration as an example but most of the refactorings should be applicable to other containers as well, some of them even to dependency injection without a container.&lt;/p&gt;

	&lt;h3&gt;Make Dependency Explicit&lt;/h3&gt;

	&lt;p&gt;This is typically the first step towards Dependency Injection: make a dependency explicit. There are three typical ways to do so, first is constructor injection, second is setter injection and third and less preferred is property injection. I roughly prefer constructor injection for invariant dependency in my domain and setter injection for infrastructure (&lt;code&gt;setNotifier&lt;/code&gt; e.g.). Consider this example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?php
namespace Example;
class Client
{
    public function execute()
    {
        $dependency = new Dependency();
        $dependency-&amp;#62;execute();
    }
}
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;&lt;code&gt;Client&lt;/code&gt; creates a new instance of &lt;code&gt;Dependency&lt;/code&gt; and call &lt;code&gt;execute()&lt;/code&gt;. Bad for testing and for configuration, &lt;code&gt;Dependency&lt;/code&gt; will always be hard coded there. To make it easier manageable we refactor towards setter injection:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?php
namespace Example;
class Client
{
    public function setDependency(Dependency $dependency)
    {
        $this-&amp;#62;_dependency = $dependency;
    }
 
    public function execute()
    {
        $this-&amp;#62;_dependency-&amp;#62;execute();
    }
}
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Now we can manage &lt;code&gt;Client&lt;/code&gt; in the DI container like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?xml version=&amp;#34;1.0&amp;#34;?&amp;#62;
&amp;#60;container xmlns=&amp;#34;http://www.symfony-project.org/schema/dic/services&amp;#34;&amp;#62;
    &amp;#60;services&amp;#62;
        &amp;#60;service name=&amp;#34;example.client&amp;#34; class=&amp;#34;Example\Client&amp;#34;&amp;#62;
            &amp;#60;call method=&amp;#34;setDependency&amp;#34;&amp;#62;
                &amp;#60;argument type=&amp;#34;service&amp;#34;&amp;#62;
                    &amp;#60;service class=&amp;#34;Example\Dependency&amp;#34;/&amp;#62;
                &amp;#60;/argument&amp;#62;
            &amp;#60;/call&amp;#62;
        &amp;#60;/service&amp;#62;
    &amp;#60;/services&amp;#62;
&amp;#60;/container&amp;#62;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;We see that the dependency is explicit: we specifically configure &lt;code&gt;Example\Client&lt;/code&gt; and pass a specific &lt;code&gt;Example\Dependency&lt;/code&gt; object.&lt;/p&gt;

	&lt;h3&gt;Introduce Interface Injection&lt;/h3&gt;

	&lt;p&gt;After a number of &lt;strong&gt;Explicit Dependency&lt;/strong&gt; refactorings our configuration file for the service container will become huge. We will notice that we have common dependencies that are used at various places, an event manager for example. To fix that rapid growth we choose to utilize Interface Injection to ease configuration.&lt;/p&gt;

	&lt;p&gt;This is the configuration starting point:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?xml version=&amp;#34;1.0&amp;#34;?&amp;#62;
&amp;#60;container xmlns=&amp;#34;http://www.symfony-project.org/schema/dic/services&amp;#34;&amp;#62;
    &amp;#60;services&amp;#62;
        &amp;#60;service name=&amp;#34;example.client&amp;#34; class=&amp;#34;Example\Client&amp;#34;&amp;#62;
            &amp;#60;call method=&amp;#34;setDependency&amp;#34;&amp;#62;
                &amp;#60;argument type=&amp;#34;service&amp;#34;&amp;#62;
                    &amp;#60;service class=&amp;#34;Example\Dependency&amp;#34;/&amp;#62;
                &amp;#60;/argument&amp;#62;
            &amp;#60;/call&amp;#62;
        &amp;#60;/service&amp;#62;
        &amp;#60;service name=&amp;#34;example.anotherClient&amp;#34; class=&amp;#34;Example\AnotherClient&amp;#34;&amp;#62;
            &amp;#60;call method=&amp;#34;setDependency&amp;#34;&amp;#62;
                &amp;#60;argument type=&amp;#34;service&amp;#34;&amp;#62;
                    &amp;#60;service class=&amp;#34;Example\Dependency&amp;#34;/&amp;#62;
                &amp;#60;/argument&amp;#62;
            &amp;#60;/call&amp;#62;
            &amp;#60;call method=&amp;#34;setOtherDependency&amp;#34;&amp;#62;
                &amp;#60;argument type=&amp;#34;service&amp;#34;&amp;#62;
                    &amp;#60;service class=&amp;#34;Example\OtherDependency&amp;#34;/&amp;#62;
                &amp;#60;/argument&amp;#62;
            &amp;#60;/call&amp;#62;
        &amp;#60;/service&amp;#62;
    &amp;#60;/services&amp;#62;
&amp;#60;/container&amp;#62;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;We notice that both &lt;code&gt;Example\Client&lt;/code&gt; and &lt;code&gt;Example\AnotherClient&lt;/code&gt; depend on &lt;code&gt;Example\Dependency&lt;/code&gt;. First of all we need an interface contracting &lt;code&gt;setDependency&lt;/code&gt;. This is basically the &lt;a href=&quot;http://www.refactoring.com/catalog/extractInterface.html&quot;&gt;&lt;strong&gt;Extract Interface&lt;/strong&gt; refactoring&lt;/a&gt;. We call the newly extracted interface &lt;code&gt;Example\DependencyAware&lt;/code&gt;.&lt;/p&gt;

	&lt;p&gt;The interface:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?php
namespace Example;
interface DependencyAware
{
    public function setDependency(Dependency $dependency);
}
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;And we refactor both &lt;code&gt;Example\Client&lt;/code&gt; and &lt;code&gt;Example\AnotherClient&lt;/code&gt; to implement &lt;code&gt;Example\DependencyAware&lt;/code&gt;.&lt;/p&gt;

	&lt;p&gt;Now we change our configuration to call &lt;code&gt;setDependency&lt;/code&gt; no longer explicitly for &lt;code&gt;Example\Client&lt;/code&gt; and &lt;code&gt;Example\AnotherClient&lt;/code&gt; but for every object implementing &lt;code&gt;Example\DependencyAware&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?xml version=&amp;#34;1.0&amp;#34;?&amp;#62;
&amp;#60;container xmlns=&amp;#34;http://www.symfony-project.org/schema/dic/services&amp;#34;&amp;#62;
    &amp;#60;services&amp;#62;
        &amp;#60;service name=&amp;#34;example.client&amp;#34; class=&amp;#34;Example\Client&amp;#34;/&amp;#62;
        &amp;#60;service name=&amp;#34;example.anotherClient&amp;#34; class=&amp;#34;Example\AnotherClient&amp;#34;&amp;#62;
            &amp;#60;call method=&amp;#34;setOtherDependency&amp;#34;&amp;#62;
                &amp;#60;argument type=&amp;#34;service&amp;#34;&amp;#62;
                    &amp;#60;service class=&amp;#34;Example\OtherDependency&amp;#34;/&amp;#62;
                &amp;#60;/argument&amp;#62;
            &amp;#60;/call&amp;#62;
        &amp;#60;/service&amp;#62;
    &amp;#60;/services&amp;#62;
    &amp;#60;interfaces&amp;#62;
        &amp;#60;interface class=&amp;#34;Example\DependencyAware&amp;#34;&amp;#62;
            &amp;#60;call method=&amp;#34;setDependency&amp;#34;&amp;#62;
                &amp;#60;argument type=&amp;#34;service&amp;#34;&amp;#62;
                    &amp;#60;service class=&amp;#34;Example\Dependency&amp;#34;/&amp;#62;
                &amp;#60;/argument&amp;#62;
            &amp;#60;/call&amp;#62;
        &amp;#60;/interface&amp;#62;
    &amp;#60;/interfaces&amp;#62;
&amp;#60;/container&amp;#62;
&lt;/code&gt;&lt;/pre&gt;

	&lt;h3&gt;Expose Service&lt;/h3&gt;

	&lt;p&gt;Really simple, but …&lt;br /&gt;
&lt;strong&gt;Expose Service&lt;/strong&gt; is applied when a service has been only a dependency but should be used as a top level service. We start with the well known example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?xml version=&amp;#34;1.0&amp;#34;?&amp;#62;
&amp;#60;container xmlns=&amp;#34;http://www.symfony-project.org/schema/dic/services&amp;#34;&amp;#62;
    &amp;#60;services&amp;#62;
        &amp;#60;service name=&amp;#34;example.client&amp;#34; class=&amp;#34;Example\Client&amp;#34;&amp;#62;
            &amp;#60;call method=&amp;#34;setDependency&amp;#34;&amp;#62;
                &amp;#60;argument type=&amp;#34;service&amp;#34;&amp;#62;
                    &amp;#60;service class=&amp;#34;Example\Dependency&amp;#34;/&amp;#62;
                &amp;#60;/argument&amp;#62;
            &amp;#60;/call&amp;#62;
        &amp;#60;/service&amp;#62;
    &amp;#60;/services&amp;#62;
&amp;#60;/container&amp;#62;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Consider we want to expose &lt;code&gt;Example\Dependency&lt;/code&gt; as a service directly, we need to change from the configuration above to&lt;br /&gt;
reference the service by ID.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#60;?xml version=&amp;#34;1.0&amp;#34;?&amp;#62;
&amp;#60;container xmlns=&amp;#34;http://www.symfony-project.org/schema/dic/services&amp;#34;&amp;#62;
    &amp;#60;services&amp;#62;
        &amp;#60;service name=&amp;#34;example.dependency&amp;#34; class=&amp;#34;Example\Dependency&amp;#34;/&amp;#62;
        &amp;#60;service name=&amp;#34;example.client&amp;#34; class=&amp;#34;Example\Client&amp;#34;&amp;#62;
            &amp;#60;call method=&amp;#34;setDependency&amp;#34;&amp;#62;
                &amp;#60;argument type=&amp;#34;service&amp;#34; id=&amp;#34;example.dependency&amp;#34;/&amp;#62;
            &amp;#60;/call&amp;#62;
        &amp;#60;/service&amp;#62;
    &amp;#60;/services&amp;#62;
&amp;#60;/container&amp;#62;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Simple.&lt;/p&gt;

	&lt;p&gt;Next topics would be: &lt;strong&gt;Introduce Parameter&lt;/strong&gt;, &lt;strong&gt;Parametererize Service&lt;/strong&gt; and &lt;strong&gt;Allow Environment Specific configuration&lt;/strong&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 19 Apr 2011 21:58:18 +0200</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/926-guid.html</guid>
    <category>Patterns</category>
<category>PHP</category>
<category>Refactoring</category>
<category>Symfony</category>

</item>
<item>
    <title>PECL MogileFs 0.8.1 released</title>
    <link>http://usrportage.de/archives/925-PECL-MogileFs-0.8.1-released.html</link>
    
    <comments>http://usrportage.de/archives/925-PECL-MogileFs-0.8.1-released.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=925</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=925</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    	&lt;p&gt;On Wednesday version 0.8.1 of &lt;a href=&quot;http://pecl.php.net/mogilefs&quot;&gt;&lt;span class=&quot;caps&quot;&gt;PECL&lt;/span&gt; MogileFs&lt;/a&gt; has been released. The new version features a few important changes and fixes:&lt;/p&gt;

	&lt;ul&gt;
		&lt;li&gt;Changing timeout parameter for &lt;code&gt;MogileFs::connect()&lt;/code&gt; to float to allow specifying microseconds. This is an important change if you want to do connection pooling for your trackers in &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;. You can now limit the time the client tries to connect to a tracker and connect to an alternative one if this fails&lt;/li&gt;
		&lt;li&gt;Connect timeout does not set read timeout. This change became necessary with the better connect timeout handling and is the whole reason there is a 0.8.&lt;strong&gt;1&lt;/strong&gt;. The previous assumption was to reuse the connect timeout as read timeout. This is no longer feasible. If somebody needs the functionality of setting a specific read timeout, I would be happy to implement that as a specific option though. I personally have no use for it.&lt;/li&gt;
		&lt;li&gt;Fixing arginfo for &lt;code&gt;MogileFs::put()&lt;/code&gt;. You dawg, I’ve heard you like reflections. So I’ve put some reflection into your reflection so you can reflect while you reflect&lt;/li&gt;
		&lt;li&gt;Adding read timeout handling. Andre Pascha of &lt;a href=&quot;http://www.kwick.de/&quot;&gt;Kwick&lt;/a&gt; provided a patch for better read timeout handling. Previously read timeouts were silently ignored, this behavior has been fixed. Thanks!&lt;/li&gt;
		&lt;li&gt;Adding &lt;span class=&quot;caps&quot;&gt;EOF&lt;/span&gt; check before reading/writing to a socket (Andre Pascha)&lt;/li&gt;
	&lt;/ul&gt;

	&lt;p&gt;Also it’s marked as &amp;#8220;beta&amp;#8221; I’m fairly confident with this release. We already upgraded production environments to the newest version, so you could too.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sat, 19 Feb 2011 07:15:43 +0100</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/925-guid.html</guid>
    <category>MogileFS</category>
<category>PECL</category>
<category>PHP</category>

</item>
<item>
    <title>Suizidal</title>
    <link>http://usrportage.de/archives/924-Suizidal.html</link>
    
    <comments>http://usrportage.de/archives/924-Suizidal.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=924</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=924</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    	&lt;p&gt;Die &lt;span class=&quot;caps&quot;&gt;GWUP&lt;/span&gt;, die Gesellschaft zur wissenschaftlichen Erforschung von Parawissenschaften, plant kommenden Samstag massenweißes &lt;a href=&quot;http://www.gwup.org/infos/themen-nach-gebiet77-komplementaer-und-alternativmedizin-cam/1025-nichts-drin-nichts-dran&quot;&gt;Homöopathie-Pillen-Geschlucke&lt;/a&gt;. In München wird auch geschluckt.&lt;/p&gt;

	&lt;p&gt;(via &lt;a href=&quot;http://blog.koehntopp.de/archives/3026-Zehn-hoch-23-die-UEberdosis.html&quot;&gt;Kristian Köhntopp&lt;/a&gt;)&lt;/p&gt; 
    </content:encoded>

    <pubDate>Wed, 02 Feb 2011 19:13:37 +0100</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/924-guid.html</guid>
    <category>Anthroposophie</category>
<category>Homöopathie</category>
<category>Science</category>

</item>
<item>
    <title>PHP segfaulting with pecl/uuid and pecl/imagick</title>
    <link>http://usrportage.de/archives/922-PHP-segfaulting-with-pecluuid-and-peclimagick.html</link>
    
    <comments>http://usrportage.de/archives/922-PHP-segfaulting-with-pecluuid-and-peclimagick.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=922</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=922</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    	&lt;p&gt;Ran into a bug yesterday, where &lt;a href=&quot;pecl/uuid&quot;&gt;http://pecl.php.net/uuid&lt;/a&gt; in combination with &lt;a href=&quot;pecl/imagick&quot;&gt;http://pecl.php.net/imagick&lt;/a&gt; yielded a segfault when using &lt;code&gt;uuid_create()&lt;/code&gt;. &lt;span class=&quot;caps&quot;&gt;GDB&lt;/span&gt; backtrace looks like this (without the exact place where it happens in libuuid, as there is unfortunatly no &lt;code&gt;libuuid1-dbg&lt;/code&gt;-package in current Ubuntu versions):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gdb --silent --ex run --args php -r &amp;#34;var_dump(uuid_create());&amp;#34;
#0  0xb6e85321 in ?? () from /lib/libuuid.so.1
#1  0xb6e862bf in uuid_generate () from /lib/libuuid.so.1
#2  0xb6bcc67a in zif_uuid_create (ht=0, return_value=0xbffff1e8, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at /usr/src/pecl-uuid-trunk/uuid.c:182
#3  0x0835d26a in zend_do_fcall_common_helper_SPEC (execute_data=0x894ed4c) at /build/buildd/php5-5.3.2/Zend/zend_vm_execute.h:313
#4  0x08333d8e in execute (op_array=0x891c464) at /build/buildd/php5-5.3.2/Zend/zend_vm_execute.h:104
#5  0x082fe283 in zend_eval_stringl (str=0xbffff998 &amp;#34;var_dump(uuid_create());&amp;#34;, str_len=24, retval_ptr=0x0, string_name=0x871f2fc &amp;#34;Command line code&amp;#34;)
    at /build/buildd/php5-5.3.2/Zend/zend_execute_API.c:1172
#6  0x082fe422 in zend_eval_stringl_ex (str=0xbffff998 &amp;#34;var_dump(uuid_create());&amp;#34;, str_len=24, retval_ptr=0x0, string_name=0x871f2fc &amp;#34;Command line code&amp;#34;, handle_exceptions=1)
    at /build/buildd/php5-5.3.2/Zend/zend_execute_API.c:1214
#7  0x082fe4a3 in zend_eval_string_ex (str=0xbffff998 &amp;#34;var_dump(uuid_create());&amp;#34;, retval_ptr=0x0, string_name=0x871f2fc &amp;#34;Command line code&amp;#34;, handle_exceptions=1)
    at /build/buildd/php5-5.3.2/Zend/zend_execute_API.c:1225
#8  0x083a0579 in main (argc=3, argv=0xbffff854) at /build/buildd/php5-5.3.2/sapi/cli/php_cli.c:1235
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The interesting thing is, the crash happens in libuuid, but only if imagick is enabled. Let’s see what Valgrind says:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;valgrind -q  php -r &amp;#34;var_dump(uuid_create());&amp;#34;
==25103== Invalid write of size 2
==25103==    at 0x5517321: ??? (in /lib/libuuid.so.1.3.0)
==25103==    by 0x55182BE: uuid_generate (in /lib/libuuid.so.1.3.0)
==25103==    by 0x57D0679: zif_uuid_create (uuid.c:182)
==25103==    by 0x835D269: zend_do_fcall_common_helper_SPEC (in /usr/bin/php5)
==25103==    by 0x8333D8D: execute (/build/buildd/php5-5.3.2/Zend/zend_vm_execute.h:104)
==25103==    by 0x82FE282: zend_eval_stringl (/build/buildd/php5-5.3.2/Zend/zend_execute_API.c:1172)
==25103==    by 0x82FE421: zend_eval_stringl_ex (/build/buildd/php5-5.3.2/Zend/zend_execute_API.c:1214)
==25103==    by 0x82FE4A2: zend_eval_string_ex (/build/buildd/php5-5.3.2/Zend/zend_execute_API.c:1225)
==25103==    by 0x83A0578: main (/build/buildd/php5-5.3.2/sapi/cli/php_cli.c:1235)
==25103==  Address 0x30 is not stack&amp;#39;d, malloc&amp;#39;d or (recently) free&amp;#39;d
==25103== 
==25103== 
==25103== Process terminating with default action of signal 11 (SIGSEGV)
==25103==  Access not within mapped region at address 0x30
==25103==    at 0x5517321: ??? (in /lib/libuuid.so.1.3.0)
==25103==    by 0x55182BE: uuid_generate (in /lib/libuuid.so.1.3.0)
==25103==    by 0x57D0679: zif_uuid_create (uuid.c:182)
==25103==    by 0x835D269: zend_do_fcall_common_helper_SPEC (in /usr/bin/php5)
==25103==    by 0x8333D8D: execute (/build/buildd/php5-5.3.2/Zend/zend_vm_execute.h:104)
==25103==    by 0x82FE282: zend_eval_stringl (/build/buildd/php5-5.3.2/Zend/zend_execute_API.c:1172)
==25103==    by 0x82FE421: zend_eval_stringl_ex (/build/buildd/php5-5.3.2/Zend/zend_execute_API.c:1214)
==25103==    by 0x82FE4A2: zend_eval_string_ex (/build/buildd/php5-5.3.2/Zend/zend_execute_API.c:1225)
==25103==    by 0x83A0578: main (/build/buildd/php5-5.3.2/sapi/cli/php_cli.c:1235)
==25103==  If you believe this happened as a result of a stack
==25103==  overflow in your program&amp;#39;s main thread (unlikely but
==25103==  possible), you can try to increase the size of the
==25103==  main thread stack using the --main-stacksize= flag.
==25103==  The main thread stack size used in this run was 8388608.
Segmentation fault
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Not really any more helpful. After two hours debugging the issue with the help of &lt;a href=&quot;http://valokuva.org/&quot;&gt;Mikko&lt;/a&gt; and &lt;a href=&quot;http://blog.thepimp.net/&quot;&gt;Pierre&lt;/a&gt; we found out, that pecl/imagick is linked against libuuid too:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ldd /usr/lib/php5/20090626+lfs/imagick.so
    (...)
    libuuid.so.1 =&amp;#62; /lib/libuuid.so.1 (0xb7086000)
    (...)
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;For whatever reason this is happening, this is most likely the root cause of the issue.&lt;/p&gt;

	&lt;h3&gt;Solution (sort of)&lt;/h3&gt;

	&lt;p&gt;pecl/uuid was loaded by &lt;code&gt;/etc/php5/conf.d/uuid.ini&lt;/code&gt; and pecl/imagick by &lt;code&gt;/etc/php5/conf.d/imagick.ini&lt;/code&gt;. As they are loaded in there alphabetical order, imagick initialized before uuid. Renaming &lt;code&gt;/etc/php5/conf.d/uuid.ini&lt;/code&gt; to  &lt;code&gt;/etc/php5/conf.d/00-uuid.ini&lt;/code&gt; fixed the issue, as uuid is than initialized before imagick and the segmentation fault was gone.&lt;br /&gt;
Not sure about that, but maybe it would be a good idea to check in &lt;code&gt;PHP_MINIT(uuid)&lt;/code&gt; in pecl/uuid if pecl/imagick has been initialized before and warn the user about it?&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 05 Sep 2010 13:24:02 +0200</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/922-guid.html</guid>
    <category>Bug</category>
<category>imagick</category>
<category>PHP</category>
<category>Segmentation Fault</category>
<category>uuid</category>

</item>
<item>
    <title>Proof of Concept: Binary packed UUIDs as primary keys with Doctrine2 and MySQL</title>
    <link>http://usrportage.de/archives/921-Proof-of-Concept-Binary-packed-UUIDs-as-primary-keys-with-Doctrine2-and-MySQL.html</link>
    
    <comments>http://usrportage.de/archives/921-Proof-of-Concept-Binary-packed-UUIDs-as-primary-keys-with-Doctrine2-and-MySQL.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=921</wfw:comment>

    <slash:comments>7</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=921</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    	&lt;h3&gt;The Problem&lt;/h3&gt;

	&lt;p&gt;For a project I need non-guessable synthetic primary keys. I will use them to construct URIs and these URIs need to be non-guessable. If I would use the traditional way of doing so, going the down the route of integer primary keys with auto increments, or using a sequence table an attacker could easily increment or decrement the integer to find some similar items. Next idea was to use UUIDs or GUIDs. These identifiers are globally unique, so this would work for primary keys too. Reading some &lt;a href=&quot;http://www.mysqlperformanceblog.com/2007/03/13/to-uuid-or-not-to-uuid/&quot;&gt;documentation&lt;/a&gt; on the topic brought up the interesting issue of space usage. Storing the UUIDs in a &lt;span class=&quot;caps&quot;&gt;CHAR&lt;/span&gt; column would be a huge waste of space compared to an integer primary key. As primary keys are referenced in related table, this would be a huge issue. Finally I found a trick storing there binary representation in a &lt;acronym title=&quot;16&quot;&gt;BINARY&lt;/acronym&gt; column. Doing that in MySQL is fairly easy:&lt;/p&gt;

&lt;pre&gt;INSERT INTO items SET id = UNHEX(REPLACE(UUID(), &amp;#39;-&amp;#39;, &amp;#39;&amp;#39;);
&lt;/pre&gt;

	&lt;p&gt;Selecting a human readable reasult is easy too:&lt;/p&gt;

&lt;pre&gt;SELECT HEX(id) FROM items;
&lt;/pre&gt;

	&lt;p&gt;Achieving the same thing in &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; is pretty straightforward too. You need the &lt;a href=&quot;http://pecl.php.net/package/uuid&quot;&gt;&lt;span class=&quot;caps&quot;&gt;PECL&lt;/span&gt; extension UUID&lt;/a&gt; (&lt;code&gt;pecl install uuid&lt;/code&gt;) and &lt;code&gt;pack()/unpack()&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&amp;#60;?php
$uuid = uuid_create(UUID_TYPE_TIME);
$uuid = str_replace(&amp;#34;-&amp;#34;, &amp;#34;&amp;#34;, $uuid);
var_dump(pack(&amp;#39;H*&amp;#39;, $uuid));
&lt;/pre&gt;

&lt;pre&gt;string(16) &amp;#34;?Irp??ߐ
                   )??m&amp;#34;
&lt;/pre&gt;

	&lt;p&gt;Converting them back into there hex representation is similar:&lt;/p&gt;

&lt;pre&gt;&amp;#60;?php
var_dump(array_shift(unpack(&amp;#39;H*&amp;#39;, $binaryUuid)));
&lt;/pre&gt;

&lt;pre&gt;string(32) &amp;#34;d2f268509db211df9010000c29abf06d&amp;#34;
&lt;/pre&gt;

	&lt;h3&gt;Doctrine2 integration&lt;/h3&gt;

	&lt;p&gt;Next step would be integration with &lt;a href=&quot;http://www.doctrine-project.org/&quot;&gt;Doctrine2&lt;/a&gt;. To do so, we need to create a &lt;a href=&quot;http://www.doctrine-project.org/projects/dbal/2.0/docs/reference/types/en#custom-mapping-types&quot;&gt;custom mapping type&lt;/a&gt;. I&amp;#8217;m not using Doctrine2 for  database abstraction, but for it’s object relational mapping capabilities so I ignore portability and concentrate on MySQL.&lt;/p&gt;

&lt;pre&gt;&amp;#60;?php
namespace Lars\Doctrine2\Types\Mysql;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
 
class BinaryType extends Type
{
    const BINARY = &amp;#39;binary&amp;#39;;
 
    public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
    {
        return sprintf(&amp;#39;BINARY(%d)&amp;#39;, $fieldDeclaration[&amp;#39;length&amp;#39;]);
    }
 
    public function getName()
    {       
        return self::BINARY;
    }   
      
    public function convertToPhpValue($value, AbstractPlatform $platform)
    {
        if ($value !== null) {
            $value= unpack(&amp;#39;H*&amp;#39;, $value);
            return array_shift($value);
        }
    }
 
    public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if ($value !== null) {
            return pack(&amp;#39;H*&amp;#39;, $value);
        }
    }
}
&lt;/pre&gt;

	&lt;p&gt;Now we are introducing the new type to Doctrine2 somewhere in our setup logic:&lt;/p&gt;

&lt;pre&gt;&amp;#60;?php
use Doctrine\DBAL\Types\Type;
Type::addType(&amp;#39;binary&amp;#39;, &amp;#39;Lars\Doctrine2\Types\Mysql\BinaryType&amp;#39;);
&lt;/pre&gt;

	&lt;p&gt;One issue I stumbled upon was the default Doctrine2 does. With MySQL it maps binary types to intermediate blob types (in the Doctrine2 type system). This default behavior is not configurable, so we need to patch &lt;code&gt;Doctrine\DBAL\Schema\MySqlSchemaManager&lt;/code&gt;. I’m sure there is a more elegant way and I would love to receive some remarks here:&lt;/p&gt;

&lt;pre&gt;            case &amp;#39;tinyblob&amp;#39;:
            case &amp;#39;mediumblob&amp;#39;:
            case &amp;#39;longblob&amp;#39;:
            case &amp;#39;blob&amp;#39;:
            /** 
             * Commented out to make our custom mapping work
             * case &amp;#39;binary&amp;#39;:
             */         
            case &amp;#39;varbinary&amp;#39;:
                $type = &amp;#39;blob&amp;#39;;
                $length = null;
                break;
&lt;/pre&gt;

	&lt;p&gt;Last part is our entity:&lt;/p&gt;

&lt;pre&gt;&amp;#60;?php
namespace Lars\User\Domain;
 
/**
 * @Entity
 * @Table(name=&amp;#34;user&amp;#34;,indexes={@Index(name=&amp;#34;user_email_idx&amp;#34;,columns={&amp;#34;user_email&amp;#34;})})
 * @HasLifecycleCallbacks
 */
class User
{
    /**
     * @Id
     * @Column(type=&amp;#34;binary&amp;#34;,length=16,name=&amp;#34;user_id&amp;#34;)
     * @GeneratedValue(strategy=&amp;#34;NONE&amp;#34;)
     */
    protected $_id;
 
    /**
     * @Column(type=&amp;#34;string&amp;#34;,length=32,name=&amp;#34;user_email&amp;#34;)
     */
    protected $_email;
 
    public function changeEmail($email)
    {
        $this-&amp;#62;_email = $email;
        return $this;
    }
 
    public function getId()
    {
        return $this-&amp;#62;_id;
    }
 
    /**
     * @PrePersist
     */
    public function generateUuid()
    {
        $this-&amp;#62;_id = str_replace(&amp;#39;-&amp;#39;, &amp;#39;&amp;#39;, uuid_create(UUID_TYPE_TIME));
    }
}
&lt;/pre&gt;

	&lt;p&gt;The important part here is the &lt;code&gt;createUuid()&lt;/code&gt;-method to generate the &lt;span class=&quot;caps&quot;&gt;UUID&lt;/span&gt; once before persisting the domain object. With &lt;code&gt;GeneratedValue(strategy=&amp;#34;NONE&amp;#34;)&lt;/code&gt; we told Doctrine not to generate the ID by itself and with &lt;code&gt;HasLifecycleCallbacks&lt;/code&gt; we configure Doctrine to scan for lifecycle callback methods, so that &lt;code&gt;generateUuid()&lt;/code&gt; will be called before persisting the entity.&lt;/p&gt;

	&lt;p&gt;Fetching an object by ID is as easy as ever, but don&amp;#8217;t forget to convert the ID:&lt;/p&gt;

&lt;pre&gt;$user = $em-&amp;#62;find(
    &amp;#39;Lars\User\Domain\User&amp;#39;,
    pack(&amp;#39;H*&amp;#39;, &amp;#39;16aec29e9db011df8013000c29abf06d&amp;#39;)
);
&lt;/pre&gt;

	&lt;h3&gt;Further ideas&lt;/h3&gt;

	&lt;p&gt;The whole &lt;span class=&quot;caps&quot;&gt;UUID&lt;/span&gt; should be refactored towards an &lt;span class=&quot;caps&quot;&gt;UUID&lt;/span&gt; value object to encapsulate &lt;span class=&quot;caps&quot;&gt;UUID&lt;/span&gt; creation and binary conversion.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 01 Aug 2010 23:04:24 +0200</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/921-guid.html</guid>
    <category>Doctrine</category>
<category>MySQL</category>
<category>ORM</category>
<category>PHP</category>

</item>
<item>
    <title>Meine Lieblingsalben 2000 – 2009</title>
    <link>http://usrportage.de/archives/920-Meine-Lieblingsalben-2000-2009.html</link>
    
    <comments>http://usrportage.de/archives/920-Meine-Lieblingsalben-2000-2009.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=920</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=920</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    &lt;p&gt;
Zur Jahreswende ist es Zeit auf die letzten zehn Jahre Popmusik zu schauen. Allen ein gutes neues Jahr zu wünschen,
wann auch immer es in den jeweiligen Kalendern beginnt.
&lt;/p&gt;

&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;20&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Matisyahu&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Youth&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2005&lt;/span&gt;
  &lt;/h3&gt;
  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B000BYCOD6?tag=usr-21&quot;&gt;&lt;img
      src=&quot;http://usrportage.de/uploads/0er/2005-matisyahu-youth.jpg&quot;
      class=&quot;cover&quot;
      alt=&quot;Matisyahu – Youth&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;19&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Joanna Newsom&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Ys&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2006&lt;/span&gt;
  &lt;/h3&gt;
  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B000I2K9M4?tag=usr-21&quot;&gt;&lt;img
      src=&quot;http://usrportage.de/uploads/0er/2006-joanna-newsom-ys.jpg&quot;
      class=&quot;cover&quot;
      alt=&quot;Joanna Newsom — Ys&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;18&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;The Shins&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Oh, Inverted World&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2001&lt;/span&gt;
  &lt;/h3&gt;
  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B00005JSHW?tag=usr-21&quot;&gt;&lt;img
      src=&quot;http://usrportage.de/uploads/0er/2007-the-shins-oh-inverted-world.jpg&quot;
      class=&quot;cover&quot;
      alt=&quot;The Shins - Oh, Inverted World&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;17&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Rufus Wainwright&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Release the Stars&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2007&lt;/span&gt;
  &lt;/h3&gt;
  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B000O78LH8?tag=usr-21&quot;&gt;&lt;img
      src=&quot;http://usrportage.de/uploads/0er/2007-rufus-wainwright-release-the-stars.jpg&quot;
      class=&quot;cover&quot;
      alt=&quot;Rufus Wainwright - Release the Stars&quot;/&gt;&lt;/a&gt;

&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;16&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Architecture in Helsinki&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Fingers Crossed&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2003&lt;/span&gt;
  &lt;/h3&gt;
  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B0001JXPDE?tag=usr-21&quot;&gt;&lt;img
      src=&quot;http://usrportage.de/uploads/0er/2003-architecture-in-helsinki-fingers-crossed.jpg&quot;
      class=&quot;cover&quot;
      alt=&quot;Architecture in Helsinki - Fingers Crossed&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;15&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Morrissey&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Years of Refusal&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2009&lt;/span&gt;
  &lt;/h3&gt;
  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B001O9CR5M?tag=usr-21&quot;&gt;&lt;img
      src=&quot;http://usrportage.de/uploads/0er/2009-morrissey-years-of-refusal.jpg&quot;
      class=&quot;cover&quot;
      alt=&quot;Morrissey - Years of Refusal&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;14&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Editors&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;The Back Room&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2005&lt;/span&gt;
  &lt;/h3&gt;
  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B0009YA386?tag=usr-21&quot;&gt;&lt;img
      src=&quot;http://usrportage.de/uploads/0er/2005-editors-the-back-room.jpg&quot;
      class=&quot;cover&quot;
      alt=&quot;Editors - The Back Room&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;13&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;The Kooks&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Inside In/Inside Out&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2006&lt;/span&gt;
  &lt;/h3&gt;
  &lt;a
  href=&quot;http://www.amazon.de/gp/product/B000HEWFRK?tag=usr-21&quot;&gt;&lt;img
  src=&quot;http://usrportage.de/uploads/0er/2006-the-kooks-inside-in-inside-out.jpg&quot;
  class=&quot;cover&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;12&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Gossip&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Standing in the Way of Control&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2006&lt;/span&gt;
  &lt;/h3&gt;
  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B000RI0UTG?tag=usr-21&quot;&gt;&lt;img
      src=&quot;http://usrportage.de/uploads/0er/2006-gossip-standing-in-the-way-of-control.jpg&quot;
      class=&quot;cover&quot;
      alt=&quot;Gossip – Standing in the Way of Control&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;11&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;The Good, The Bad &amp;amp; The Queen&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;The Good, The Bad &amp;amp; The Queen&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2007&lt;/span&gt;
  &lt;/h3&gt;
  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B000LXST5O?tag=usr-21&quot;&gt;&lt;img
      src=&quot;http://usrportage.de/uploads/0er/2007-tgbq.jpg&quot;
      class=&quot;cover&quot;
      alt=&quot;The Good, The Bad &amp;amp; The Queen - The Good, The Bad &amp;amp; The Queen&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
      &lt;span class=&quot;position&quot;&gt;10&lt;/span&gt;
      &lt;span class=&quot;artist&quot;&gt;The Knife&lt;/span&gt;
      &lt;span class=&quot;album&quot;&gt;Deep Cuts&lt;/span&gt;
      &lt;span class=&quot;year&quot;&gt;2003&lt;/span&gt;
    &lt;/h3&gt;

    &lt;a
      href=&quot;http://www.amazon.de/gp/product/B000F1HGN8?tag=usr-21&quot;&gt;&lt;img
        src=&quot;http://usrportage.de/uploads/0er/2003-the-knife-deep-cuts.jpg&quot;
        alt=&quot;The Knife – Deep Cuts&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;09&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Element of Crime&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Mittelpunkt der Welt&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2005&lt;/span&gt;
  &lt;/h3&gt;
  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B000B8ITC2?tag=usr-21&quot;&gt;&lt;img
      src=&quot;http://usrportage.de/uploads/0er/2005-element-of-crime-mittelpunkt-der-welt.jpg&quot;
      class=&quot;cover&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;08&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Bloc Party&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Intimacy&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2008&lt;/span&gt;
  &lt;/h3&gt;

  &lt;a
  href=&quot;http://www.amazon.de/gp/product/B001EKNYG2?tag=usr-21&quot;&gt;&lt;img
  src=&quot;http://usrportage.de/uploads/0er/2008-bloc-party-intimacy.jpg&quot;
  class=&quot;cover&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;07&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Arctic Monkeys&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Whatever People Say I Am, That&#039;s What I’m Not&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2006&lt;/span&gt;
  &lt;/h3&gt;
  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B000BTDMDC?tag=usr-21&quot;&gt;&lt;img
      src=&quot;http://usrportage.de/uploads/0er/2006-arctic-monkeys.jpg&quot;
      class=&quot;cover&quot;
      alt=&quot;Arctic Monkeys — Whatever People Say I Am, That&#039;s What I’m Not&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
    &lt;h3&gt;
      &lt;span class=&quot;position&quot;&gt;06&lt;/span&gt;
      &lt;span class=&quot;artist&quot;&gt;Maxïmo Park&lt;/span&gt;
      &lt;span class=&quot;album&quot;&gt;Our Earthly Pleasures&lt;/span&gt;
      &lt;span class=&quot;year&quot;&gt;2007&lt;/span&gt;
    &lt;/h3&gt;

    &lt;a
    href=&quot;http://www.amazon.de/gp/product/B000MV9NC8?tag=usr-21&quot;&gt;&lt;img
    src=&quot;http://usrportage.de/uploads/0er/2007-maximo-park-our-earthly-pleasures.jpg&quot;
    class=&quot;cover&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;05&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Johnny Cash&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;American V: A Hundred Highways&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2000&lt;/span&gt;
  &lt;/h3&gt;

  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B0002W18MU?tag=usr-21&quot;&gt;&lt;img
      class=&quot;cover&quot;
      src=&quot;http://usrportage.de/uploads/0er/2006-johnny-cash-american-v-a-hundred-highways.jpg&quot;
      alt=&quot;Cover: Johnny Cash – American V: A Hundred Highways&quot; /&gt;&lt;/a&gt;

  &lt;p&gt;
    Mit der Veröffentlichung von &lt;q&gt;American V: A Hundred Highway&lt;/q&gt; nach dem Tod Johnny Cashs geht ein Stück
    Musikgeschichte zu Ende. Die &lt;q&gt;American Recordings&lt;/q&gt;-Serie zeigt Cash auf dem Höhepunkt seines musikalischen
    Schaffens. Wer hat nicht wenigstens eins dieser Stück gehört und nicht wieder vergessen: &lt;q&gt;The Beast In Me&lt;/q&gt;,
    &lt;q&gt;Bird On A Wire&lt;/q&gt;, &lt;q&gt;I See a Darkness&lt;/q&gt;, &lt;q&gt;I Won’t Back Down&lt;/q&gt;, &lt;q&gt;The Mercy Seat&lt;/q&gt;, &lt;q&gt;Solitary Man&lt;/q&gt;.
  &lt;/p&gt;

  &lt;p&gt;
    Den Tracks des letzten Albums ist der Gesundheitszustand Cashs aufgeprägt: seine brüchige Stimme verstärkt
    die Melancholie, die der ganzen Serie anhaftet. Unvergessen das Celebrity-Tribute-Video zu &lt;q&gt;God’s Gonna Cut You
    Down&lt;/q&gt;.
  &lt;/p&gt;

  &lt;object width=&quot;350&quot; height=&quot;230&quot;&gt;
    &lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/7auzYgVosJA&amp;amp;hl=de_DE&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot;&gt;&lt;/param&gt;
    &lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;
    &lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;
    &lt;embed
      src=&quot;http://www.youtube.com/v/7auzYgVosJA&amp;amp;hl=de_DE&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot;
      type=&quot;application/x-shockwave-flash&quot;
      allowscriptaccess=&quot;always&quot;
      allowfullscreen=&quot;true&quot;
      width=&quot;350&quot;
      height=&quot;230&quot;&gt;
    &lt;/embed&gt;
  &lt;/object&gt;

  &lt;p&gt;
    Die letzte Platte ist nicht die beste der Serie, sie ist aber sicher die beeindruckenste. Ob aus
    pragmatisch-ökonomischen Gründen, wie bei Veröffentlichung gelästert wurde, oder aus edleren Motiven: ein Album zu
    veröffentlichen, auf dem deutlich zu hören ist, dass es das letzte sein wird, zwingt den Zuhörer zu irgendeiner Art
    von Reaktion. Und wem Cashs Musik etwas bedeutet, der wird gerade dieses Album in seiner bitteren Süße genießen.
  &lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;04&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Modest Mouse&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Good News for People Who Love Bad News&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2004&lt;/span&gt;
  &lt;/h3&gt;

  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B0001M6GBY?tag=usr-21&quot;&gt;&lt;img
      src=&quot;http://usrportage.de/uploads/0er/2004-modest-mouse-good-news-for-people-who-love-bad-news.jpg&quot;
      alt=&quot;Modest Mouse – Good News for People Who Love Bad News&quot;
      class=&quot;cover&quot;/&gt;&lt;/a&gt;

  &lt;p&gt;
    Wenn wir schon bei Rockmusik sind: im Sommer 2007 empfahl mir ein Bekannter Modest Mouse als ein wenig verspult
    aber &lt;q&gt;interessanter Sound&lt;/q&gt;. Und er meinte nicht
    nicht &lt;q&gt;picky&lt;/q&gt;-interessant, sondern &lt;q&gt;interessant-interessant&lt;/q&gt;. Also hörte ich mir das an und reagierte
    erstmal zurückhaltend. Ja, lustiger Albumtitel, ja, Musik ist Okay aber mehr war erstmal nicht. Aus heute nicht mehr
    nachvollziehbaren Gründen hörte ich das Album aber weiterhin an und irgendwann gefiel es dann doch. Sogar ziemlich
    gut. Jedenfalls so gut, dass ich kurz darauf Modest Mouse live sah, mir den Rest Ihrer Alben besorgte und immer
    weiter hörte.
  &lt;/p&gt;

  &lt;p&gt;
    &lt;q&gt;Good News for People Who Love Bad News&lt;/q&gt; klingt wie heiser und aggresiv – wie Musik manchmal sein muss. Die
    Gitarren schrammeln, das Schlagzeug treibt, Rockstruktur halt.
  &lt;/p&gt;

  &lt;h4&gt;Lieblingstitel&lt;/h4&gt;
  &lt;ul class=&quot;tips&quot;&gt;
    &lt;li&gt;02: World At Large&lt;/li&gt;
    &lt;li&gt;03: Float On&lt;/li&gt;
    &lt;li&gt;06: Bury Me With It&lt;/li&gt;
    &lt;li&gt;08: Bukowski&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;03&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Eels&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Souljacker&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2001&lt;/span&gt;
  &lt;/h3&gt;

  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B00005OM5F?tag=usr-21&quot;&gt;&lt;img
      src=&quot;http://usrportage.de/uploads/0er/2001-eels-souljacker.jpg&quot;
      class=&quot;cover&quot;
      alt=&quot;Eels – Souljacker&quot;/&gt;&lt;/a&gt;

    &lt;p&gt;
      &lt;q&gt;Life ain’t pretty for a dog faced boy&lt;/q&gt; heißt es im Refrain von &lt;q&gt;Dog Faced Boy&lt;/q&gt;. &lt;q&gt;Life ain’t pretty
      for the E man&lt;/q&gt; würde genauso passen.
    &lt;/p&gt;

    &lt;p&gt;
      Mark Oliver Everett hat mit Eels bis heute eine Reihe von Platten hingelegt, die so unfassbar gut sind, dass
      selbst die schlechten noch die musikalische Konkurrenz bei weitem übertreffen. Aber über die schlechteren wollen
      wir nicht reden, wir reden über Souljacker. Souljacker ist deswegen so interessant, weil es all dass, das Eels
      kann, auf eine Platte presst. Da geht es krächzend los mit &lt;q&gt;Dog Faced Boy&lt;/q&gt; und &lt;q&gt;That’s not Really
      Funny&lt;/q&gt;, dann folgen &lt;q&gt;Fresh Feeling&lt;/q&gt; und &lt;q&gt;Woman Driving, Man Sleeping&lt;/q&gt; ganze ruhige Stücke, die sogar
      mit Streichern umso besser funktionieren, nur um wieder von einem klassischen Rock-Arrangement, nämlich
      &lt;q&gt;Souljacker I&lt;/q&gt;, abgelöst zu werden. In &lt;q&gt;Friendly Ghost&lt;/q&gt; verschmelzen die beiden Stilrichtungen und
      werden angereichtet mit Elementen des Folk zu einem netten 3:23 Stückchen.
    &lt;/p&gt;

    &lt;p&gt;
      Zwischen 2000 und 2009 sind ganze sieben Eels-Alben erschienen, nur eines zu loben wäre unaufrichtig. Souljacker
      ist die Verdichtung aller anderen Alben, die hier aber nicht unerwähnt bleiben sollen. Wer den symphonischen Teil
      weiter kennenlernen will, kann auf &lt;a
      href=&quot;http://www.amazon.de/gp/product/B000E6EIZS?tag=usr-21&quot;&gt;With
      Strings: Live at Town Hall&lt;/a&gt; Neuinterpretationen der Eels-Stücke mit Orchester lauschen, wem nach poppigen
      Arrangements zu Mute ist, der wird mit &lt;a
      href=&quot;http://www.amazon.de/dp/B00004NJL4?tag=usr-21&quot;&gt;Daisies of the Galaxy&lt;/a&gt; glücklich.
    &lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;02&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Tocotronic&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Kapitulation&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2007&lt;/span&gt;
  &lt;/h3&gt;

  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B000RG121I?tag=usr-21&quot;&gt;&lt;img
    class=&quot;cover&quot;
    src=&quot;http://usrportage.de/uploads/0er/2007-tocotronic-kapitulation.jpg&quot;
    alt=&quot;Tocotronic – Kapitulation&quot;/&gt;&lt;/a&gt;

  &lt;p&gt;
    Der deutschen Poplandschaft entsprießten um die Jahrtausendwende ein Haufen musikalisch und textlich ausbaufähiger Bands
    wie Juli, Echt, Silbermond oder Revolverheld. &lt;q&gt;Ausbaufähig&lt;/q&gt; ist eine freundliche Untertreibung, solcher Quatsch sucht
    seinesgleichen. Diese Bands mussten immer betonen, wie sehr sie von Tocotronic beeinflusst wurden. Diese Entwicklung
    griffen Tocotronic 2002 mit ihrem Album &lt;a
    href=&quot;http://www.amazon.de/gp/product/B000VI4XLI?tag=usr-21&quot;&gt;Tocotronic&lt;/a&gt;,
    auch als &lt;q&gt;Weißes Album&lt;/q&gt; bekannt, auf. Sicher auch aus dem Bedürfnis der Abgrenzung heraus wurde die
    vormalige Sloganhaftigkeit mehr und mehr verdrängt durch diffizilere, lyrische Texte.
  &lt;/p&gt;

  &lt;p&gt;
    Reise nach 2007: Seit 1998 war die Schröder-Regierung an der Macht: Deutschland war im Reformfieber, seitdem wird
    gefördert und gefordert, ohne Eigeninitiative geht gar nichts mehr. In dieses Treiben hinein veröffentlichte
    Tocotronic 2007 ihren Aufruf, den Quatsch einfach mal sein zu lassen. Nicht als aufdringliche Liedermacher-Dichtung,
    sondern als höflicher Schubser, wegzulaufen, sich zu verstecken – eben zu kapitulieren, wenn man es nicht mehr
    aushält.
  &lt;/p&gt;

  &lt;p&gt;
    Der Klang der Platte ist, trotzdem sie als Themenalbum angelegt ist, typisch für die ehemaligen Neulinge der
    Hamburger Schule: gitarrenlastig, roh. Über den Klangteppich breitet sich die Nichtstimme von Dirk von Lowtzow, die
    mal brüchig und zurückhaltend wie in &lt;q&gt;Dein geheimer Name&lt;/q&gt; oder stampfend wie in &lt;q&gt;Sag alles ab&lt;/q&gt; das
    stimmliche Spektrum der Band beleuchtet. Die Platte kann einfach als Rockmusik gehört werden, als poetisches Album
    voller versteckter Referenzen oder eben als auch als politisches Konzeptalbum. Die Vorgänger-Alben waren richtig und
    wichtig, doch nie war Tocotronic auch musikalisch so gut.
  &lt;/p&gt;

  &lt;h4&gt;Lieblingstitel&lt;/h4&gt;
  &lt;ul class=&quot;tips&quot;&gt;
    &lt;li&gt;02: Kapitulation&lt;/li&gt;
    &lt;li&gt;06: Harmonie ist eine Strategie&lt;/li&gt;
    &lt;li&gt;10: Sag alles ab&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;review&quot;&gt;
  &lt;h3&gt;
    &lt;span class=&quot;position&quot;&gt;01&lt;/span&gt;
    &lt;span class=&quot;artist&quot;&gt;Arcade Fire&lt;/span&gt;
    &lt;span class=&quot;album&quot;&gt;Neon Bible&lt;/span&gt;
    &lt;span class=&quot;year&quot;&gt;2007&lt;/span&gt;
  &lt;/h3&gt;

  &lt;a
    href=&quot;http://www.amazon.de/gp/product/B000NDDPDI?tag=usr-21&quot;&gt;&lt;img
      class=&quot;cover&quot;
      src=&quot;http://usrportage.de/uploads/0er/2007-arcade-fire-neon-bible.jpg&quot;
      alt=&quot;Arcade Fire – Neon Bible&quot;/&gt;&lt;/a&gt;

  &lt;p&gt;
    Mit &lt;q&gt;Neon Bible&lt;/q&gt; zeigten Arcade Fire 2007 was sie können: ungewöhnliche Arrangments an den Genre-Grenzen
    von Folk und Rock unterlegt mit ungewöhnlichen Instrumenten wie Orgel und Akkordeon. Was auf dem Vorgänger
    &lt;a href=&quot;http://www.amazon.de/gp/product/B0006ZRX86?tag=usr-21&quot;&gt;&lt;q&gt;Funeral&lt;/q&gt;&lt;/a&gt;
    schon anklang, Dunkelheit, Hysterie, drückende Hitze, wird hier zur Perfektion getrieben. Wer behauptet, nach Pink
    Floyd könne im Pop niemand mehr Songs die Anmutung von Opern-Arien geben, sieht sich getäuscht. Der Qualität von
    &lt;q&gt;Neon Bible&lt;/q&gt; können auch die in reaktionäre Sehnsucht sich wendenden Texte kaum etwas anhaben: zu berauschend,
    zu atemberaubend ist die Schönheit dieser Aufnahme.
  &lt;/p&gt;

  &lt;p&gt;
    Und weil ich in den letzten zehn Jahren einfach kein Album gehört habe, dass mich dermaßen gefesselt hat, muss es
    auf Platz 1 landen.
  &lt;/p&gt;

  &lt;h4&gt;Lieblingstitel&lt;/h4&gt;
  &lt;ul class=&quot;tips&quot;&gt;
    &lt;li&gt;01: Black Mirror&lt;/li&gt;
    &lt;li&gt;03: Neon Bible&lt;/li&gt;
    &lt;li&gt;04: Intervention&lt;/li&gt;
    &lt;li&gt;11: My Body is a Cage&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
 
    </content:encoded>

    <pubDate>Thu, 31 Dec 2009 15:10:36 +0100</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/920-guid.html</guid>
    <category>Arcade Fire</category>
<category>Johnny Cash</category>
<category>Music</category>
<category>Tocotronic</category>

</item>
<item>
    <title>Batch-generating SSL certificates</title>
    <link>http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html</link>
    
    <comments>http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=919</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=919</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    	&lt;p&gt;I had an itch to scratch this day: generate a huge amount of SSL-certificates for a set of whitelabels. Every whitelabel has it&amp;#8217;s own domain and needs it&amp;#8217;s own &lt;span class=&quot;caps&quot;&gt;SSL&lt;/span&gt; certificate. I don&amp;#8217;t want to spend &lt;strong&gt;n ⋅ x ¤&lt;/strong&gt; to buy them just for testing purpose (generating a huge number would have been an issue too if I bought them but &amp;#8230;). So I needed a script to do it. We had one before to generate a single one with the typical user interactions. While hacking it down I found out a few neat things about OpenSSL which I didn&amp;#8217;t know before and which I think are worth sharing.&lt;/p&gt;

	&lt;blockquote&gt;
		&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; the script is not hacked together with security in mind. It simply doesn&amp;#8217;t matter for me in this specific case.&lt;/p&gt;
	&lt;/blockquote&gt;

	&lt;p&gt;So after alot of chit-chatting, there we go:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/bin/bash
DOMAIN=&amp;#34;$1&amp;#34;
if [ -z &amp;#34;$DOMAIN&amp;#34; ]; then
    echo &amp;#34;Usage: $(basename $0) &amp;#60;domain&amp;#62;&amp;#34;
    exit 11
fi
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Obvious: we need to call the script with a domain as a parameter. Next is a simple to fail when a certain condition matches:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;fail_if_error() {
    [ $1 != 0 ] &amp;#38;&amp;#38; {
        unset PASSPHRASE
        exit 10
    }
}
export PASSPHRASE=$(head -c 128 /dev/random  | uuencode - | grep -v &amp;#34;^end&amp;#34; | tr &amp;#34;\n&amp;#34; &amp;#34;d&amp;#34;)
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;We generate a passphrase by reading 128 byte from /dev/random, encoding it with base64 and joining the lines. A simple trick if you can&amp;#8217;t rely on &lt;a href=&quot;http://sourceforge.net/projects/pwgen/&quot;&gt;pwgen&lt;/a&gt; or &lt;a href=&quot;http://people.defora.org/~khorben/projects/makepasswd/&quot;&gt;makepasswd&lt;/a&gt;. Next is to define the subject string. But we&amp;#8217;ll talk about that later:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;subj=&amp;#34;
C=&amp;#60;Country Code&amp;#62;
ST=&amp;#60;State&amp;#62;
O=&amp;#60;Company&amp;#62;
localityName=&amp;#60;City&amp;#62;
commonName=$DOMAIN
organizationalUnitName=&amp;#60;Unit Name&amp;#62;
emailAddress=&amp;#60;email&amp;#62;
&amp;#34;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Of all things generating a fresh &lt;span class=&quot;caps&quot;&gt;RSA&lt;/span&gt; key comes first. The neat trick to avoid user interaction here is to use &lt;code&gt;-passout&lt;/code&gt; option. This option takes an protocol argument similar to PHPs stream wrappers. &lt;code&gt;env:&amp;#60;envvar&amp;#62;&lt;/code&gt; for environment variables, &lt;code&gt;pass:&amp;#60;password&amp;#62;&lt;/code&gt; if you like to pass the string directly, &lt;code&gt;file:&amp;#60;filename&amp;#62;&lt;/code&gt; to read from a file, &lt;code&gt;fd:&amp;#60;number&amp;#62;&lt;/code&gt; to read from a file descriptor and &lt;code&gt;stdin&lt;/code&gt; &amp;#8211; well &amp;#8211; to read from the standard input. Of course we fail on error.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;openssl genrsa -des3 -out $DOMAIN.key -passout env:PASSPHRASE 2048
fail_if_error $?
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Now we generate a certificate request (.csr). &lt;code&gt;-batch&lt;/code&gt; simply supresses user interaction. And here comes the &lt;code&gt;$subj&lt;/code&gt; variable into play which allows us to override our certificate requests defaults specified in our &lt;code&gt;openssl.conf&lt;/code&gt;. Most of the time the OpenSSL configuration file should be located in &lt;code&gt;/etc/ssl/openssl.cnf&lt;/code&gt; but if you are on Mac OS X it is located in &lt;code&gt;/System/Library/OpenSSL/openssl.cnf&lt;/code&gt;. The subject variables you can override are defined in this configuration. It&amp;#8217;s an &lt;span class=&quot;caps&quot;&gt;INI&lt;/span&gt; file, just search for the section &lt;strong&gt;[ req ]&lt;/strong&gt; and look at the keys &lt;strong&gt;distinguished_name&lt;/strong&gt; and &lt;strong&gt;req_attributes&lt;/strong&gt;. There values redirect to the section name we are searching for: here you can find the candidates you might want to override in your subject string. Just extend the &lt;code&gt;$subj&lt;/code&gt; variable according to your needs. The &lt;code&gt;$subj&lt;/code&gt; variable lines are joined with a slash as a seperator &amp;#8211; this is how OpenSSL likes it. &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;openssl req \
    -new \
    -batch \
    -subj &amp;#34;$(echo -n &amp;#34;$subj&amp;#34; | tr &amp;#34;\n&amp;#34; &amp;#34;/&amp;#34;)&amp;#34; \
    -key $DOMAIN.key \
    -out $DOMAIN.csr \
    -passin env:PASSPHRASE
fail_if_error $?
cp $DOMAIN.key $DOMAIN.key.org
fail_if_error $?
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Strip the passphrase from our RSA-key to not get prompted when Apache (or any other webserver) starts:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;openssl rsa -in $DOMAIN.key.org -out $DOMAIN.key -passin env:PASSPHRASE
fail_if_error $?
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Last step, create the certificate file:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;openssl x509 -req -days 365 -in $DOMAIN.csr -signkey $DOMAIN.key -out $DOMAIN.crt
fail_if_error $?
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Now: deploy the &lt;strong&gt;.key&lt;/strong&gt; and &lt;strong&gt;.crt&lt;/strong&gt; file to your webserver and set up your configuration.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 14 Aug 2009 22:07:28 +0200</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/919-guid.html</guid>
    <category>OpenSSL</category>
<category>PHP</category>
<category>Security</category>
<category>SSL</category>
<category>Web</category>
<category>Webserver</category>

</item>
<item>
    <title>Dokumentation über Adorno und die Kritische Theorie</title>
    <link>http://usrportage.de/archives/917-Dokumentation-ueber-Adorno-und-die-Kritische-Theorie.html</link>
    
    <comments>http://usrportage.de/archives/917-Dokumentation-ueber-Adorno-und-die-Kritische-Theorie.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=917</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=917</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    	&lt;h3&gt;Theodor W. Adorno &amp;#8211; Dokumentation 1. Teil&lt;/h3&gt;

	&lt;p&gt;&lt;!-- xhtml clean youtube --&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; width=&quot;500&quot; height=&quot;405&quot; data=&quot;http://www.youtube.com/v/YpTkisE83c4&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/YpTkisE83c4&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/YpTkisE83c4&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;/object&gt;&lt;!-- /xhtml clean youtube --&gt;

&lt;!-- &lt;object width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/YpTkisE83c4&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/YpTkisE83c4&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&amp;amp;rel=0&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;/embed&gt;&lt;/object&gt; --&gt;

&lt;/p&gt;

	&lt;p&gt;&lt;!-- xhtml clean youtube --&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; width=&quot;500&quot; height=&quot;405&quot; data=&quot;http://www.youtube.com/v/-811TSKUPLI&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/-811TSKUPLI&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/-811TSKUPLI&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;/object&gt;&lt;!-- /xhtml clean youtube --&gt;

&lt;!-- &lt;object width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/-811TSKUPLI&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/-811TSKUPLI&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&amp;amp;rel=0&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;/embed&gt;&lt;/object&gt; --&gt;

&lt;/p&gt;

	&lt;p&gt;&lt;!-- xhtml clean youtube --&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; width=&quot;500&quot; height=&quot;405&quot; data=&quot;http://www.youtube.com/v/SIZjeKXjnaE&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/SIZjeKXjnaE&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/SIZjeKXjnaE&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;/object&gt;&lt;!-- /xhtml clean youtube --&gt;

&lt;!-- &lt;object width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/SIZjeKXjnaE&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/SIZjeKXjnaE&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&amp;amp;rel=0&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;/embed&gt;&lt;/object&gt; --&gt;

&lt;/p&gt;

	&lt;p&gt;&lt;!-- xhtml clean youtube --&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; width=&quot;500&quot; height=&quot;405&quot; data=&quot;http://www.youtube.com/v/2FiTS7Tvhcc&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/2FiTS7Tvhcc&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/2FiTS7Tvhcc&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;/object&gt;&lt;!-- /xhtml clean youtube --&gt;

&lt;!-- &lt;object width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/2FiTS7Tvhcc&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/2FiTS7Tvhcc&amp;amp;hl=de&amp;amp;fs=1&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&amp;amp;rel=0&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;/embed&gt;&lt;/object&gt; --&gt;

&lt;/p&gt;

	&lt;p&gt;&lt;!-- xhtml clean youtube --&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; width=&quot;500&quot; height=&quot;405&quot; data=&quot;http://www.youtube.com/v/8VHiMjLOq5g&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/8VHiMjLOq5g&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/8VHiMjLOq5g&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;/object&gt;&lt;!-- /xhtml clean youtube --&gt;

&lt;!-- &lt;object width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/8VHiMjLOq5g&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/8VHiMjLOq5g&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;/embed&gt;&lt;/object&gt; --&gt;

&lt;/p&gt;

	&lt;h3&gt;Theodor W. Adorno &amp;#8211; Dokumentation 2. Teil &amp;#8211; &amp;#8220;Wer denkt, ist nicht wütend&amp;#8221;
&lt;!-- xhtml clean youtube --&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; width=&quot;500&quot; height=&quot;405&quot; data=&quot;http://www.youtube.com/v/nI2Ib-KO5fI&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/nI2Ib-KO5fI&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/nI2Ib-KO5fI&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;/object&gt;&lt;!-- /xhtml clean youtube --&gt;

&lt;!-- &lt;object width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/nI2Ib-KO5fI&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/nI2Ib-KO5fI&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;/embed&gt;&lt;/object&gt; --&gt;

&lt;/h3&gt;

	&lt;p&gt;&lt;!-- xhtml clean youtube --&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; width=&quot;500&quot; height=&quot;405&quot; data=&quot;http://www.youtube.com/v/CpYVbM8l8m0&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/CpYVbM8l8m0&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/CpYVbM8l8m0&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;/object&gt;&lt;!-- /xhtml clean youtube --&gt;

&lt;!-- &lt;object width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/CpYVbM8l8m0&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/CpYVbM8l8m0&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;/embed&gt;&lt;/object&gt; --&gt;

&lt;/p&gt;

	&lt;p&gt;&lt;!-- xhtml clean youtube --&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; width=&quot;500&quot; height=&quot;405&quot; data=&quot;http://www.youtube.com/v/zalkhqtCxF8&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/zalkhqtCxF8&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/zalkhqtCxF8&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;/object&gt;&lt;!-- /xhtml clean youtube --&gt;

&lt;!-- &lt;object width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/zalkhqtCxF8&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/zalkhqtCxF8&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;/embed&gt;&lt;/object&gt; --&gt;

&lt;/p&gt;

	&lt;p&gt;&lt;!-- xhtml clean youtube --&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; width=&quot;500&quot; height=&quot;405&quot; data=&quot;http://www.youtube.com/v/YervO5K5N1U&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/YervO5K5N1U&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/YervO5K5N1U&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;/object&gt;&lt;!-- /xhtml clean youtube --&gt;

&lt;!-- &lt;object width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/YervO5K5N1U&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/YervO5K5N1U&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;/embed&gt;&lt;/object&gt; --&gt;

&lt;/p&gt;

	&lt;p&gt;&lt;!-- xhtml clean youtube --&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; width=&quot;500&quot; height=&quot;405&quot; data=&quot;http://www.youtube.com/v/aNWuO8f1w6g&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/aNWuO8f1w6g&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/aNWuO8f1w6g&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;/object&gt;&lt;!-- /xhtml clean youtube --&gt;

&lt;!-- &lt;object width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/aNWuO8f1w6g&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/aNWuO8f1w6g&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;/embed&gt;&lt;/object&gt; --&gt;

&lt;/p&gt;

	&lt;p&gt;&lt;!-- xhtml clean youtube --&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; width=&quot;500&quot; height=&quot;405&quot; data=&quot;http://www.youtube.com/v/USD8J8XsoSc&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/USD8J8XsoSc&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/USD8J8XsoSc&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;/object&gt;&lt;!-- /xhtml clean youtube --&gt;

&lt;!-- &lt;object width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/USD8J8XsoSc&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/USD8J8XsoSc&amp;amp;hl=de&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0xcc2550&amp;amp;color2=0xe87a9f&amp;amp;border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;500&quot; height=&quot;405&quot;&gt;&lt;/embed&gt;&lt;/object&gt; --&gt;

&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 31 May 2009 15:29:51 +0200</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/917-guid.html</guid>
    <category>Dokumentation</category>
<category>Kritische Theorie</category>
<category>Theodor W. Adorno</category>

</item>
<item>
    <title>An introduction to Domain Driven Design</title>
    <link>http://usrportage.de/archives/916-An-introduction-to-Domain-Driven-Design.html</link>
    
    <comments>http://usrportage.de/archives/916-An-introduction-to-Domain-Driven-Design.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=916</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=916</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    	&lt;p&gt;My collegues asked me to write down some documentation on the basic concepts of domain driven design. Why not make a blog post out of it?&lt;/p&gt;

	&lt;p&gt;Domain Driven Design is all about the domain. The premise is, that what we call model, is the model of the real world process we are going to implement (the &amp;#8220;domain&amp;#8221;). &lt;span class=&quot;caps&quot;&gt;DDD&lt;/span&gt; focuses on the domain of the problem, not on data, not on functions, not on control structures (although all of this stuff is used to implement them). Object technology fits pretty well into &lt;span class=&quot;caps&quot;&gt;DDD&lt;/span&gt; as it allows us to narrow reality, as we can express behavior and state together (in an object).&lt;/p&gt;

	&lt;h3&gt;A short glossary&lt;/h3&gt;

	&lt;h4&gt;Domain Layer&lt;/h4&gt;

	&lt;p&gt;The layer in the application where the domain is expressed in terms of objects.&lt;/p&gt;

	&lt;h4&gt;Domain Objects&lt;/h4&gt;

	&lt;p&gt;All the objects in the domain layer&lt;/p&gt;

	&lt;h4&gt;Entity&lt;/h4&gt;

	&lt;p&gt;Entities are those domain objects that are equal by identity as they express a specific state of a specific entity in the system. Examples are a customer or a purchase.&lt;/p&gt;

	&lt;h4&gt;Value Object&lt;/h4&gt;

	&lt;p&gt;The opposite of entities in the domain layer. Objects that are equal because of equal values not because they are identical. A money object is a typical value object and so is an address.&lt;/p&gt;

	&lt;h4&gt;Aggregate&lt;/h4&gt;

	&lt;p&gt;An aggregate is an objects graph in the domain layer consisting of entity and value objects. A customer has a number of addresses and an order has a money value object.&lt;/p&gt;

	&lt;h4&gt;Aggregate root&lt;/h4&gt;

	&lt;p&gt;The top level object in an aggregate. In the customer example, the customer is the aggregate root and all the other objects are aggregations to the customer.&lt;/p&gt;

	&lt;h4&gt;Repository&lt;/h4&gt;

	&lt;p&gt;The repository acts like a &lt;a href=&quot;http://en.wikipedia.org/wiki/Facade_pattern&quot;&gt;Facade&lt;/a&gt; to the &lt;span class=&quot;caps&quot;&gt;ORM&lt;/span&gt; components of a system. In &lt;span class=&quot;caps&quot;&gt;DDD&lt;/span&gt; we focus only on the domain, we don&amp;#8217;t care about &lt;span class=&quot;caps&quot;&gt;ORM&lt;/span&gt;, we are ignorant against &lt;span class=&quot;caps&quot;&gt;ORM&lt;/span&gt;. The repository allows us to be ignorant as it provides a simple, collection like interface to the user. Think of the repository as a factory to the persisted objects with a collection interface and being a facade to keep away all that sad details of &lt;span class=&quot;caps&quot;&gt;ORM&lt;/span&gt;.&lt;/p&gt;

	&lt;h4&gt;Ubiquitous Language&lt;/h4&gt;

	&lt;p&gt;At the beginning everything is messy: you think that girl is stupid, she thinks you are a quirky nerd with strange hobbies and even more strange friends. A few dates later you both find an ubiquitous language which allows you to communicate efficiently. &lt;span class=&quot;caps&quot;&gt;DDD&lt;/span&gt; encourages to find a set of terms to describe the system, that is modeled after the language of the domain. So the knowledge gathered in the development team about the domain is directly build into the systems core.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Wed, 13 May 2009 00:54:33 +0200</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/916-guid.html</guid>
    <category>DDD</category>
<category>Design patterns</category>
<category>Development</category>

</item>
<item>
    <title>Leaflet: PHP development in 2009</title>
    <link>http://usrportage.de/archives/915-Leaflet-PHP-development-in-2009.html</link>
    
    <comments>http://usrportage.de/archives/915-Leaflet-PHP-development-in-2009.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=915</wfw:comment>

    <slash:comments>6</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=915</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    	&lt;ul&gt;
		&lt;li&gt;Develop object-oriented code
	&lt;ul&gt;
		&lt;li&gt;Avoid static cling&lt;/li&gt;
		&lt;li&gt;Avoid global state&lt;/li&gt;
		&lt;li&gt;Use dependency injection&lt;/li&gt;
		&lt;li&gt;Use a framework if appropriate&lt;/li&gt;
		&lt;li&gt;Refactor continuously&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
		&lt;li&gt;Use a &lt;span class=&quot;caps&quot;&gt;VCS&lt;/span&gt;, preferably a decentralized
	&lt;ul&gt;
		&lt;li&gt;Have commit notifications configured&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
		&lt;li&gt;Utilize continuous deployment
	&lt;ul&gt;
		&lt;li&gt;Deploy with tools like capistrano&lt;/li&gt;
		&lt;li&gt;Deploy phar files&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
		&lt;li&gt;Test your code
	&lt;ul&gt;
		&lt;li&gt;Use continuous integration to run tests, create and deploy artefacts&lt;/li&gt;
		&lt;li&gt;Unit test your code with PHPUnit or SimpleTest&lt;/li&gt;
		&lt;li&gt;Have database migration in place to ease schema changes, e.g. with dbdeploy&lt;/li&gt;
		&lt;li&gt;Use build tools like phing or ant&lt;/li&gt;
		&lt;li&gt;Have metrics configured and use them as a QA measure&lt;/li&gt;
		&lt;li&gt;Have a code sniffer in place&lt;/li&gt;
		&lt;li&gt;Acceptance tests with tools like Selenium&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
		&lt;li&gt;Use rapid development tools like Zend Tool or cake
	&lt;ul&gt;
		&lt;li&gt;A fresh checkout should be up and running in a few minutes&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
		&lt;li&gt;Monitor your (production) systems
	&lt;ul&gt;
		&lt;li&gt;Load monitoring with tools like Cacti&lt;/li&gt;
		&lt;li&gt;Event reporting and monitoring with tools like Nagios (for the enterprise, there is nothing else)&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
		&lt;li&gt;Use a bytecode cache&lt;/li&gt;
		&lt;li&gt;Love your code&lt;/li&gt;
	&lt;/ul&gt;

	&lt;p&gt;What do you think is the state of the art in 2009?&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sat, 02 May 2009 19:25:57 +0200</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/915-guid.html</guid>
    <category>Development</category>
<category>PHP</category>
<category>QA</category>

</item>
<item>
    <title>Speaking at IPC Spring ’09</title>
    <link>http://usrportage.de/archives/912-Speaking-at-IPC-Spring-09.html</link>
    
    <comments>http://usrportage.de/archives/912-Speaking-at-IPC-Spring-09.html#comments</comments>
    <wfw:comment>http://usrportage.de/wfwcomment.php?cid=912</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://usrportage.de/rss.php?version=2.0&amp;type=comments&amp;cid=912</wfw:commentRss>
    

    <author>nospam@example.com (Lars Strojny)</author>
    <content:encoded>
    	&lt;p&gt;I&amp;#8217;m giving a talk at &lt;a href=&quot;http://it-republik.de/php/phpconference/&quot;&gt;International &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; Conference Spring Edition&lt;/a&gt; in May in Berlin. I will talk about &lt;strong&gt;Beatiful (&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;) code&lt;/strong&gt;: code your &lt;del&gt;mother&lt;/del&gt; domain experts can read, code that talks, code that reveals intention and what does it mean on the architecture side. So, a somewhat impractical and detached topic. I&amp;#8217;m looking forward to see you in Berlin.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 10 Mar 2009 00:29:47 +0100</pubDate>
    <guid isPermaLink="false">http://usrportage.de/archives/912-guid.html</guid>
    <category>Berlin</category>
<category>Conferences</category>
<category>PHP</category>

</item>

</channel>
</rss>
