MW

Blog - page 13

Recent Posts

Building KDevplatform, KDevelop and the PHP plugin from Git (March 06, 2009)

In a follow up to my last post about the PHP plugin for KDevelop and Quanta I want to detail how I setup my build environment. Since I’m only working on KDevelop I only want to compile that. For all other applications, I use the packages my distribution makes available. Below you this is possible.

Note: I use Kubuntu and hence some commands like aptitude and the package names etc. will have to be adapted to your specific distribution. But the general idea should be the same and the packages should be called at least somewhat similar. You could always take a look at the techbase article on compilation of KDE 4 to get a more general HowTo.

It is generally a very good idea to read some articles on the techbase. Especially in the Getting Started section.

getting the dependencies

First, you’ll need to install some packages to satisfy dependencies and to get a working compile chain (think cmake, gcc and stuff). The following command only lists very few packages but they have a huge list of dependencies which your package manager will take into account automatically. Don’t be suprised by a possibly huge list of packages ;-) So some disk space will be required (though I doubt it’s more than 250MB in total).

continue reading...

Building KDevplatform, KDevelop and the PHP plugin from Git (March 06, 2009)

In a follow up to my last post about the PHP plugin for KDevelop and Quanta I want to detail how I setup my build environment. Since I’m only working on KDevelop I only want to compile that. For all other applications, I use the packages my distribution makes available. Below you this is possible.

Note: I use Kubuntu and hence some commands like aptitude and the package names etc. will have to be adapted to your specific distribution. But the general idea should be the same and the packages should be called at least somewhat similar. You could always take a look at the techbase article on compilation of KDE 4 to get a more general HowTo.

It is generally a very good idea to read some articles on the techbase. Especially in the Getting Started section.

getting the dependencies

First, you’ll need to install some packages to satisfy dependencies and to get a working compile chain (think cmake, gcc and stuff). The following command only lists very few packages but they have a huge list of dependencies which your package manager will take into account automatically. Don’t be suprised by a possibly huge list of packages ;-) So some disk space will be required (though I doubt it’s more than 250MB in total).

continue reading...

PHP support for KDevelop 4 (and eventually Quanta+) (March 03, 2009)

Hello Planet KDE!

I want to give you a little insight on the current state of PHP support in KDevelop4:

Me and Nikolaus Sams (nsams) are working diligently on a plugin for PHP support in playground. It’s somewhat stable, i.e. we fix any crashes we stumble upon, but I would call it Alpha state at most. It may eat your babies so to speak. Yet I’m happy to say that at least one user is already using it for production (hi leinir ;-) ).

implemented PHP support

Well, here’s a (not complete) list of features that are already working. Though I have to warn you: no screenshots included ;-) It’s actually all very similar to the C++ screenies you can see on the web.

sematic highlighting

Let’s start with a feature that only very recently was added for PHP - semantic highlighting. Niko moved some language independent parts of the C++ plugin from KDevelop to KDevplatform and now PHP has the same code highlighting features as C++.

continue reading...

PHP "is_whitespace" performance (February 12, 2009)

Easy question: What is the fastest way to determine if a string in PHP is whitespace-only?

