• Home
  • About
  • Contact
  • tweets by me

    About me
    • Moving from phpUnderControl to Jenkins as CI solution 38 mins ago
    • Reviewing delivered functionality and code and testing in general, important (yet sometimes tedious) work! 4 hrs ago
    • More coffee FTW! 4 hrs ago
    • More updates...
  • Recent Posts

    • Outputting formatted XML using PHP
    • SSH Tunneling across multiple hosts in Linux
    • Pre-commit hook in Git: Running PHPUnit
    • Multiple types of opening braces when matching pairs with the tokenizer/ext
    • Introducing: DocBlox
« Previous Page — Next Page »

Released a new version of sfPropelRowLevelAccessBehaviorPlugin

Oct 25
Posted on October 25th, 2009 In category Lost in space 
By mvriel Tagged as PHP  plugin  rla  row-level-access  sfPropelRowLevelAccessBehaviorPlugin  symfony 

After discovering a somewhat annoying bug had I removed the previous release of my plugin; I could not allow people to download and install a version of which I knew such a bug existed.

Thus after some recoding and bug fixing I am proud to present version 1.1 of sfPropelRowLevelAccessBehaviorPlugin!

You can find it in the symfony plugin repository (http://www.symfony-project.org/plugins/sfPropelRowLevelAccessBehaviorPlugin) and install it with the symfony plugin:install command.

Please examine the README for details about implementing Row Level Access with this plugin and if you have any questions, please mail me.

Thank you for listening

No Comments »

Symfony plugin released!

Oct 02
Posted on October 2nd, 2009 In category Development  PHP 
By mvriel Tagged as acl  PHP  plugin  release  row-level-access  symfony 

A few days ago I blogged about the lack of Row Level Access control in symfony. Although I still have too little time I was seduced to try and tackle this problem.

The result is clear! A new plugin was born and it is available for all to enjoy at http://www.symfony-project.org/plugins/sfPropelRowLevelAccessBehaviorPlugin.

It is very easy to use, the details of which you can find on the plugin page and in the README file.

All that remains is to wish you heaps of fun coding!

No Comments »

Row level ACL on symfony

Sep 29
Posted on September 29th, 2009 In category PHP 
By mvriel Tagged as acl  cakephp  PHP  plugin  row-level-access  symfony 
symfony logo

Even though sfGuardPlugin is a great ACL plug-in; it unfortunately cannot handle Row Level Access. In most of my personal projects I require such a level of control and the solutions chosen always feel a bit ..hackish..

(more…)

2 Comments »

Using Symfony’s Lime in phpUnderControl

Aug 19
Posted on August 19th, 2009 In category Articles  Development 
By mvriel Tagged as CI  Code  lime  PHP  phpUnderControl  symfony 

Do you know phpUnderControl? Do you know and use Lime?

If you answered ‘Yes’ to the questions above then you will likely have tried to integrate Lime into phpUnderControl. So have I..

What I discovered was that there are 3 ways in which this problem can be solved.

  1. Use Lime’s xUnit output mechanism, only available in Symfony 1.3 and higher (or so I have been told) available when Lime 2 is released (which is usable in symfony versions earlier than 1.3).
  2. Use Stefan Koopmanschap’s symfonyUnderControl plugin (http://www.leftontheweb.com/message/symfonyUnderControl_lime_integration_with_phpUnderControl), I only know for sure that it can be run in Symfony 1.2. Other versions of the framework might work as well.
  3. Or, and this is the subject of this post, directly use Lime from phpUnderControl

The order above is (in my opinion) from best to less best, xUnit xml output is always preferred above the direct inclusion in phpUnderControl. (more…)

6 Comments »

Changed theming to use Crossbrand

Mar 21
Posted on March 21st, 2009 In category PHP 
By mvriel Tagged as crossbrand  maintenance  PHP  site 

I have not blogged in a while due to personal circumstances, like having started on a new job which keeps intensifying, but also because I was unsatisfied with the way my sites handle templating.

Let me explain, I have a shared webhosting account and run multiple domains and subdomains. Some (actually most) of them require the same theme but have different theming mechanisms.

What I needed was a cross-(sub)domain branding solution!

Having looked around on the internet and coming to the conclusion there are none out of the box, I decided to build one myself. Now, a month later (don’t have much spare time and more hobbies and interests ;) ) I can say, I am almost done!

This blog is now officially running on Crossbrand. I will release it to the community once I have ironed out the last glitches and finished documentation.

Check back regularly if you are interested!

No Comments »

A new design!

Feb 05
Posted on February 5th, 2009 In category Development  Maintenance  Personal 
By mvriel Tagged as blog  domain  naenius  redesign  website 

It was long overdue but I have finally managed to finish the new design for the Naenius.com website. My intention is to use this design in all subparts of this website, as well as the new parts I am concocting in my brain.

With the implementation I did notice a few artifacts. For one, I did not implement a comments form. Actually I already knew about this but I was fed up with the old design and thus I decided to launch ‘prematurely’. Aside from the above I noticed that the sidebar could use some additional styling. All bullets went missing in the design and this is not really my intent (specifically with the categories widget).

Aside from the things I mentioned above it has been a good launch! Now it is time to test this bird in Internet Explorer and hope all goes well ;)

