I now finished adding RSS support to the blog module of Ismo CMS, so one can now subscribe to RSS feeds of this blog, both for all changes or for updates just in one category, by using the rss link to left. Please report any problems to me by mail, thanks.
I recommend that one use PHP 4.3.X or at least 4.2.X when using IsmoCore and hence also when using IsmoBlog. However Sourceforge only have version 4.1.2 installed. But I wanted to set up a example installation of IsmoBlog there so I went to work.
First I needed PEAR because even if some parts of PEAR were installed, actually I didn’t even check, I’m sure they would be too old versions for what IsmoCore requires. So I went to pear.php.net and checked the installation instructions because I’ve never installed PEAR separately before as I always compile PHP by hand myself. Installing PEAR is simple, all that’s needed is to run
$ lynx -source http://go-pear.org | php
in a shell and then answer the questions and give the path to where one wants the installer to install the files.
After that had finished I had to install the packages IsmoCore requires (they are mentioned in IsmoCore’s installation instructions) and then I installed IsmoCore and IsmoDB. I also added
at the top of IsmoBlog’s do.php file so that it will find my custom PEAR installation. Ok, that was the PEAR packages…
IsmoBlog uses Smarty which is not available as a PEAR package. So I went and downloaded the latest version and put it in a good location.
Now it was time to configure IsmoBlog.
$ mv Configuration.tmpl.php Configuration.php $ vim Configuration.php
After that I tried to run the installation script (php install.php) but do you think it worked? Of course not. I had forgotten to change one import statement to use ismodb.db instead of ismocore.db when I splitted IsmoDB out into its own package but even correcting that didn’t help much.
The mysql database at SourceForge isn’t running on localhost and IsmoBlog cannot currently be configured to use a database on another host. Damn, so I had to add a DATABASE_HOST configuration directive and change relevant parts of the code to honor it. When that was one I could finally complete the installation.
With a bit of anticipation I tried to access my new IsmoBlog installation and I was greeted with an error page. IsmoDB is currently using the array_change_key_case method in one place and it was added in PHP 4.2.0 so it isn’t available in SourceForge’s PHP version. But after a short search in the PHP manual I found anlar at hotmail dot com’s PHP implementation of that function and I added that to IsmoDB.
I could now access the IsmoBlog installation but there were no blog entries, of course. So I tried to login to add one, only to notice a weird problem.
I could sometimes login but after being redirected to the admin page I got sent back to the login page again. So the admin page didn’t think that I was logged in even though the login page approved of my credentials and forwarded me to the admin section.
I added some echo() and print_r() statements, the best debugging tools :) and I noticed that the session was lost but not all the time only sometimes. It went in a pattern, if I reloaded the admin page I would get the debugging output four times in a row (so the session wasn’t found) and then get the real admin page two times in a row (so the session was found) and then it would start over again.
This left me very perplexed. I couldn’t understand how the session sometimes was found and sometimes not. But when looking through the session section of the PHP manual I noticed the session.save_path configuration option and got an idea.
What if there are more than one apache server and some requests go to for example server A and the other requests to server B. And what if a session on server A can’t be found on server B? I guess session.save_path should be set up to a NFS shared directory by default but maybe it isn’t on SourceForge or maybe there is something wrong with it. I thought it was worth trying to change the session.save_path setting and see what happened.
And guess what? It started to work! So for some reason the PHP sessions are not shared between all SourceForge’s apache servers using their configuration. Quite crappy if you ask me but maybe there’s a reason for it.
So now IsmoBlog was working on SourceForge and I was writing the first entry. But I noticed a weird escaping problem of ‘, ” and \ characters and I thought it was weird that I hadn’t noticed it on morrdusk. But after some phpinfo():ing I noticed that magic_quotes_gpc was enabled on SourceForge.
I don’t remember changing the value of that setting on morrdusk, so maybe the defaults were different in the PHP 4.1.X era. Anyways, adding
php_value magic_quotes_gpc 0
to the .htaccess file fixed that problem and IsmoBlog is now running on SourceForge.
The conclusion is that I found some problems with IsmoBlog’s current configuration alternatives which I will fix and I will also add the missing function to IsmoDB. After this the Ismo tools should work fine with PHP 4.1.X even though I still recommend the use of a newer PHP version.
The caching hasn’t been throughly tested so it might still have some minor issues. But it should opimally return a 304 response if the cache file hasn’t changed and the cache file should only be removed when an action affecting it, like a new blog entry being added to a cached category page, happens.
Neat. I’m writing this using the textile syntax. It’s really nice! Blog entries can now be written either in plain HTML or in the textile format. I wonder if I should borrow the textile syntax for IsmoDoc. The nice thing with IsmoDoc is that it supports converting also to plain text and to PDF , textile can only convert into HTML . But IsmoDoc currently only supports a subset of the formatting textile supports so it makes sense to use textile for IsmoBlog.
Note to self always remember to escape things in hidden input fields . Of course I had forgotten to do that so the first time I wrote this entry most of the text got lost :/ But now it’s fixed and I’ll release IsmoBlog 0.0.4 later tonight.
I managed to release 0.0.7 as scheduled this weekend. Splitting out the database stuff into an own package reduced the size of the IsmoCore package with 80 kb! Most of that is Metabase, so the IsmoDB package will be really slim when I’ve changed it to use MDB instead. That shouldn’t take long as MDB includes both a PEAR DB and a Metabase wrapper.
This version of IsmoBlog that I’m currently testing by writing this entry should support previewing. It will be interesting to see if it works :) If it does I can move on to add support for comments and RSS feeds.
Cool the preview works. Well, I did unit test it first locally but I can’t test the navigation between the pages that way.
Yes! I managed to release 0.0.5 a couple of day ago. Yay! Now I can finally start on the things I didn’t dare to start on because then 0.0.5 would have been delayed forever.
This blog is now powered by IsmoBlog. Let’s see how long it takes until it breaks..