Easy answer: ![preg_match](http://www.php.net/preg_match)('[^\s]', $string);

Read on for the explanation:

I applied the codeblocks feature of my profile.class.php, here’s the testcase:

    <?php
    require 'profile.class.php';
     
    $iterations = 10000;
     
    profile::codeblocks(array(
      'trim(long string) == ""' => 'trim($long) == ""',
      'trim(long string) === ""' => 'trim($long) === ""',
      'rtrim(long string) == ""' => 'rtrim($long) == ""',
      'rtrim(long string) === ""' => 'rtrim($long) === ""',
      'ltrim(long string) == ""' => 'ltrim($long) == ""',
      'ltrim(long string) === ""' => 'ltrim($long) === ""',
      '!preg_match("[^\s]", long string)' => '!preg_match("[^\s]", $long)',
      'ctype_space(long string)' => 'ctype_space($long)',
      'trim(short string) == ""' => 'trim($short) == ""',
      'trim(short string) === ""' => 'trim($short) === ""',
      'rtrim(short string) == ""' => 'rtrim($short) == ""',
      'rtrim(short string) === ""' => 'rtrim($short) === ""',
      'ltrim(short string) == ""' => 'ltrim($short) == ""',
      'ltrim(short string) === ""' => 'ltrim($short) === ""',
      '!preg_match("[^\s]", short string)' => '!preg_match("[^\s]", $short)',
      'ctype_space(short string)' => 'ctype_space($short)',
    ), array(
      'long' => str_repeat(" \n\t ", 500) . "a" . str_repeat(" \n\t ", 500),
      'short' => str_repeat(" \n\t ", 5) . "a" . str_repeat(" \n\t ", 5),
    ), $iterations);
     
    profile::print_results(profile::flush());

continue reading...

recent GeSHi contributions (apache, xorg, apt, performance, ...) (June 18, 2008)

Your favourite syntax highlighter for web applications, GeSHi, recently got some new features and bug fixes. By yours sincerely. A rough summary of what I contributed:

  • various performance improvements, i.e. some speed optimizations and reduced memory consumptions (especially peak memory usage is down by roughly 1MB when highlighting geshi.php by itself)
  • minor bugfixes, including one which prevents some nasty PHP notices on PHP 5 systems to contaminate your precious log files
  • improved language files: bash, apache
  • added language files: GNU Gettext, Xorg configuration and Apt sources.list

Some of those features were already shipped with the recent 1.0.7.22 release. But the two new language files and the improvements to the existing apache language file are currently only available via SVN. Wait for the next stable release which should be 1.0.8.

continue reading...

Drupal modules and other configuration (June 11, 2008)

Drupal is such a pleasing piece of software.

Just a few days ago I found some very cool new (to me) hidden functionality. Additionally I’ve installed some more modules which I want others to be aware of.

available updates email notification

Let’s start with the “hidden” functionality: Drupal 6 incorporates some parts of a Drupal 5 module which notifies you about available updates (see /admin/reports/updates). Pretty easy to stay updated with that alone. But I thought I’d had to check that page frequently for new updates. Not so! Say hello to the tab “Settings” on the very page and insert your email address to stay updated via email. Satisfying and built-in… dumb me searches in vain for a module with that functionality…

Yet it brought my interest to other useful modules:

Logging and alerts

The Logging and alerts module gives you a way to send emails to an email address of your choice in case of errors etc. Pretty neat since I don’t want to lose time by regularly scanning my log entries…

continue reading...

LinuxTag Day One (May 28, 2008)

Like last year I’m again standing at the Kubuntu Community booth at this years LinuxTag. Just now I’ve attended the keynote held by Aaron Seigo, ambassador of the KDE project. It was a very interesting talk which covered topics like Internet-Mobile-Desktop interaction, security, effects, Nokia and more. The most important parts roughly listed are:

  • you’ll one day be able to use the same (KDE) applications everywhere - Marble and Plasma for example already just compile and work on mobile devices
  • the internet will get much more embedded into your everyday applications. Marble with OpenStreetMap & Wikipedia support or Amarok with its storage backends (Lastfm, Jamendo etc. etc.) are good examples in this regard.
  • KDE4 is much more accessible than KDE3 thanks to QAccessible
  • security and privacy is not forgotten! This is free software, don’t forget that. Plasma Applet packages will get GPG signed (just like the DEB packages in Apt). And you have control over what data is send where - no Stasi 2.0 here!
  • Nokia is actively supporting KDE, fear not! And of course never underestimate the power of the Free Qt Foundation.

continue reading...

Redaxo Impressions (March 13, 2008)

Today at work I had my first contact with Redaxo, a German contact management system written in PHP and based on MySQL. I’ve heard of it before but never used it, there always seemed to exist better solutions - Drupal for example. But the company I work for already committed itself to Redaxo for this client. So no chance to work with Drupal this time - a pity.

But new experience with other solutions is a great thing. I thought Redaxo had its right to exist: its very small.

Here I don’t mean the filesize or whatever - I mean the size of the admin panel to begin with. It has not that many features. It’s very easy to understand. The average John Doe which is not that websavvy wont be confused by a multitude of choices. And I think I got to know pretty much all of Redaxo in just a few hours — which I can’t say about the steep learning curve of Drupal. And since the website of this client will be small I first thought Redaxo will do quite good.

The deeper I dug into Redaxo the more annoyed I got by its shortcomings though: There are modules and addons with which you can do pretty much all you need. But not one module I used was ready out of the box. Always I had to do adjustments. Drupal does much better here. And what you can do with overloading in Drupal is millions of light years ahead of what Redaxo is able to do. Oh and the developers of Redaxo really should take a look at Drupals documentation! After some searching on the official website I stuck to grep -R "function XXX" . for Api references…

continue reading...

Drupal Spam module ported to D6 (March 02, 2008)

I’ve got a pretty well working spam module for Drupal 6 now. Please test it, you can get the most up-to-date tarball here:

http://drupal.org/node/222849

Take the last tarball available, should be the best. I’m planning on testing it live on this site. On my localhost testbox it worked pretty well.

continue reading...

Hello Drupal World! (February 21, 2008)

Yes! I’ve finally done it. I’ve moved my website to Drupal, which is so much better than my old 3co stuff. Tons of great modules out there and those I couldn’t find for Drupal 6, which was recently released, I ported. Well not all of them, there are still some I’m really looking forward. On the top of my list are definitely the spam module and the Akismet module. Minutes after my move I got my first spam comment…

Well let’s see how I might get involved into Drupal development. I already filed some patches for the following modules:

  1. Marksmarty: better GeSHi support and some other minor things, but it doesn’t seem to be what the maintainer wants. I’ll have to move it into another extra-module then. Also some work to separate Smartypants and Markdown into distinct modules. Furtheron I’ve added support for PHP Markdown’s no-markup mode. This as well needs some more work. Maybe it will be dropped again and the pristine Drupal HTML Filter will be used, lets see.

continue reading...