If you would like to comment on this design, either wait until I have added the comments form or send me an e-mail!

No Comments »

Installing Lotus Notes 8.5 on Kubuntu / Debian Linux KDE

Feb 04
Posted on February 4th, 2009 In category Linux  Lost in space 
By mvriel Tagged as IBM  KDE  Kubuntu  Linux  Lotus Notes  Open Beta  Ubuntu 

I have recently switched from employer in search of new opportunities, a new challenge and more tech-savy colleagues. After just 2 days I can say that I have found at least the latter two. Although I never expected to find a challenge in the mail system used, namely IBM Lotus Notes.

After leaving my previous employer I had hoped to leave my windows days behind for I was bound to the demonic Windows due to proprietary applications. I have adopted Kubuntu as my new Ambrosium.

Yet the funniest thing happened, I have to use Lotus Notus. Another windows only application by IBM.

As you can imagine I was mortally terrified when I learned no Linux client was there and no IMAP connection could be made (I have been told it is next to impossible with Notes). But then I found the IBM Lotus Notes 8.5 Open Beta 2 for Linux client (IBM Id needed but can be created for free during the process). This 460mb download is almost all that is needed to get it working.

Here are the steps that I have done to install Notes,

  1. Download the application from the link given in the previous paragraph, choose the Debian package
  2. Untar the downloaded file tar -xvvf <filename><
  3. Install the notes debian package as rootsudo dpkg -i ibm_lotus_notes-8.5.i586.deb
  4. In order to run the application it needs several Gnome packages. If you try to run the application but it won’t start, then you are missing some. To find out which, start the application from Konsole and it will display what it misses. The binary can be found in /opt/ibm/notes. I missed the libgnomeprint2.2-0 and libgnomeprintui2.2-0 packages
  5. The installation has now created a folder lotus in your home folder as the user root. Since we will be starting the Lotus application with our own user we need to give it back from root to ourselves. Thus you execute chown -R <youruser>:<youruser> /home/<youruser>/lotus
  6. Run it and configure it just like you would do with the windows version

After figuring out the steps above I was seriously relieved that I could stop reading my mail over a Remote Desktop connection and enjoy all that Kubuntu has to give to me.

Enjoy!

7 Comments »

An introduction to Scrum

Jan 14
Posted on January 14th, 2009 In category Agile 
By mvriel Tagged as Agile  Ken Schwaber  QA  Scrum 

Whilst attempting to enrich my knowledge about Agile methodologies and Scrum in specific I found the site Learning Scrum. This site turned out to be a jewel and it contained a video of a Google Tech Talk by one of the Godfathers of Scrum, Ken Schwaber. In this talk he explains the history and purpose of scrum as well as what usually happens when developers get into time shortage. On of my favourite quotes from the video is:

By cutting quality we can produce more crap.

How true…

Below is the embedded video as first seen through http://learningscrum.com/20080315/scrum-et-al-video/

If you like to know more, view this video. It is one well spend hour of your life!

No Comments »

Validating an e-mail address according to RFC 2822

Jan 11
Posted on January 11th, 2009 In category Code 
By mvriel Tagged as 2822  e-mail  parsing  regex  regexp  rfc 

E-mail addresses are bitches! There, now that is said I can tell why.

Should you ever have time on your hands you should read RFC 2822, it provides an interesting (though somewhat dull) background into e-mail messaging. Alas one can also see why it is so hard to validate an e-mail address, it is an extremely flexible format which is quite hard to check.

