<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.7.6(BH)" -->
<rss version="2.0"    xmlns:georss="http://www.georss.org/georss/"
>
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>Henri Bergius: category &quot;midgard&quot;</title>
        <description>Motorcycle Adventures and Free Software from Henri Bergius</description>
        <link>http://bergie.iki.fi/blog/</link>
        <lastBuildDate>Sat, 04 Feb 2012 14:41:04 +0000</lastBuildDate>
        <generator>FeedCreator 1.7.6(BH)</generator>
        <language>en</language>
        <managingEditor>henri.bergius@iki.fi</managingEditor>
        <item>
            <title>Midgard2 PHPCR provider hits 1.0</title>
            <link>http://bergie.iki.fi/blog/midgard2_phpcr_provider_hits_1-0/</link>
            <description><![CDATA[
<p>I'm happy to announce that we were able to release the <a href="http://packagist.org/packages/midgard/phpcr">first stable version</a> of the <a href="https://github.com/midgardproject/phpcr-midgard2">Midgard2 PHPCR provider </a>yesterday.<br /><br />Simply put, <a href="http://phpcr.github.com/">PHPCR</a> is the future of Midgard's PHP API. Instead of having our own repository APIs, we follow the <a href="http://phpcr.github.com/doc/html/index.html">well-documented</a> and <a href="https://github.com/phpcr/phpcr-api-tests">tested</a> PHP Content Repository specification. This allows much better compatibility with other projects, and for example the possibility to choose whether to store contents in <a href="http://www.midgard-project.org/midgard2/">Midgard2</a> or <a href="http://jackrabbit.apache.org/">Apache Jackrabbit</a> on per-deployment basis. This obviously doesn't mean that the current Midgard2 API is going away, but just that there is something better and more compatible available on top of that.<br /><br />PHPCR provides a nice set of capabilities that are either <a href="http://bergie.iki.fi/blog/what_is_a_content_repository/">similar to, or surpass</a> the traditional Midgard features:</p>
<ul><li>Your content model is constructed out of a <a href="http://www.day.com/specs/jcr/2.0/3_Repository_Model.html">tree of Nodes</a> that can contain other Nodes or Properties</li>
<li>Properties can be of many different types, including the typical strings and floats, but also binaries (similar to our blobs) and dates</li>
<li>Properties can be <a href="http://www.day.com/specs/jcr/1.0/6.4.2.5_Multi-value_Properties.html">multivalued</a> (think of multiple images in same property, or a person having multiple emails)</li>
<li>Queries can be either constructed with <a href="http://docs.jboss.org/modeshape/latest/manuals/reference/html/jcr-query-and-search.html#jcr-qom-query-language">Query Object Model</a> or <a href="http://docs.jboss.org/modeshape/latest/manuals/reference/html/jcr-query-and-search.html#jcr-sql2-query-language">SQL2</a></li>
<li>Queries support tree constraints (ISDESCENDANTNODE, ISCHILDNODE) and joins</li>
<li>Content can be exported and imported via a standard XML format</li>
<li>There is a comprehensive <a href="http://www.day.com/specs/jcr/2.0/8_Node_Type_Discovery.html">Node Type system</a> that allows you to define your content model. The full definitions can be read and introspected via PHP</li>
<li>Nodes also <a href="http://www.ibm.com/developerworks/java/library/j-jcr/#1">support mixins</a>, allowing you to add per-object metadata</li>
<li>There are also the <a href="http://dev.day.com/content/ddc/blog/2010/05/you_do_not_have_toc.html">unstructured nodes</a> (<em>nt:unstructured</em>) for cases where you don't want to have constraints on what to store and how</li>
</ul><p>On top of PHPCR, there is also <a href="https://github.com/doctrine/phpcr-odm#readme">a Doctrine ODM</a> that the Midgard2 provider also supports. That gives you more capabilities, like:</p>
<ul><li>More traditional object access with getters and setters to the repository</li>
<li><a href="http://blog.liip.ch/archive/2011/12/18/multilanguage-support-for-doctrine-phpcr-odm.html">Multilingual content storage</a></li>
</ul><p>Some code examples: <a href="https://github.com/bergie/phpcr-midgard2/tree/master/examples">https://github.com/bergie/phpcr-midgard2/tree/master/examples</a><br /><br />You can see Midgard's test status for both SQLite and MySQL storage back-ends <a href="http://travis-ci.org/#!/bergie/phpcr-midgard2">in our Continuous Integration environment</a>: <img src="https://secure.travis-ci.org/bergie/phpcr-midgard2.png" border="0" alt="phpcr-midgard2.png" /><br /><br />Once you have Midgard2 and our PHP extension available, installation is easy. Add a <em>composer.json</em> file into the root folder of your project:</p>
<pre>{<br />  "require": {
    "midgard/phpcr": "&gt;=1.0"
  }<br />}</pre>
<p>Install with <a href="http://packagist.org/">Composer</a>:</p>
<pre>$ wget http://getcomposer.org/composer.phar<br />$ php composer.phar install</pre>
<p>Copy MgdSchemas:</p>
<pre>$ sudo cp vendor/midgard/phpcr/data/share/schema/* /usr/share/midgard2/schema/<br />$ sudo cp vendor/midgard/phpcr/data/share/views/* /usr/share/midgard2/views/</pre>
<p>...and then just start using the repository in your application. PHPCR can obviously be used side-by-side with traditional Midgard2 or other PHP code.<br /><br />What will happen next:</p>
<ul><li>Support for PHP 5.4 and Postgres (needs work on Midgard2 level)</li>
<li>Performance optimization</li>
<li>Features work, including <a href="http://www.day.com/specs/jcr/2.0/15_Versioning.html">versioning</a></li>
<li>More tools for PHPCR. Think of <a href="http://bergie.iki.fi/blog/building_a_new_admin_interface_for_midgard/">Asgard</a> that would allow you to work with any repositories!</li>
<li>PHPCR support built-in for <a href="http://new.midgard-project.org/midcom">MidCOM</a> and <a href="http://new.midgard-project.org/midgardmvc/">MVC</a>?</li>
</ul><p>For those interested in learning more about PHPCR, there will also be a <a href="http://lanyrd.com/2012/phpcr-meetup-paris/">Paris meetup in mid-January</a>.</p>]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>60.1632 24.9277</georss:point>
            <category>midgard</category>
            <pubDate>Fri, 23 Dec 2011 10:03:14 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e12d4d5457ea202d4d11e19fc8b9739d85f14cf14c</guid>
        </item>
        <item>
            <title>Composer solves the PHP code-sharing problem</title>
            <link>http://bergie.iki.fi/blog/composer_solves_the_php_code-sharing_problem/</link>
            <description><![CDATA[
<p>In PHP we've had <a href="http://bergie.iki.fi/blog/php-finally_getting_an_ecosystem/">a lousy culture</a> of code-sharing. Because depending on code from others as been tricky, every major PHP application or framework has practically had to reimplement the whole world. Only some tools, like <a href="https://github.com/sebastianbergmann/phpunit/">PHPUnit</a>, have managed to break over this barrier and become de-facto standards across project boundaries. But for the rest: just write it yourself.</p>

<p>But now <a href="http://packagist.org/about-composer">Composer</a>, and its repository counterpart <a href="http://packagist.org/">Packagist</a>, promise to change all that. And obviously new conventions like PHP's <a href="http://www.php.net/manual/en/language.namespaces.rationale.php">namespacing support</a> and the <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md">PSR-0</a> standard autoloader help.</p>

<p>Composer is heavily inspired by <a href="http://npmjs.org/">NPM</a> which has built a strong culture of code-sharing and easy deployment in the Node.js community.</p>

<h2>Easy for users</h2>

<p>With Composer, managing dependencies in your project is very easy. Simply create a <code>composer.json</code> file where you state your dependencies, and let the package management system worry about the rest.</p>

<p>Packages that are registered with packagist.org are obviously easiest to depend on, but you can also state packages coming from custom repositories (like your company's internal version control system), or PHP extensions that you need.</p>

<p>Here is for example the <code>composer.json</code> from the <a href="https://github.com/bergie/phpcr-midgard2">Midgard PHPCR provider</a>:</p>

<pre><code>{
    "name": "midgard/phpcr",
    "type": "library",
    "require": {
        "php": "&gt;=5.3.0",
        "ext-midgard2": "&gt;=10.05.5",
        "phpcr/phpcr": "&gt;=2.1.0-beta1"
    }
}
</code></pre>

<p>With this file, Composer knows that our PHPCR provider runs only on PHP 5.3 or newer (as it uses namespaces), and that it needs the <a href="http://new.midgard-project.org/midgard2/">Midgard PHP extension</a> and the <a href="http://phpcr.github.com/">PHPCR interface classes</a> to be available.</p>

<p>Now installing the project is easy:</p>

<pre><code>$ wget http://getcomposer.org/composer.phar 
$ php composer.phar install
</code></pre>

<p>How about autoloading? Traditionally PHP required you to manually <code>include</code> or <code>require</code> all files you wanted to use in your code, with the possibility to <a href="http://php.net/manual/en/language.oop5.autoload.php">write an autoloader</a> to handle it automatically when you call an undefined class. But managing these autoloaders is also a chore.</p>

<p>Composer helps here too, by automatically generating an autoloader that will be able to load your own code, and the code from all your dependencies. So you can get rid of your own autoloaders and <code>include</code> statements, and just include the Composer-generated autoloader in your code:</p>

<pre><code>require 'vendor/.composer/autoload.php';
</code></pre>

<p>After this all the classes you've stated your application needing will be available.</p>

<h2>Easy for developers</h2>

<p>While ease-of-installation is important, it isn't enough to build an ecosystem. The other thing that has to be easy is publishing code. Basically: <em>if you've written a piece of functionality in PHP that you could see yourself using in another project, it should be effortless to publish it as a library.</em></p>

<p>This is where approaches like PEAR mostly failed, by making it too cumbersome to define your packages, to build them, and to upload them to the repository.</p>

<p>With Composer <a href="http://packagist.org/about">this is very easy</a>. You again define a <code>composer.json</code> for your package, and push that to your project's Git repository. Then just <a href="http://packagist.org/packages/submit">register</a> the Git repository URL with packagist.org.</p>

<p>After this Packagist will spider your repository and make it available as a package.</p>

<p>Publishing new versions is very easy: simply keep your <code>composer.json</code> up-to-date, and <a href="http://learn.github.com/p/tagging.html">tag your releases</a> in Git.</p>

<h2>Where are we now?</h2>

<p>It is still early days for Composer, and <a href="https://github.com/composer/composer">the project</a> is being worked on at a hectic pace. However, it is already good enough for managing dependencies to modern, PSR-0 compatible libraries.</p>

<p>What I would like to see happen next is support for custom package roles and autoloaders. This would allow us to handle more specific cases, like for example installation of <a href="http://new.midgard-project.org/midgardmvc/#structure_of_a_component">Midgard MVC components</a> and their non-namespaced autoloading needs. After that we should be able to get rid of our custom installer code and just join the Composer crowd.</p>

<p>But if your code is already fully namespaced, this is a great time to get started with <a href="http://packagist.org/about-composer">Composer</a>.</p>
]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>60.1698 24.9382</georss:point>
            <category>midgard</category>
            <pubDate>Wed, 02 Nov 2011 00:01:06 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e104e5c359986404e511e198f2110c4696fb13fb13</guid>
        </item>
        <item>
            <title>DNode: Make PHP and Node.js talk to each other</title>
            <link>http://bergie.iki.fi/blog/dnode-make_php_and_node-js_talk_to_each_other/</link>
            <description><![CDATA[
<p>If you've been following my blog, you might have noticed that lately I've started doing quite a lot of <a href="http://nodejs.org/">Node.js</a> development alongside PHP. Based on conversations I've had in various conferences, I'm by far not alone in this situation - using Node.js for real-time functionality, and PHP (or Django, or Rails) for the more traditional CRUD stuff.</p>

<p>Both environments have their strong points. Node.js is very fast and flexible, but PHP has a lot more mature tools and libraries available. So in a lot of projects it is hard to choose between the two. But now you might not have to.</p>

<h2>Enter DNode</h2>

<p><a href="http://substack.net/posts/85e1bd/DNode-Asynchronous-Remote-Method-Invocation-for-Node-js-and-the-Browser">DNode</a> is a <em>remote method invocation</em> protocol originally written for Node.js, as the name probably tells. But as <a href="https://github.com/substack/dnode-protocol#readme">the protocol</a> itself is quite simple, just sending newline-terminated JSON packets over TCP connections, implementations have started popping up in other languages. You can talk DNode in <a href="https://github.com/substack/dnode-ruby">Ruby</a>, <a href="https://github.com/substack/dnode-perl">Perl</a>, <a href="https://github.com/jesusabdullah/dnode-python">Python</a>, <a href="https://github.com/aslakhellesoy/dnode-java">Java</a>, and now <a href="https://github.com/bergie/dnode-php">PHP</a>.</p>

<p>I started working on the PHP DNode implementation in the <a href="http://blog.liip.ch/archive/2011/09/30/symfony-cmf-hackday-october-22nd-in-cologne.html">Symfony CMF hackday</a> in Cologne a week ago, and got it into a running stage on a train ride from there to Paris. The implementation isn't yet complete, but works already quite well.</p>

<p>With DNode you can expose Node.js functions to be available on PHP, and PHP class methods to be available on Node.</p>

<p>Like most Node.js functionality, DNode works asynchronously. So instead of waiting for return values you supply a callback function that will be called when the method completes.</p>

<h2>PHP as client</h2>

<p>Here is a simple DNode service for Node.js:</p>

<pre><code>var dnode = require('dnode');
var server = dnode({
    zing: function (n, cb) { cb(n * 100) }
});
server.listen(7070);
</code></pre>

<p>This creates a DNode service running in TCP port 7070 that provides one method: <em>zing</em> that multiplies the value given to it by 100 and sends the result to the callback provided.</p>

<p>Calling this with PHP is easy:</p>

<pre><code>// Connect to DNode server running in port 7070 and call 
// Zing with argument 33
$dnode = new DNode\DNode();
$dnode-&gt;connect(7070, function($remote, $connection) {
    // Remote is a proxy object that provides us all methods
    // from the server
    $remote-&gt;zing(33, function($n) use ($connection) {
        echo "n = {$n}\n";
        // Once we have the result we can close the connection
        $connection-&gt;end();
    });
});
</code></pre>

<p>Now just start the server:</p>

<pre><code>$ node simple/server.js
</code></pre>

<p>And run the client. As you can see from the PHP code above, once we get the result the client will end the connection automatically:</p>

<pre><code>$ php examples/simple/client.php 
n = 3300
</code></pre>

<p>Because only simple TCP connections and JSON packets are used, this is quite fast. Here are time results for the client on my MacBook Air:</p>

<pre><code>real    0m0.064s
user    0m0.050s
sys     0m0.010s
</code></pre>

<h2>PHP as a server</h2>

<p>PHP can also act as a DNode server. You instantiate the DNode class and pass it the object you want to expose via DNode. All public methods of the object will be made available to the DNode clients:</p>

<pre><code>// This is the class we're exposing to DNode
class Zinger
{
    // Public methods are made available to the network
    public function zing($n, $cb)
    {
        // Dnode is async, so we return via callback
        $cb($n * 100);
    }
}

// Create a DNode server
$server = new DNode\DNode(new Zinger());
$server-&gt;listen(7070);
</code></pre>

<p>This DNode service will obviously be visible for both Node.js and PHP clients.</p>

<h2>Bidirectional communications</h2>

<p>A DNode client can also expose methods to the server. In this example the server provides functionality for converting temperatures from Celsius to Fahrenheit, but actually gets the current Celsius temperature by asking it from a client.</p>

<p>Server:</p>

<pre><code>// This is the class we're exposing to DNode
class Converter
{
    // Poll the client's own temperature() in celsius
    // and convert that value to fahrenheit in the supplied 
    // callback
    public function clientTempF($cb)
    {
        // The other side of DNode connection is exposed via
        // $this-&gt;remote proxy object
        $this-&gt;remote-&gt;temperature(function($degC) use ($cb) {
            $degF = round($degC * 9 / 5 + 32);
            $cb($degF);
        });
    }
}

// Create a DNode server that listens to port 6060
$server = new DNode\DNode(new Converter());
$server-&gt;listen(6060);
</code></pre>

<p>Client:</p>

<pre><code>// This is the class we're exposing to DNode
class Temp
{
    // Compute the client's temperature and stuff that value
    // into the callback
    public function temperature($cb)
    {
        $degC = rand(-20, 50);
        echo "{$degC}° C\n";
        $cb($degC);
    }
}

$dnode = new DNode\DNode(new Temp());
$dnode-&gt;connect(6060, function($remote, $connection) {
    // Ask server for temperature in Fahrenheit
    $remote-&gt;clientTempF(function($degF) use ($connection) {
        echo "{$degF}° F\n";
        // Close the connection
        $connection-&gt;end();
    });
});
</code></pre>

<p>Then just start the server:</p>

<pre><code>$ php examples/bidirectional/server.php
</code></pre>

<p>And run the client:</p>

<pre><code>$ php examples/bidirectional/client.php 
28° C
82° F
</code></pre>

<p>The same will obviously work with a Node.js client:</p>

<pre><code>$ node bidirectional/client.js 
23° C
73° F
</code></pre>

<h2>Installing DNode</h2>

<p>dnode-php can be installed using the <a href="http://packagist.org/">Composer</a> tool. You can either add <code>dnode/dnode</code> to your package dependencies, or if you want to install dnode-php as standalone, go to the main directory of its repository and run:</p>

<pre><code>$ wget http://getcomposer.org/composer.phar 
$ php composer.phar install
</code></pre>

<p>You can then use the composer-generated autoloader to access the DNode classes:</p>

<pre><code>require 'vendor/.composer/autoload.php';
</code></pre>

<p>Some DNode examples can be found from the <code>examples</code> folder. They are compatible with the similarly-named examples from <a href="https://github.com/substack/dnode">Node.js DNode</a>.</p>

<h2>Contributing</h2>

<p><a href="https://github.com/bergie/dnode-php">php-dnode</a> is developed under the MIT license in GitHub. If you're interested in it, please watch the repository and send issues or pull requests.</p>
]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>60.1698 24.9382</georss:point>
            <category>midgard</category>
            <pubDate>Mon, 31 Oct 2011 11:50:50 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e103b6941bc15603b611e1bebb99c996e30f990f99</guid>
        </item>
        <item>
            <title>VIE 2.0 is starting to emerge</title>
            <link>http://bergie.iki.fi/blog/vie_2-0_is_starting_to_emerge/</link>
            <description><![CDATA[
<p><a href="https://github.com/bergie/VIE#readme">VIE</a> is a JavaScript library that makes RDFa-annotated entities on web pages editable. We started the work towards the next major version of it, codenamed <a href="https://github.com/IKS/zart.js">Zart</a> (for Mozart) in a Salzburg IKS hackathon couple of weeks ago.</p>

<p><img src="https://github.com/bergie/VIE/raw/master/vie_logo_100.png" alt="VIE" title="" /></p>

<p>Yesterday I merged the Zart codebase into the <a href="https://github.com/bergie/VIE">VIE repository</a>. This blog post describes some of the improvements it brings.</p>

<h2>VIE now has an instance</h2>

<p>For VIE 1.x users the first visible change (and probably the only necessary API change) is that now VIE needs to be instantiated before being used. <a href="http://blogs.msdn.com/b/scottdensmore/archive/2004/05/25/140827.aspx">Singletons are evil</a>, and so we are not a singleton any longer.</p>

<p>So, for existing VIE code, you need to:</p>

<pre><code>var vie = new VIE();
// and then any traditional VIE calls, like:
var entities = vie.RDFaEntities.getInstances('div.article');
console.log("There are " + entities.length + " RDFa entities in your articles");
</code></pre>

<p>The VIE 1.0 API can be disabled by passing a setting when instantiating VIE:</p>

<pre><code>var vie = new VIE({classic: false});
</code></pre>

<h2>Services and VIE</h2>

<p>The other big change in VIE is that now the API has been built in a service-oriented manner. This means that for example reading and writing RDFa is just a service you can enable and disable at will.</p>

<p>The benefit here is that we can easily add support for other formats and capabilities without having to touch VIE internals. Thanks to the <a href="http://manu.sporny.org/2011/false-choice/">schema.org situation</a>, <a href="http://www.w3.org/TR/microdata/">Microdata</a> is getting more use, and so at some point we'll probably add a service for it.</p>

<p>Registering and accessing services is easy:</p>

<pre><code>// Instantiate VIE
var vie = new VIE();

// Pass the service instance and a name you want to use for it
vie.use(new vie.RdfaService, 'rdfa');

// Call a method from the service using the name
// this one would give us the RDF subject of the
// element matched by the jQuery selector
vie.service('rdfa').getElementSubject('div.article');
</code></pre>

<p>An immediate benefit here is that we can have two RDFa parsing implementations. If you have problems with our own custom jQuery-based RDFa parser, then you can use the more strict <a href="http://code.google.com/p/rdfquery/">rdfQuery</a> powered implementation instead:</p>

<pre><code>vie.use(new RdfaRdfQueryService, 'rdfa');
</code></pre>

<h2>Using deferreds</h2>

<p>For the new main VIE API we created a sort of a <a href="http://en.wikipedia.org/wiki/Domain-specific_language">Domain-Specific Language</a> for handling semantic entities. A core part of it is that now all operations utilize <a href="http://www.erichynds.com/jquery/using-deferreds-in-jquery/">jQuery's Deferred</a> objects. With them you can attach different callbacks to the results of your operation, and they will fire either when the operation completes, or immediately if the operation has already been run.</p>

<p>This gives a lot of flexibility in using the API, and allows us to provide same API for services that deal with the DOM, and services that talk to external APIs like <a href="http://incubator.apache.org/stanbol/">Stanbol</a>.</p>

<p>For example, parsing RDFa from a given DOM element (provided with a jQuery selector) happens like this:</p>

<pre><code>vie.load({
        element: 'div.article'
    }).
    from('rdfa').
    execute().
    done(function(entities) {
        console.log(entities);
    });
</code></pre>

<p>The chain here is: <em>operation</em> (in this case, load), <em>from service</em> (rdfa), <em>execute</em> operation, then when <em>done</em>, do <em>callback</em>.</p>

<p>With the RDFa service we register Backbone Views for the elements our entities came from, so just like with VIE 1.x, they will update automatically when you change the contents of your entities. But manual writing is also available in case you need it. Here is how it works:</p>

<pre><code>vie.save({
        element: 'div.article',
        entity: someBackboneModel
    }).
    to('rdfa').
    execute().
    done(function() {
        console.log("Saved!");
    });
</code></pre>

<p>In addition to <em>done</em>, which fires if the operation succeeds, you have <em>fail</em> for failed operations, and <em>then</em> which fires regardless of success or failure.</p>

<h2>Accessing external services</h2>

<p>The new VIE is not just about RDFa. In addition to working with the entities you have on a page, you can also access external repositories of semantic information, like <a href="http://dbpedia.org/About">DBpedia</a>.</p>

<p>For example, to find out everything that Wikipedia knows about Salzburg, you could run:</p>

<pre><code>vie.use(new vie.DBPediaService, 'dbpedia');
vie.load({
        entity: '&lt;http://dbpedia.org/resource/Salzburg&gt;'
    }).
    using('dbpedia').
    execute().
    done(function(entity) {
        console.log("This is what we know of Salzburg");
        console.log(entity);
    });
</code></pre>

<p>In browser usage these calls to external services are subject to cross-domain AJAX limitations. A way to work around those is to set up a proxy, and tell the DBpedia service to use that. To do this, pass the proxy URL to the service when instantiating:</p>

<pre><code>vie.use(new vie.DBPediaService({proxyUrl: 'http://localhost:8080'});
</code></pre>

<p>With this, all the factual information from Wikipedia will be at your disposal. The size of every city, the height of every mountain. Birthdates and places of birth for famous people. Your web app can do quite a bit with this information.</p>

<h3>Finding entities from text</h3>

<p><a href="http://incubator.apache.org/stanbol/">Apache Stanbol</a> is a semantic engine that can extract all kinds of entities from text documents. It can be used for auto-tagging and other things.</p>

<p>Here is how you can use it with VIE:</p>

<pre><code>vie.use(new vie.StanbolService, 'stanbol');
vie.analyze({
        element: 'div.article'
    }).
    using('stanbol').
    execute().
    done(function(entities) {
        console.log("We got the following enhancements for article content");
        console.log(entities);
    });
</code></pre>

<p>Stanbol can tell you what a piece of content talks about. People mentioned, places, concepts. It will also give you the language of the text.</p>

<h2>Moving forward</h2>

<p>The new version of VIE is still under heavy development. Most of the thngs work, but some details may still change. It is a good idea to start taking a look at it now, but before a beta release at least, <a href="https://github.com/bergie/VIE/tree/1.0.0">VIE 1.0</a> is the recommended tool to use.</p>

<p>If you already use VIE 1.0 for making your content editable, VIE 2.x will give you a lot of additional power. Enhancements, data queries, namespace handling, and much more.</p>

<p>Thanks to <a href="https://github.com/szabyg">Szaby</a> and <a href="https://github.com/neogermi">Sebastian</a> for helping to make this happen!</p>
]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>47 13</georss:point>
            <category>midgard</category>
            <pubDate>Wed, 21 Sep 2011 15:01:28 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e0e462954fa70ee46211e091068b54f0dad597d597</guid>
        </item>
        <item>
            <title>GObject Introspection is coming to Node.js</title>
            <link>http://bergie.iki.fi/blog/gobject_introspection_is_coming_to_node-js/</link>
            <description><![CDATA[
<p><a href="https://live.gnome.org/GObjectIntrospection">GObject Introspection</a> (GIR) is a way to create automatic bindings to <a href="http://developer.gnome.org/">GNOME libraries</a> for various different programming languages. I've written before about the <a href="http://bergie.iki.fi/blog/php_and_gobject_introspection/">benefits of bringing GIR to PHP</a>, and now it seems something similar is happening on <a href="http://nodejs.org/">Node.js</a>.</p>

<p><a href="https://github.com/creationix/node-gir">node-gir</a> has been written by <a href="https://github.com/creationix">Tim Caswell</a>, with help from <a href="https://github.com/swick">Sebastian Wick</a> and <a href="https://github.com/piotras">Piotr Pokora</a>.</p>

<p>I've been following the progress for a while, and today, during a flight from Helsinki to Salzburg, I was finally able to open a <a href="http://www.midgard-project.org/midgard2/">Midgard</a> repository connection with it. The API still is a bit weird, and lacks support for <a href="http://shinetech.com/thoughts/thought-articles/139-asynchronous-code-design-with-nodejs-">the asynchronous nature</a> of Node, but those will hopefully change soon. Quick example:</p>

<pre><code>var Midgard, gir, config, mgd;
gir = require("../gir");
gir.init();
Midgard = gir.load("Midgard");
Midgard.init();

// Use a local SQLite database file
config = new Midgard.Config();
config.__set_property__("dbdir", __dirname);
config.__set_property__("dbtype", "SQLite");
config.__set_property__("database", "midgard");

// Open connection to the database
mgd = new Midgard.Connection();
if (!mgd.__call__("open_config", config)) {
    console.error("Failed to open connection");
    process.exit();
}
</code></pre>

<p><a href="https://github.com/creationix/node-gir">node-gir is being developed on GitHub</a> if you want to lend a hand or try it out. To build it, run <code>npm install</code> and you should be able to run the <a href="https://github.com/swick/node-gir/tree/master/examples">code examples</a>.</p>

<p>Having GIR support for Node would make it a full-fledged GNOME environment, and mean that there would be proper GObject Introspection in all three major JavaScript runtimes - <a href="https://live.gnome.org/Gjs">SpiderMonkey</a>, <a href="https://live.gnome.org/Seed">JavaScriptCore</a> and <a href="https://github.com/creationix/node-gir">V8</a>. And this way GNOME JavaScript developers could also utilize the wealth of <a href="https://github.com/joyent/node/wiki/modules">existing Node.js modules</a>.</p>
]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>60.163898 24.9289</georss:point>
            <category>desktop</category>
            <pubDate>Mon, 12 Sep 2011 00:27:13 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e0dcd5f5cffabedcd511e098e2996b57000c6e0c6e</guid>
        </item>
        <item>
            <title>Embrace and extend</title>
            <link>http://bergie.iki.fi/blog/embrace_and_extend/</link>
            <description><![CDATA[
<p>I'm getting worried about Google. Long one of the champions of <a href="http://www.mozilla.org/about/manifesto.en.html">the open web</a> alongside Mozilla, the rise of <a href="http://www.facebook.com/">social networking silos</a> and the <a href="http://www.apple.com/iphone/apps-for-iphone/">app economy</a> seem to have scared them. And like any scared organism, they lash out.</p>

<p>Many of their plans to make web competitive against native development environments are good, there is indeed much to improve in the stack. But what I'm uneasy with is the unilateral way they go about it, preferring "big reveals" and post-facto standardization instead of <a href="http://www.wired.com/wired/archive/3.10/ietf.html">the open conversation</a> that built most of the Internet we have today. This is not the way <a href="http://bergie.iki.fi/blog/on_cross-project_collaboration/">to collaborate</a>.</p>

<p>Consider some of their recent efforts:</p>

<ul><li><a href="http://www.chromium.org/spdy/spdy-whitepaper">SPDY</a>, a protocol to replace HTTP which Web is built on. Currently only supported by Chrome, which uses it to talk to several Google services</li>
<li><a href="http://www.2ality.com/2011/09/google-dart.html">Dart</a>, their JavaScript-killer which recently surfaced through a <a href="http://news.ycombinator.com/item?id=2980267">leaked email</a></li>
<li><a href="http://manu.sporny.org/2011/false-choice/">Microdata and Schema.org</a> that seek to replace last ten years of semantic web development with a spec cooked up by couple of big vendors in secret</li>
</ul><p>These - together with <a href="http://en.wikipedia.org/wiki/Web_SQL_Database">WebSQL</a>, <a href="http://code.google.com/p/nativeclient/wiki/NativeClientInGoogleChrome">NaCl</a>, <a href="http://www.webmproject.org/">WebM</a> and <a href="http://code.google.com/speed/webp/">WebP</a> - mean that Google has active efforts to replace practically every layer of the web (except HTML itself) with something of their own design.</p>

<p>The way all of these were introduced bears strong reminders of how Microsoft tried to <a href="http://en.wikipedia.org/wiki/Embrace,_extend_and_extinguish">embrace, extend, and extinguish</a> the web in late 90s. That period brought horrors like ActiveX and the awful, unkillable IE6. Though, for the sake of fairness, it also brought us XmlHttpRequest which was the enabler of the AJAX revolution.</p>

<p>Google's new technologies may end up being beneficial for web developers, but they also threaten to fragment the platform. After all, as the competition in the <a href="http://bergie.iki.fi/blog/why_the_tablet_form_factor_is_winning/">"post-PC"</a> space heats up, the competitors are unlikely to embrace Google's extensions of the web stack. That would be a loss to all.</p>

<p><a href="http://brendaneich.com/">Brendan Eich</a>, the original author of JavaScript <a href="http://news.ycombinator.com/item?id=2982949">comments on Hacker News</a>:</p>

<blockquote>
  <p>So "Works best in Chrome" and even "Works only in Chrome" are new norms promulgated intentionally by Google. We see more of this fragmentation every day. As a user of Chrome and Firefox (and Safari), I find it painful to experience, never mind the political bad taste.</p>
  
  <p>Ok, counter-arguments. What's wrong with playing hardball to advance the web, you say? As my blog tries to explain, the standards process requires good social relations and philosophical balance among the participating competitors.</p>
  
  <p>Google's approach with Dart is thus pretty much all wrong and doomed to leave Dart in excellent yet non-standardized and non-interoperable implementation status. Dart is GBScript to NaCl/Pepper's ActiveG.</p>
</blockquote>

<p><em>Disclaimer: I've been a long-time fan of many of Google's services, and have visited some of their offices a few times. I like the company. Which is exactly why I'm so concerned about this unilateral approach at standards. I am also involved in some standards processes through the IKS Project.</em></p>
]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>60.163898 24.9289</georss:point>
            <category>desktop</category>
            <pubDate>Sun, 11 Sep 2011 23:14:02 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e0dccbbd08e7aedccb11e0a500e7540c8d14af14af</guid>
        </item>
        <item>
            <title>Nemein and Infigo merge to create a digital agency focused on web and mobile</title>
            <link>http://bergie.iki.fi/blog/nemein_and_infigo_merge/</link>
            <description><![CDATA[
<p>Yesterday the contracts were signed to acquire <a href="http://infigo.fi/en/">Infigo</a> as part of <a href="http://nemein.com/en/">Nemein</a>. Infigo, is a consulting company focused on mobile development and web using open source tools. You'll probably at least know their CTO, <a href="http://bergie.iki.fi/blog/on_usb_fingers_and_world_news/">Jerry of the USB finger fame</a>.</p>
<p>Even in the <a href="http://bergie.iki.fi/blog/ten_years_of_nemein/">ten years of history</a> of our company this is quite a significant move - it allows us to combine Nemein's traditional expertise on content management with Infigo's mobile offerings. As smartphones and tablets are becoming popular, more and more services we build will have a mobile element, which is now easier with lots of in-house expertise.</p>
<p>This also means more focus on the interplay between the <a href="http://www.midgard-project.org/">Midgard</a> content repository, <a href="https://github.com/bergie/noflo">NoFlo</a> workflows, <a href="http://nodejs.org/">Node.js</a> and <a href="http://symfony.com/">Symfony</a> web services, and mobile applications built in <a href="http://qt.nokia.com/">Qt</a>.</p>
<p><img src="http://bergie.iki.fi/static/1/1e0d55317b0f154d55311e0a7e177ab46dbbff1bff1_nemein-infigo.jpg" border="0" alt="nemein-infigo.jpg" title="nemein-infigo.jpg" /></p>
<p><a href="http://infigo.fi/en/page/company/team">Petri Rajahalme</a> (with me in the photo) will be the CEO of the merged company, and I will focus on leading the R&amp;D efforts.</p>]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>47 13</georss:point>
            <category>business</category>
            <pubDate>Fri, 02 Sep 2011 11:15:37 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e0d554e2c051e0d55411e0807513cb0e9005fb05fb</guid>
        </item>
        <item>
            <title>Flow-based programming for PHP</title>
            <link>http://bergie.iki.fi/blog/flow-based_programming_for_php/</link>
            <description><![CDATA[
<p>You may have seen my earlier <a href="http://bergie.iki.fi/blog/desktop_summit_flow-based_programming/">post about NoFlo</a>, the <a href="http://en.wikipedia.org/wiki/Flow-based_programming">flow-based programming</a> tool I've written for Node.js. It allows you to do quite cool stuff, like <a href="http://universalruntime.tumblr.com/post/8998693776/node-js-powered-web-server-written-with-the-noflo">a visually controlled web server</a>:</p>

<p><img src="http://27.media.tumblr.com/tumblr_lq12x0Sf481qies3uo1_500.png" alt="NoFlo-powered web server" title="" /></p>

<p>Yesterday Igor Wiedler published <a href="https://github.com/igorw/Evenement">Evenement</a>, a PHP port of the EventEmitter class from Node.js. As <a href="https://github.com/bergie/noflo">NoFlo</a> builds quite heavily on EventEmitter, I decided to see how far the PHP port could be taken.</p>

<p>As result, there is now <a href="https://github.com/bergie/phpflo">PhpFlo</a>, a flow-based programming environment for PHP.</p>

<p>Example of how to define and run a flow (you can also use <a href="https://github.com/bergie/phpflo/blob/master/examples/linecount/count.json">a JSON format</a> for this):</p>

<pre><code>// Add nodes to the graph
$graph = new PhpFlo\Graph("linecount");
$graph-&gt;addNode("Read File", "ReadFile");
$graph-&gt;addNode("Split by Lines", "SplitStr");
$graph-&gt;addNode("Count Lines", "Counter");
$graph-&gt;addNode("Display", "Output");

// Add connections between nodes
$graph-&gt;addEdge("Read File", "out", "Split by Lines", "in");
$graph-&gt;addEdge("Read File", "error", "Display", "in");
$graph-&gt;addEdge("Split by Lines", "out", "Count Lines", "in");
$graph-&gt;addEdge("Count Lines", "count", "Display", "in");

// Kick-start the process by sending filename to Read File
$graph-&gt;addInitial($fileName, "Read File", "source");

// Make the graph "live"
$network = PhpFlo\Network::create($graph);
</code></pre>

<p>The flow consists of processes, or instances simple "black box" components that have their own defined input and output ports. Program logic is defined by making connections between them. Here is a simple component that reads the contents of a file:</p>

<pre><code>namespace PhpFlo\Component;
use PhpFlo\Component;
use PhpFlo\Port;
class ReadFile extends Component
{
    public function __construct()
    {
        $this-&gt;inPorts['source'] = new Port();
        $this-&gt;outPorts['out'] = new Port();
        $this-&gt;outPorts['error'] = new Port();

        $this-&gt;inPorts['source']-&gt;on('data', array($this, 'readFile'));
    }

    public function readFile($data)
    {
        if (!file_exists($data)) {
            $this-&gt;outPorts['error']-&gt;send("File {$data} doesn't exist");
            return;
        }

        $this-&gt;outPorts['out']-&gt;send(file_get_contents($data));
        $this-&gt;outPorts['out']-&gt;disconnect();
    }
}
</code></pre>

<p>I hope people find this system useful. If you're interested in FBP, then <a href="http://www.jpaulmorrison.com/fbp/#More">J. Paul Morrison's book</a> is a good place to start.</p>

<p>And if you're in <a href="http://froscon.de/">FrOSCon</a>, feel free to come and chat with me :-)</p>
]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>60 24</georss:point>
            <category>midgard</category>
            <pubDate>Thu, 18 Aug 2011 13:07:34 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e0c99b09aec9b4c99b11e0af65a93f4d4c58225822</guid>
        </item>
        <item>
            <title>Symfony2 for Midgard Developers</title>
            <link>http://bergie.iki.fi/blog/symfony2_for_midgard_developers/</link>
            <description><![CDATA[
<p><a href="http://nemein.com/en/">We</a> hosted a full-day <a href="http://symfony.com/">Symfony2</a> workshop for some of the Finnish Midgard developer community today. As I've written before, Midgard is now <a href="http://bergie.iki.fi/blog/midgard_in_the_symfony2_world/">transitioning to Symfony2</a> as our PHP web framework of choice, and this workshop was organized to support that.</p> 
 
<div style="width:425px" id="__ss_8866106"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/bergie/symfony2-for-midgard-developers" title="Symfony2 for Midgard Developers" target="_blank">Symfony2 for Midgard Developers</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/8866106" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe> <div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/bergie" target="_blank">Henri Bergius</a> </div> </div>
 
<p>Subjects discussed included:</p> 
 
<ul><li>Symfony2 as a central PHP ecosystem</li> 
<li>Basic ideas behind Symfony2</li> 
<li>Introduction to PHP namespaces</li> 
<li>Installation with Symfony Standard Edition</li> 
<li>Running Symfony2 with AppServer-in-PHP</li> 
<li>Creating a new Bundle</li> 
<li>Templating in Symfony2</li> 
<li>Routing in Symfony2</li> 
<li>Using the Midgard content repository with Symfony2</li> 
<li>Running MidCOM components inside Symfony2</li> 
</ul><p>You can also find the <a href="https://live.gnome.org/Pinpoint">Pinpoint</a> sources for the tutorial <a href="https://github.com/bergie/Symfony2ForMidgardians">from GitHub</a>. I'll try to keep them updated for future use.</p>]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>60 24</georss:point>
            <category>midgard</category>
            <pubDate>Tue, 16 Aug 2011 17:18:49 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e0c82bce8d7e5ec82b11e080e43fc87f045c2f5c2f</guid>
        </item>
        <item>
            <title>Some notes from Desktop Summit 2011</title>
            <link>http://bergie.iki.fi/blog/some_notes_from_desktop_summit_2011/</link>
            <description><![CDATA[
<p>As usual, <a href="https://desktopsummit.org/">Desktop Summit 2011</a> has been a lot of fun. I've been to most of the GUADEC and aKademy free desktop events in the past few years, but this was the first time I didn't give a talk. Even that way, it was definitely worth spending a week in Berlin.</p>

<p>While much of the corporate involvement around the desktops has evaporated through some recent events, this seems to have given the developers lots more creative freedom. I've seen many very promising concepts from both communities.</p>

<p>Here are some things that happened during the week:</p>

<ul><li>The <em><a href="http://lists.midgard-project.org/pipermail/dev/2011-August/003045.html">roadmap for Midgard</a></em> to become closer to the JCR specification solidified, including a reasonably good plan on backwards compatibility</li>
<li>We published the first version of <a href="https://github.com/midgardproject/GICR">GICR</a>, generic <em>Content Repository interfaces for GObject</em>. Midgard will probably be the first project to implement them, but we hope others will follow. It'd be a great fit for <a href="https://live.gnome.org/Design/Apps/Documents">GNOME Documents</a>, among other things</li>
<li>The project to replace our own PHP frameworks with <em><a href="http://symfony.com/">Symfony2</a></em> continued by implementing the <a href="https://github.com/bergie/MidgardMidcomCompatBundle">MidCOM compatibility layer</a> that will allow Midgard1 web applications to be run in the new environment</li>
<li>My work on the <em><a href="https://github.com/bergie/noflo">NoFlo</a> flow-based programming tool</em> got some positive attention and interest. Still lot of stuff to do</li>
<li>We at <a href="http://nemein.com/">Nemein</a> co-sponsored the <em><a href="https://live.gnome.org/Hackfests/Introspection2011">GObject Introspection hackfest</a></em>. <a href="https://live.gnome.org/GObjectIntrospection/">GIR</a> is important for bringing GNOME libraries to new environments like scripting languages and the web</li>
<li><em>Lots of ice cream</em> got eaten. I think it will be fair if I stay out of next year's deathmatch and focus on coaching ;-)</li>
</ul><p>Tomorrow back to Helsinki for a week, then onwards to <a href="http://froscon.de/">FrOSCon</a> and Salzburg...</p>
]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>52 13</georss:point>
            <category>desktop</category>
            <pubDate>Thu, 11 Aug 2011 16:18:35 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e0c435907f6482c43511e099d39b5f70ba56dc56dc</guid>
        </item>
        <item>
            <title>Desktop Summit, and some thoughts on Flow-Based Programming</title>
            <link>http://bergie.iki.fi/blog/desktop_summit_flow-based_programming/</link>
            <description><![CDATA[
<p>Like many, I'm currently in Berlin for <a href="https://desktopsummit.org/">Desktop Summit</a>, the combined conference of the GNOME and KDE communities. It is a lot of fun to see all the familiar faces, and talk about the different projects going on!</p>
<p><img src="https://www.desktopsummit.org/sites/www.desktopsummit.org/files/DS2011banner.png" border="0" alt="DS2011banner.png" /></p>
<p>Now, one of the things I've talked about with people is <a href="https://github.com/bergie/noflo">NoFlo</a>, my new tool that brings <em>Flow-Based Programming</em> to <a href="http://nodejs.org/">Node.js</a>. What is that? <a href="http://en.wikipedia.org/wiki/Flow-based_programming">Wikipedia explains</a>:</p>
<blockquote>Flow-based programming (FBP) is a programming paradigm that defines applications as networks of "black box" processes, which exchange data across predefined connections by message passing, where the connections are specified externally to the processes. These black box processes can be reconnected endlessly to form different applications without having to be changed internally. FBP is thus naturally component-oriented.</blockquote>
<p>Basically the idea here is to simplify managing the control flow of software: what data goes where, what happens then, etc. with the goal of making software more understandable. With NoFlo you can go and peek under the hood of a running piece of software, see where data is going to, and even rewire some connections if you want to.</p>
<p>The project is still in reasonably early stages, but it is already used in at least one real-life deployment. Here are some sneak peeks:</p>
<p><img src="http://bergie.iki.fi/static/1/1e0c03da3d93d7ec03d11e0ad7493d9595d183c183c_noflo-shell-small.png" border="0" alt="noflo-shell-small.png" title="noflo-shell-small.png" />:</p>
<p><img src="http://bergie.iki.fi/static/1/1e0c03dc1eb3d1cc03d11e0853e692a724efbc6fbc6_noflo-gui-small.png" border="0" alt="noflo-gui-small.png" title="noflo-gui-small.png" /></p>
<p>If you're interested, follow the progress on <a href="https://github.com/bergie/noflo">my GitHub repo</a>, or subscribe to the <a href="http://groups.google.com/group/flow-based-programming">Flow-Based Programming mailing list</a>.</p>
<p>In the spirit of Desktop Summit, it would be interesting to talk how these workflows would fit into the concept of a free software desktop.</p>]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>60.318298 24.9667</georss:point>
            <category>desktop</category>
            <pubDate>Sat, 06 Aug 2011 15:09:59 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e0c03e26f9f734c03e11e09d297190c4fed31bd31b</guid>
        </item>
        <item>
            <title>Midgard in the Symfony2 world</title>
            <link>http://bergie.iki.fi/blog/midgard_in_the_symfony2_world/</link>
            <description><![CDATA[
<p>So, <a href="http://symfony.com/blog/symfony-2-0">Symfony2 was released</a> today. Now, you may remember me complaining about the <a href="http://bergie.iki.fi/blog/php-finally_getting_an_ecosystem/">fragmentation in the PHP community</a>, as well as <a href="http://bergie.iki.fi/blog/my_secret_agenda_for_php_content_management_systems/">suggesting various technologies</a> that have the power to bring the community together. But what I haven't talked about is convergence in the area of PHP frameworks.</p>

<p>Frameworks are generally problematic concerning <a href="http://bergie.iki.fi/blog/on_cross-project_collaboration/">cross-project collaboration</a>, as most of the code written against a particular framework tends to run only on that framework. If things are <a href="http://bergie.iki.fi/blog/decoupling_content_management/">properly decoupled</a>, and most of the logic is in generic libraries, this doesn't matter so much. But still, having a common framework most of the code is written for helps, as can be seen <a href="http://rubyonrails.org/">in the Ruby community</a>.</p>

<p>So, to advance this goal, we in the <a href="http://www.midgard-project.org/">Midgard Community</a> have <a href="http://lists.midgard-project.org/pipermail/dev/2011-July/003022.html">made a decision</a> to start aligning our PHP code <a href="http://lists.midgard-project.org/pipermail/dev/2011-July/003016.html">to Symfony2</a>. The <a href="http://symfony.com/blog/symfony-2-0">ideas behind SF2</a> are quite compatible with our views:</p>

<blockquote>
  <p><em>Symfony2 embraces standards</em>: First, Symfony2 is willingly centered around the HTTP specification (just have a look at the built-in HTTP reverse proxy). Then, we are embracing the PHP standards: PHPUnit, namespaces, PSR-0 autoloader, ... That makes Symfony2 easily interoperable with many other great PHP libraries.</p>
  
  <p><em>Symfony2 is decoupled</em>: Beside being a full-stack framework, Symfony2 is also a set of decoupled and cohesive components; Symfony2 is made of 21 components that can be used as standalone libraries: they have their own Git repositories, and they are all available as PEAR packages.</p>
</blockquote>

<p>For us this alignment means making sure code written for MidCOM and Midgard MVC, our two PHP frameworks runs properly under Symfony2, and filling various functionality gaps that exist between our frameworks and SF2.</p>

<p>I believe this to be a great opportunity for both communities. Especially for Midgard users this brings a great promise of future functionality coupled with full backwards compatibility.</p>

<p>Here are some very early results of this collaboration:</p>

<ul><li>Symfony2 can now be <em>run on AppServer-in-PHP</em> with our <a href="https://github.com/bergie/MidgardAppServerBundle">AppServerBundle</a>. Great performance and deployment benefits can be had by adopting AiP, so having a simple way to run SF2 with it is useful</li>
<li>There is a <a href="https://github.com/bergie/MidgardConnectionBundle">ConnectionBundle</a> which is responsible for initializing and <em>connecting to a <a href="http://www.midgard-project.org/midgard2/">Midgard2 content repository</a></em></li>
<li><em>Midgard MVC components can now be run as part of a Symfony2</em> application with the <a href="https://github.com/bergie/MidgardMvcCompatBundle">MvcCompatBundle</a>. Lots of work there still remains, but it is a good start</li>
</ul><p>Here you can see a screen from a simple AiP-powered SF2 application, running the <a href="https://github.com/bergie/org_midgardproject_news">org_midgardproject_news</a> component displaying content from the Midgard2 repository rendered via <a href="http://phptal.org/">TAL</a>:</p>

<p><img src="http://static.qaiku.com/e2b/919/62b/e2b91962b92e11e0a362916cb7aa58f358f3.jpg" alt="Midgard says Hello World" title="" /></p>

<p>After the Midgard MVC compatibility work is done we will also focus on ensuring full MidCOM applications run on Symfony2. There is already some precedent for this sort of compatibility work, as you can also run <a href="https://github.com/beberlei/WhitewashingZFMvcCompatBundle">Zend Framework applications under Symfony2</a>.</p>

<p>Congratulations to the Symfony2 community for a great release! I look forward to a lot more collaboration in the future.</p>
]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>60 24</georss:point>
            <category>midgard</category>
            <pubDate>Thu, 28 Jul 2011 19:04:08 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e0b94c5f573522b94c11e083aed3ea2c57fd28fd28</guid>
        </item>
        <item>
            <title>PHP and GObject Introspection</title>
            <link>http://bergie.iki.fi/blog/php_and_gobject_introspection/</link>
            <description><![CDATA[
<p><a href="https://live.gnome.org/GObjectIntrospection">GObject Introspection</a> is one of the hidden jewels of the <a href="http://developer.gnome.org/platform-overview/stable/">GNOME stack</a>: you write a library in C or <a href="http://en.wikipedia.org/wiki/Vala_%28programming_language%29">Vala</a>, and it becomes automatically available to <a href="https://live.gnome.org/GObjectIntrospection/Users">a wide variety</a> of languages and runtimes, including <a href="https://live.gnome.org/PyGObject">Python</a>, <a href="https://live.gnome.org/Gjs">JavaScript</a>, <a href="https://live.gnome.org/JGIR">Java</a> and <a href="http://blogs.kde.org/node/4444">Qt</a>.</p>

<p>Now I would like to bring GObject Introspection to PHP. Why?</p>

<p>For many years we in the <a href="http://www.midgard-project.org/">Midgard</a> community have been using GNOME infrastructure on the web server side, by building our persistence layer on top of GObjects, and providing <a href="http://teroheikkinen.iki.fi/blog/midgard_workshop_at_fscons/">D-Bus notifications</a> when content changes. So far this has been done with our own <a href="https://github.com/midgardproject/midgard-php5">custom PHP extension</a>.</p>

<p>I believe a common PHP extension providing GObject Introspection support would make more sense, as it wouldn't just benefit our own community, but also support efforts like <a href="http://gtk.php.net/">php-gtk</a>.</p>

<p><a href="http://github.com/indeyets">Alexey Zakhlestin</a> already <a href="https://github.com/indeyets/gobject-for-php">started a project</a> for this a while back, but unfortunately has been unable to finish it. Because of this, <a href="http://nemein.com/en/">we</a> would be willing to sponsor anybody interested in making the <a href="https://github.com/indeyets/gobject-for-php">gobject-for-php</a> extension work.</p>

<p>Benefits for the GNOME community:</p>

<ul><li>New supported development language and a large community of potential contributors</li>
<li>The possibility of making the GNOME stack relevant in web space. Just think of Telepathy or GStreamer in a web app</li>
</ul><p>Benefits for the PHP community:</p>

<ul><li>Access to the rich collection of GNOME libraries, many which may be useful when building web applications</li>
<li>Being able to use your PHP skills to build GNOME applications and bring them to interesting environments like <a href="http://www.ubuntu.com/ubuntu">Ubuntu</a> and <a href="http://cordiahd.org/">Cordia</a></li>
</ul><p>Benefits for the Midgard community:</p>

<ul><li>No need to maintain our own custom PHP extension</li>
<li>A more generic GObject Introspection extension has better chances of being included into Linux distributions and being available on hosting providers</li>
</ul><p>Let <a href="http://nemein.com/en/people/bergie/">me</a> know if you are interested. We're coming to the <a href="https://desktopsummit.org/">Desktop Summit</a> with <a href="http://blogs.nemein.com/people/piotras/">Piotras</a>, so for example that is a great opportunity to talk more about this.</p>
]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>60 24</georss:point>
            <category>desktop</category>
            <pubDate>Tue, 26 Jul 2011 12:15:01 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e0b780e2d102b6b78011e0975ef93144fab6d5b6d5</guid>
        </item>
        <item>
            <title>My secret agenda for PHP Content Management Systems</title>
            <link>http://bergie.iki.fi/blog/my_secret_agenda_for_php_content_management_systems/</link>
            <description><![CDATA[
<p>As I've written before, I'm concerned about the state of the PHP ecosystem. There are lots of good applications written in the language, but there is very little code sharing between different projects, mainly because of framework incompatibilities, but also because of quite a strong <a href="http://en.wikipedia.org/wiki/Not_Invented_Here">NIH</a> culture.</p>

<p>But there are also bright points. I've recently seen lots of exchange of ideas, and even potential code sharing between some communities including Symfony2, Midgard, TYPO3 and eZ Publish. Much of the vision in these systems is similar, as are many of the engineering principles. When everybody uses reasonable object-oriented design, namespaces, and test-driven development, it is much easier to share.</p>

<p>If I had to list three areas where there is most potential for collaboration, these would be:</p>

<h2>Content model on the browser: VIE and RDFa</h2>

<p>The age of communicating with your web audience via <em>forms</em> is almost over, and it is time to evolve. HTML5 includes support for the <a href="http://blog.whatwg.org/the-road-to-html-5-contenteditable">contentEditable</a> attribute which allows rich editing interaction straight on the pages, and there are cool editors supporting that, including <a href="http://aloha-editor.org/">Aloha Editor</a> and <a href="https://github.com/jejacks0n/mercury#readme">Mercury</a>.</p>

<p>To do proper front-end editing, your CMS and the JavaScript environment have to agree on the content model. Fortunately there is a great solution for this: just annotate your content with some RDFa.</p>

<p>Having RDFa on a page allows the browser to understand the content. What is a collection of blog posts for instance, and what is the title of a blog post. With this, my VIE library will provide you with a nice in-browser content management API based on <a href="http://documentcloud.github.com/backbone/">Backbone.js</a>. Getting there is easy:</p>

<ol><li>Annotate your pages with RDFa</li>
<li>Include <a href="https://github.com/bergie/VIE">vie.js</a> to the pages</li>
<li>Implement <a href="http://documentcloud.github.com/backbone/#Sync">Backbone.sync</a></li>
</ol><p>This allows a great deal of <a href="http://bergie.iki.fi/blog/decoupling_content_management/">decoupling in the CMS stack</a>. Suddenly the server side just has to worry about content management and page generation, and newer in-browser technologies can be used for actual content authoring.</p>

<p>Using RDFa annotations in your content comes also with another benefit: suddenly your pages themselves are an API into your content model. And search engines can understand and present your content better.</p>

<p>If you want to learn more about this, <a href="http://bergie.iki.fi/blog/midgard_create_and_vie_in_the_aloha_editor_conference/">watch my talk</a> from the Aloha Editor Dev Con.</p>

<h2>Content persistence and retrieval: PHPCR</h2>

<p>Historically, all CMSs have implemented persistence in their own way. There have been systems using relational databases like MySQL, systems providing their own content repository APIs like Midgard, and also some systems just using XML and the file system. This has reduced integration and code re-use possibilities between systems. In the Java world, a solution exists for this: the <a href="http://en.wikipedia.org/wiki/Content_repository_API_for_Java">Java Content Repository</a> standard (JCR).</p>

<p>Now JCR has been ported to PHP. <a href="http://phpcr.github.com/">PHPCR</a> provides a standard interface for all content management needs, and has multiple back-ends available. Depending on your deployment needs, you could store your content into a relational database, into Apache Jackrabbit, or into for example MongoDB.</p>

<p>PHPCR is great in that you can start small: just model your content with a simple, filesystem-like tree of nodes and properties. Then when you need it, a wealth of functionality is available. Versioning? Query builders? Access control? It is all there for you to use. And, depending on the PHPCR back-end, you'll have the ability to scale up to insane amounts of content.</p>

<p>While I've advocated <a href="http://bergie.iki.fi/blog/why_you_should_use_a_content_repository_for_your_application/">using content repositories</a> for years now, this is the first time PHP has a true standardized, vendor-neutral API for it. And PHPCR is even being integrated <a href="http://java.net/jira/browse/JSR_333-28">into the JCR specification</a>, eventually making it an official standard.</p>

<p><img src="http://farm7.static.flickr.com/6053/5915517564_ba20056559.jpg" alt="PHPCR discussion in Sursee, Switzerland" title="" /></p>

<p>Adoption is also picking up. Yesterday I was in a meeting where we had developers from TYPO3, Symfony2, Doctrine and Midgard discussing issues and solutions in the content repository space. I just hope the other projects also pick this specification up.</p>

<h2>Improving performance: AppServer-in-PHP</h2>

<p>Of the three, this is probably the most controversial idea. Traditionally PHP is run as a scripting environment on a regular web server, like Apache or Nginx. In such setup, when the server receives a request, it passes it on to the PHP environment. The PHP environment loads all the code needed to fulfill the request, runs it, sends the response back, and unloads everything loaded.</p>

<p>This is fine when PHP is being used in the way Rasmus originally intended, as a simple display layer. But nowadays most of <a href="http://www.sitepoint.com/rasmus-lerdorf-php-frameworks-think-again/">PHP runs on a big framework</a>, whether it is MVC or something custom like Drupal. And loading and then discarding a whole framework for each request is simply insane.</p>

<p>With <a href="http://github.com/indeyets/appserver-in-php">AppServer-in-PHP</a> (AiP), you have an environment where even a big framework can perform. AiP provides you with a full server environment for PHP, <em>written in PHP</em>. In this setup, your framework is loaded when the server boots up, and then each request just runs the request processing part of it.</p>

<p>During the <a href="http://www.aloha-editor.org/wiki/Aloha_Editor_Dev_Con_SanFrancisco_11">San Francisco Aloha Dev Con</a> we ported TYPO3 to run on AiP, and the performance results where staggering. A simpler request with not much I/O would run 3-4 times faster than the same code on regular PHP setup, and an I/O -intensive request would still be <em>twice as fast</em>. AiP can't do much about I/O performance, but at least the cost of having a framework is greatly reduced.</p>

<p>In short, AppServer-in-PHP is something any developer running web services with a PHP framework should consider. It is also a great way for framework developers to see if they have request isolation problems in their design.</p>

<p><em>This post has been written in the <a href="http://t3dd11.typo3.org/">TYPO3 Developer Days 2011</a> event where I was invited to discuss these ideas, and also help run the RDFa part of the <a href="http://www.slideshare.net/jocrau/semantic-typo3">TYPO3 Goes Semantic</a> workshop.</em></p>
]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>48 2</georss:point>
            <category>midgard</category>
            <pubDate>Fri, 08 Jul 2011 16:25:27 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e0a97ee3d56784a97e11e0bc94c70d6d8c7cd27cd2</guid>
        </item>
        <item>
            <title>Midgard Create and VIE in the Aloha Editor conference</title>
            <link>http://bergie.iki.fi/blog/midgard_create_and_vie_in_the_aloha_editor_conference/</link>
            <description><![CDATA[
<p>The <a href="http://www.aloha-editor.org/wiki/index.php/Aloha_Editor_Dev_Con_SanFrancisco_11">Aloha Editor Developer Conference</a> is happening this week in <a href="http://wiki.hackerdojo.com/w/page/25437/FrontPage">Hacker Dojo</a>, Mountain View. While some <a href="http://arstechnica.com/apple/news/2011/06/liveblog-wwdc-2011-keynote-on-june-6.ars">other events</a> may steal a bit of focus from this one, there seems to be a good amount of energy here. The event opened with <a href="https://twitter.com/draftkraft">Haymo Meran's</a> keynote on the state and roadmap of <a href="http://aloha-editor.org/">Aloha Editor</a>. As part of this there was an interesting observation:</p>
<blockquote>Aloha Editor has an impressive rate of adoption: Drupal, TYPO3, WordPress, Midgard and others are now in the process of integrating the editor. If all of these work out, Aloha Editor can reach an approximately <em>66% of the CMS market</em>.</blockquote>
<p>And since most of them will do this with my <a href="https://github.com/bergie/VIE">VIE library</a>, this is also great news for <a href="http://bergie.iki.fi/blog/decoupling_content_management/">Decoupled Content Management</a>, <a href="http://en.wikipedia.org/wiki/RDFa">RDFa</a> and the goals of the <a href="http://www.iks-project.eu/">IKS project</a>.</p>
<p><img src="http://bergie.iki.fi/static/1/1e090a166ba8dce90a111e0aec3d9657ffc1c7b1c7b_bergie-alohadevcon.jpg" border="0" alt="bergie-alohadevcon.jpg" title="bergie-alohadevcon.jpg" /></p>
<p>I also gave a talk on how we <a href="http://bergie.iki.fi/blog/introducing_the_midgard_create_user_interface/">use Aloha Editor and VIE in Midgard Create</a>. Both <a href="http://www.slideshare.net/bergie/midgard-create-and-vie">slides</a> and <a href="http://bambuser.com/channel/alohaeditor/broadcast/1719639">video</a> are available.</p>
<p>
<object id="bplayer" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="480" height="411"><embed name="bplayer" src="http://static.bambuser.com/r/player.swf?vid=1719639" type="application/x-shockwave-flash" width="480" height="411" allowfullscreen="true" allowscriptaccess="always" wmode="opaque"></embed><param name="movie" value="http://static.bambuser.com/r/player.swf?vid=1719639"></param><param name="allowfullscreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="opaque"></param></object>
</p>
<p>Later this week there will be also an interesting BoF in SemTech about <a href="http://www.w3.org/2001/sw/wiki/SemTech2011BOF">Structured Data in HTML</a> that I will try to attend. After that it is time to fly home...</p>
<p><em>Photo by <a href="http://www.flickr.com/photos/nils-dehl/sets/72157626900822236/">Nils Dehl</a>.</em></p>]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>37 -122</georss:point>
            <category>midgard</category>
            <pubDate>Tue, 07 Jun 2011 00:53:46 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e090a0993bb09490a011e0a3bc8f3a4b3a30793079</guid>
        </item>
        <item>
            <title>Want to do something similar to PostRank?</title>
            <link>http://bergie.iki.fi/blog/want_to_do_something_similar_to_postrank/</link>
            <description><![CDATA[
<p>So, <a href="http://blog.postrank.com/2011/06/postrank-has-been-acquired-by-google/">Google acquired PostRank</a>, the service calculating impact of blog posts and other items in social media.</p>
<p>If you want something similar but without the Google tie-in, then a good option is my <a href="https://github.com/nemein/com_meego_planet">social impact calculator</a> which is fully free software written in PHP. It was originally <a href="http://bergie.iki.fi/blog/calculating_news_item_relevance/">written in 2007</a>, but the newer version has been cleaned of Midgard dependencies and updated to reflect the current popular social networking services. Usage example from <a href="http://bergie.iki.fi/blog/calculate_the_impact_of_your_posts/">my earlier post</a>:</p>
<p><span style="color:#333333;font-family:'Lucida Grande', Verdana, Arial, sans-serif;font-size:13px;">
</span></p><pre>require('calculate.php');

$url = 'http://bergie.iki.fi/blog/introducing_the_midgard_create_user_interface/';

// Get the raw count for only one source
echo com_meego_planet_calculate::hackernews($url); // 145
echo com_meego_planet_calculate::facebook($url); // 1

// Get weighted total score for all sources
echo com_meego_planet_calculate::all($url); // 130.8</pre>
]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>45 -122</georss:point>
            <category>midgard</category>
            <pubDate>Sat, 04 Jun 2011 08:29:33 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e08e84c647a5de8e8411e0812773cd9486f39af39a</guid>
        </item>
        <item>
            <title>Going to San Francisco</title>
            <link>http://bergie.iki.fi/blog/going_to_san_francisco/</link>
            <description><![CDATA[
<p>This weekend, after <a href="http://falsyvalues.com/">Falsy Values</a>, I will be flying to San Francisco for a couple of weeks. There are some conferences:</p>
<p>
</p><ul><li><a href="http://sf2011.meego.com/">MeeGo Conference</a>, May 23-25</li>
<li><a href="http://aloha-editor.org/wiki/Aloha_Editor_Dev_Con_SanFrancisco_11">Aloha Editor dev con</a>, June 6-8</li>
</ul><div>However, as there is quite some time between these two events, it would be interesting to meet cool people and/or projects. So if you're in the area, drop <a href="http://bergie.iki.fi/">me</a> a note.</div>
]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>60 24</georss:point>
            <category>desktop</category>
            <pubDate>Tue, 17 May 2011 16:33:36 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e080a369ddedf680a311e08dc09325a9e447b447b4</guid>
        </item>
        <item>
            <title>PHP can perform better than Node.js</title>
            <link>http://bergie.iki.fi/blog/php_can_perform_better_than_node-js/</link>
            <description><![CDATA[
<p><a href="http://bergie.iki.fi/blog/silex_is_like_expressjs_for_php/">My previous post about using Silex and AppServer-in-PHP</a> similarly to <a href="http://expressjs.com/">ExpressJS</a> generate quite a bit of interest. In the <a href="http://news.ycombinator.com/item?id=2543914">Hacker News thread</a> there was a question about memory usage, and so I put the AppServer under siege. Memory usage stayed constant at:</p>
<pre>13958 bergie    20   0  125m  10m 2136 S    1  0.6   0:00.28 php        
13959 bergie    20   0  125m  10m 2136 S    1  0.6   0:00.31 php </pre>
<p>Then I did the same Siege for the ExpressJS version:</p>
<pre>14051 bergie    20   0  615m  12m 4988 S    0  0.7   0:00.34 node</pre>
<p>The PHP implementation served 3.80 requests per second, while the Node.js version served 3.79, both on <a href="http://bergie.iki.fi/blog/11-macbook_air-the_best_computer_i-ve_ever_had/">11" MacBook Air with Ubuntu 11.04</a>.</p>
<p>This trivial example isn't obviously the big test of PHP app serving vs. Node.js, but at least I was surprised that PHP did better than Node here.</p>]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>60 24</georss:point>
            <category>midgard</category>
            <pubDate>Fri, 13 May 2011 13:17:25 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e07d63583cc3127d6311e0ab73416803ec3e643e64</guid>
        </item>
        <item>
            <title>Silex is like ExpressJS for PHP</title>
            <link>http://bergie.iki.fi/blog/silex_is_like_expressjs_for_php/</link>
            <description><![CDATA[
<p>We had the <a href="http://wiki.iks-project.eu/index.php/IKSContentRepositoryWorkshopSwitzerland">PHP Content Repository workshop</a> at <a href="http://www.liip.ch/">Liip</a> in Zurich earlier this week. During the time we also discussed some other code reuse, like utilizing parts of the <a href="http://symfony.com/">Symfony2</a> framework in Midgard. The Liip guys mentioned <a href="http://silex-project.org/">Silex</a>, a cool micro-framework written on top of Symfony2. It greatly resembles the <a href="http://expressjs.com/">ExpressJS framework</a> that we already use in some of our <a href="http://wiki.iks-project.eu/index.php/VIE/Palsu">Node.js projects</a>.</p>
<p>Here is a simple example of registering a route and displaying something when it is called:</p>
<pre>&lt;?php
$app-&gt;get('/hello/{name}', function($name) { 
    return "Hello $name"; 
});</pre>
<p>Compare this to same in Express:</p>
<pre>app.get('/hello/:name', function(req, res){
    res.send('Hello ' + req.params.name);
});</pre>
<p>As we prefer to run Midgard on top of <a href="https://github.com/indeyets/appserver-in-php">AppServer-in-PHP</a> instead of regular mod_php, a good first step with Symfony was to figure out how it would integrate with persistent PHP processes.</p>
<p>It seems this is indeed easy. In couple of hours, without prior Symfony2 experience, I wrote a <a href="https://github.com/bergie/Silex/blob/master/src/Silex/Extension/AiPExtension.php">simple Silex extension</a> that handles the communications between Silex/Symfony and AiP. An <a href="https://github.com/bergie/Silex/tree/master/example/AiP">example for using it</a> can be found from my GitHub fork.</p>
<p>Running it under siege shows one of the benefits of AiP. While the first request is a bit slower, the later ones are really fast as the application server will load the Symfony classes only once:</p>
<pre>HTTP/1.0 200   0.03 secs:      11 bytes ==&gt; /hello/World
HTTP/1.0 200   0.00 secs:      11 bytes ==&gt; /hello/World
HTTP/1.0 200   0.01 secs:      11 bytes ==&gt; /hello/World
HTTP/1.0 200   0.00 secs:      11 bytes ==&gt; /hello/World</pre>
<p>AppServer integration to Symfony needs to be cleaned up before it is ready for general consumption. But this example already shows that there is quite a bit of potential in the combination. If you're interested in helping, please contribute to <a href="https://github.com/bergie/Silex">the codebase</a>.</p>]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>60 24</georss:point>
            <category>midgard</category>
            <pubDate>Wed, 11 May 2011 17:31:13 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e07bf4782e336a7bf411e09334ab6593cacb5ccb5c</guid>
        </item>
        <item>
            <title>Join the PHP Content Repository Workshop on May 8th</title>
            <link>http://bergie.iki.fi/blog/join_the_php_content_repository_workshop_on_may_8th/</link>
            <description><![CDATA[
<p>The <a href="http://www.iks-project.eu/">IKS Project</a> and <a href="http://www.liip.ch/">Liip</a> are organizing a <a href="http://wiki.iks-project.eu/index.php/IKSContentRepositoryWorkshopSwitzerland">PHP Content Repository Workshop</a> in Zurich, Switzerland on May 8-9 2011. If you're working on PHP-based content management technologies, this event should be a very useful one to join or at least follow.</p>
<p>What is a content repository?</p>
<blockquote>
<p><a href="http://bergie.iki.fi/blog/what_is_a_content_repository/">Content Repository</a> is a programming interface for connecting with various persistent data stores. On the Java side, the <a href="http://en.wikipedia.org/wiki/Content_repository_API_for_Java">JCR specification</a> has gained quite a bit of traction, allowing for easy decoupling of a Content Management System from the actual storage implementation. On PHP side there have been several content repositories in use, like <a href="http://couchdb.apache.org/">Apache CouchDB</a> and <a href="http://www.midgard-project.org/midgard2/">Midgard</a>, each with vendor-specific APIs.</p>
<p>The <a href="http://github.com/phpcr">PHPCR</a> effort aims to provide a standard API that can be used by any PHP content management system to interface with any content repository. The first PHPCR implementation is <a href="http://jackalope.github.com/">Jackalope</a>, which allows PHP systems to use <a href="http://jackrabbit.apache.org/">Apache Jackrabbit</a> as their content store and eventually also will support direct storage. There is also a <a href="https://github.com/bergie/phpcr-midgard2">Midgard PHPCR provider</a> in the works.</p>
<p>As <a href="http://www.slideshare.net/uncled/introduction-to-jcr">described by</a> David Nuescheler, the advantages of using a standard content repository interface are:</p>
<ul><li>Functional Definition of a “Content Repository”</li>
<li>Common Vocabulary!</li>
<li>No longer learn (dozens of) (ugly) proprietary APIs</li>
<li>Write (mostly) portable code, for Document Management, Web Content Management, Source Code Control</li>
<li>Compare Repository Functionality</li>
<li>No more information silos and vendor Lock-in Content-Centric Infrastructure</li>
</ul></blockquote>
<p>If you're interested in the event, please <a href="http://wiki.iks-project.eu/index.php/IKSContentRepositoryWorkshopSwitzerland#Attendees">sign up on the wiki page</a>. See also the <a href="http://lanyrd.com/2011/phpcr/">event on Lanyrd</a> and <a href="https://blog.liip.ch/archive/2011/04/28/phpcr-workshop-in-zurich-8th-of-may-2011.html">Liip's workshop announcement.</a></p>]]></description>
            <author>henri.bergius@iki.fi (Henri Bergius)</author>
            <georss:point>60 24</georss:point>
            <category>midgard</category>
            <pubDate>Thu, 28 Apr 2011 11:46:59 +0000</pubDate>
            <guid>http://bergie.iki.fi/midcom-permalink-1e0718d39d4d676718d11e09b88d16e42ac561a561a</guid>
        </item>
    </channel>
</rss>

