Piotras' blog: Archive
2007-06-01 - 2007-06-30
Midgard developers meeting
Posted on 2007-06-07 19:40:05 UTC.
Another Midgard developers meeting. Cool!
This year I didn't fly to Helsinki, but drove with Solt instead. The trip was long but very interesting though. Great opportunity to see Lithuania, Latvia and Estonia. Especially the last one as we could visit an old city of Tallin. This is very interesting and exciting fact - possibility to travel to many interesting places when you are involved in open-source projects. Like Midgard.
As usual, agenda was changed ad-hoc, but we had interesting discussions about Midgard features. Also many things has been done. The most important ones include:
DBUS in midgard-core. Once again we all agreed, it's a "must be implemented" feature, which will make Midgard yet more powerfull framework.
Alexander explained new GPLv3 licence model. This is very important in open source projects to be licensed with correct and particular license. Especially if you consider the fact that companies like Microsoft used to grant patents on technologies which was initialy released under GPL license. Technologies like MgdSchema which highly extends repligard's one.
Alexander also started to write experimental midgard-php extension's feature to cache already included PHP files. With possibility to also cache (transparently) code included from database.
Bergie and Tarjei did excellent work with creating new centralized system to manage Midgard and MidCOM projects with all their subcomponents. Together with Johan they set up new mailing lists. Amazing! It's one of the best parts of meetings - many people can focus on the same work at the same time. It's not easy to arrange something like this "online". Especially if you consider different time zones, different model of work, different habbits and duties. I must say: Great work guys!.

On Saturday we started Midgard Installation storyboarding. Midgard CMS part is not easy to install as other ones. But, on the other hand it's not just yet another easy CMS. According to our plans and ideas, it will still need root access to install system libraries only but the rest ( like Virtual Hosts or databases ) will be managed via simple command line tools or web browser interfaces. Despite the fact we have many work to do , we should make it reasonably easy and fast as new architecture is language unaware, so setup can be done on many levels with exactly the same logic.
On Sunday we visited Suomenlinna island. Can you believe it? Without computers and internet :) Well... I just turned on my N770 to show how's new midgard-core works on this mobile device. ( Sounds like I can have my personal Midgard in my pocket :) Funny thing , we have been there only couple of hours, but sun managed to burn my face. Remember, this is a place you must visit when you're in Finland.
Great thanks to our sponsors: Maemo, Nemein and FTC. We didn't run out of beer during late night sauna breaks :) ("Night" rather. There is still sun shining about 10pm in Finland. ) And frankly speaking you can blame yourself if you haven't been there. Great people, great time and place. And excellent company for hacking, suana and beer!
midgard-project.org and up and down
Posted on 2007-06-14 11:48:49 UTC.
As you probably noticed Midgard website was acting up for last two days. And to be honest I started to blame myself as I made database update using datagard just before server crashed. I started to wonder: "why it happened on our server when it works fine everywhere else?". Bad luck?
This morning I got shell access to server and stopped to disable services one by one and investigate what is really going on there.
Two hours later I noticed that Apache is starting to use 100% ( well , top said 116% few times ) of CPU every five minutes. Cron job? That was it. I disabled MidCOM cron services till MidCOM developers fix the issue.
We just need to find the issue quickly.
Flood
Posted on 2007-06-15 09:12:19 UTC.
Flood and facts.
- 30 minutes.
- city without river
- water falls ( not rain ) and hail
- something I saw the first time in my life
Bread, electricity and events for midgard-php
Posted on 2007-06-18 20:17:21 UTC.
Just commited latest fixes to generic connect method assigned to all MgdSchema classes. To those ones only , but it's very easy to add such method to all classes registered in midgard-php extension.
A bit of code instead of screenshot.
Create your own callbacks ( functions or methods ):
function testconnect($id = 0, $udata = 0)
{
echo "Callback for event (parameters: ${id} AND ${udata}) \n";
}
class EventTest {
function EventTest() {
}
function FetchEvent(&$param = 0) {
echo "Got event with ${param} parameter. \n";
}
}
My test function and test method are very simple. But the point here is to keep them simple. Once you have midgard-php working on your development machine, you can create very complicated callbacks :)
Let's create instances...
$et = new EventTest();
$t = new midgard_topic(1);
$art = new midgard_article(1);
$_b = 345;
...and connect callbacks to object which emmits signal.
$art->connect('action-updated', 'testconnect');
$art->connect('action-updated', 'testconnect', NULL, array(1));
$art->connect('action-updated', 'testconnect', NULL, array(3, &$_b));
Third parameter is explicitly set to NULL, as connect method expects object so ignores it if it's NULL.
$art->connect('action-update', 'FetchEvent', $et, array('cool'));
$art->connect('action-update', 'update', $t);
We set method name ( instead of function name ) when third parameter is an object. In both cases, fourth parameter must be an array and first one defines which event ( signal ) we want to connect to.
And the "application's" code:
$_b = 678;
$art->update();
And finally, the output:
midgard-core (pid:21523):(info): midgard_article::update(...)
Got event with cool parameter.
midgard-core (pid:21523):(info): midgard_topic::update(...)
Callback for event (parameters: 0 AND 0)
Callback for event (parameters: 1 AND 0)
Callback for event (parameters: 3 AND 678)
As you noticed. Callback can be any function, and any class' method. MgdSchema or pure PHP one.
Have a nice events!