(more…)

No Comments »

Generating passwords in PHP

Jan 09
Posted on January 9th, 2009 In category Code 
By mvriel Tagged as No tags assigned

There are those things you encounter again and again and again. Generating passwords is one of those. My experience is that whenever an application needs to be created which deals with user account creation, it is best to let my application create a password for the user.

Why? Simply, I am lazy.

Good developers and users alike are and should be thus lazy that they should not want to think of a new password. All they need is to just generate one with a click and jot it down somewhere! I have now encountered three or four separate applications which dealt with user creation and every time I have turned to Google and find a method for generating passwords which I subsequently adapt for my own specific application.

To help myself and perhaps you (who probably came from the Google website as well) I have posted (one of) my password generating method(s). The code which I have used here is originally from someone else but I forgot to mention this in my source file. If you recognize this code as your own please comment it so I can give recognition where due. Thought I must comment that I have changed it quite a bit..

/**
 * This method generates a random character value between the 33(!) and 126(~)
 * @return int
 */
function getRandomNum()
{
    $rndNum = rand(0,100) *10; // between 0 - 1000
    $rndNum = ($rndNum % 94) + 33; // rndNum from 33 - 127
    return $rndNum;
}
 
/**
 * Check if a character value is a special / punctuation character, if so returns true
 * @param int $num
 * @return boolean
 */
function checkPunc($num)
{
    if ((($num &gt;=33) &amp;&amp; ($num &lt;=47))
    || (($num &gt;=58) &amp;&amp; ($num &lt;=64))
    || (($num &gt;=91) &amp;&amp; ($num &lt;=96))
    || (($num &gt;=123) &amp;&amp; ($num &lt;=126))) {
        return true;
    }
    return false;
}
 
/**
 * Generates a new password, if the length parameter equals false then
 * a random length is chosen between 5 and 15 characters long.
 * @param int|boolean $length
 * @param boolean $noPunctuation
 * @return string
 */
function generatePassword($length = 8, $noPunctuation = true)
{
    $password = '';
    if ($length === false) {
        $length = rand(5,15);
    }
    for ($i=0; $i &lt; $length; $i++) {
        $numI = getRandomNum();
        while ($noPunctuation &amp;&amp; checkPunc($numI)) {
            $numI = getRandomNum();
        }
        $password .= chr($numI);
    }
    return $password;
}

Update 11-01-2009: As it seems I had to implement a password generator in javascript today. So I Googled one and found it on http://psacake.com/web/ei.asp. This version funnily looks the same as the PHP version posted above, perhaps they share the same roots? Anyhow, here it is:

function generatePassword(length, punction, randomLength)
{
    if (parseInt(navigator.appVersion) < = 3) {
        alert("Sorry this only works in 4.0 browsers");
        return true;
    }
 
    if (!length) length = 8;
    var password = "";
 
    if (randomLength) {
        length = Math.random();
        length = parseInt(length * 100);
        length = (length % 7) + 6
    }
 
    for (i=0; i < length; i++) {
        numI = getRandomNum();
        if (!punction) {
            while (checkPunc(numI)) {
                numI = getRandomNum();
            }
        }
        password = password + String.fromCharCode(numI);
    }
    return password;
}
 
function getRandomNum()
{
    // rndNum from 0 - 1000
    rndNum = parseInt(Math.random() * 1000);
    // rndNum from 33 - 127
    rndNum = (rndNum % 94) + 33;
    return rndNum;
}
 
function checkPunc(num)
{
    if (((num >=33) && (num < = 47))
    || ((num >=58)  && (num < = 64))
    || ((num >=91)  && (num < = 96))
    || ((num >=123) && (num < = 126))) {
        return true;
    }
    return false;
}

No Comments »

« Previous Page — Next Page »
| Log in | Icons are part of the Crystal Project and copyright of Everaldo Coelho
Mike van Riel is a Senior Software Developer at Unet BV, an ISP for the corporate segment based in the Netherlands.

With a passion for industry standards and Quality Assurance he loves nothing more than to discuss methods to improve code and ways to 'Do-It-Better'™ in general.

You can contact him by:
mike.vanriel[at]naenius.com
@mvriel
http://www.linkedin.com/in/mvriel
mike.vanriel[at]naenius.com
mike.vanriel[at]naenius.com
mike.vanriel