<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>Veikko Mäkinen</title><generator>Tumblr (3.0; @v-dogg)</generator><link>http://blog.veikko.fi/</link><item><title>A Great Article Series on Agavi</title><description>&lt;p&gt;Vikram Vaswani has written a great article series on Agavi. The five-part series starts off with the basic but in the end goes quite deep into building a multi presentational layer web application. Go read it on the IBM developerWorks! Now!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.ibm.com/developerworks/library/x-agavipt1/"&gt;Part 1: Open a whole new world with Agavi&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.ibm.com/developerworks/library/x-agavipt2/"&gt;Part 2: Add forms and database support with Agavi and Doctrine&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.ibm.com/developerworks/library/x-agavipt3/"&gt;Part 3: Add authentication and administrative functions with Agavi&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.ibm.com/developerworks/library/x-agavipt4/"&gt;Part 4: Create an Agavi search engine with multiple output types including XML, RSS, or SOAP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.ibm.com/developerworks/library/x-agavipt5/"&gt;Part 5: Add paging, file uploads, and custom input validators to your Agavi application&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><link>http://blog.veikko.fi/post/189176770</link><guid>http://blog.veikko.fi/post/189176770</guid><pubDate>Wed, 16 Sep 2009 09:58:52 +0300</pubDate><category>agavi</category><category>tips</category></item><item><title>Propel Developers' Held a Meeting</title><description>&lt;p&gt;Propel developers held an IRC meeting last night discussing the projects future. Amazingly many showed up and the discussion was active and fruitful.&lt;/p&gt;

&lt;p&gt;Read &lt;a href="http://propel.phpdb.org/trac/wiki/Users/News/MinutesSept10Meeting"&gt;the log at Propel Wiki&lt;/a&gt;.&lt;/p&gt;</description><link>http://blog.veikko.fi/post/185115463</link><guid>http://blog.veikko.fi/post/185115463</guid><pubDate>Fri, 11 Sep 2009 09:10:06 +0300</pubDate></item><item><title>Say It!</title><description>&lt;h1&gt;Disqus Comments&lt;/h1&gt;

&lt;p&gt;Integrating &lt;a href="http://disqus.com"&gt;Disqus&lt;/a&gt; commenting system to my Tumblr blog was ridiculously easy. Just have to figure out why the comment form completely breaks my design :)&lt;/p&gt;</description><link>http://blog.veikko.fi/post/83505298</link><guid>http://blog.veikko.fi/post/83505298</guid><pubDate>Wed, 04 Mar 2009 19:07:30 +0200</pubDate><category>nonsense</category></item><item><title>Be Careful with PHP's version_compare</title><description>&lt;h1&gt;Be Careful with PHP’s version_compare&lt;/h1&gt;

&lt;pre class="sh_php"&gt;
var_dump(version_compare("5.2.8-0.dotdeb.1", "5.2.8", "&lt;="));
&lt;/pre&gt;

&lt;p&gt;Expected result: &lt;span style="color: blue"&gt;&lt;code&gt;bool(true)&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Actual result: &lt;span style="color: blue"&gt;&lt;code&gt;bool(false)&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;The moral of the story: use &lt;span style="color: blue"&gt;&lt;code&gt;&lt;&lt;/code&gt;&lt;/span&gt; or &lt;span style="color: blue"&gt;&lt;code&gt;&gt;&lt;/code&gt;&lt;/span&gt;.&lt;/p&gt;</description><link>http://blog.veikko.fi/post/83110343</link><guid>http://blog.veikko.fi/post/83110343</guid><pubDate>Tue, 03 Mar 2009 13:33:48 +0200</pubDate><category>tips</category><category>php</category></item><item><title>Installing a Project-local Propel</title><description>&lt;h1&gt;Installing a Project-local Propel&lt;/h1&gt;

&lt;p&gt;Installing &lt;a href="http://propel.phpdb.org/trac/"&gt;Propel&lt;/a&gt; is often seen as a difficult task. Official installion instructions recommend installing via Pear and say more initial work is requireq to install it manually. I usually advice not to use global Pear installations but install everything per project because it gives you better control and you are able to use different versions of libraries for different project. This article shows you how easy it actually is to have a project-local installation of Propel 1.3.&lt;/p&gt;

&lt;h2&gt;Prerequisites&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://phing.info/trac/"&gt;Phing&lt;/a&gt; 2.2.x (and, thus, Pear)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Phing is the only exception to my “no pear installations” rule. It can be installed per project but I see Phing as a development tool you can have globally on your development machine.&lt;/p&gt;

&lt;h2&gt;Suggested Directory Layout&lt;/h2&gt;

&lt;pre&gt;
/            project root
  dev/       development-time files (docs, database schemas, code templates etc.)
    db/      database development files (schema.xml, diagrams, docs etc.)
    libs/    development-time libraries
  libs/      runtime libraries (3rd party)
&lt;/pre&gt;

&lt;h2&gt;Getting Propel from the SVN&lt;/h2&gt;

&lt;p&gt;I recommend fetching Propel directly from the SVN repository simply because I see that as the easiest choice and you have full control of which version to pick. Also, should you ever want to upgrade to a newer revision (maybe there is a bugfix that isn’t officially released yet), you can just retrieve it from the repository. Personally I have 3rd party libraries set up as svn:external where possible but we don’t go into that in this article.&lt;/p&gt;

&lt;p&gt;Propel is split into two components - generator and runtime libraries and we’ll keep those two appart. So, in your project root execute following SVN commands:&lt;/p&gt;

&lt;pre&gt;
svn export &lt;a href="http://svn.phpdb.org/propel/branches/1.3/generator"&gt;http://svn.phpdb.org/propel/branches/1.3/generator&lt;/a&gt; dev/libs/propel

svn export &lt;a href="http://svn.phpdb.org/propel/branches/1.3/runtime/classes/propel"&gt;http://svn.phpdb.org/propel/branches/1.3/runtime/classes/propel&lt;/a&gt; libs/propel
&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;And that is it.&lt;/strong&gt; YES, I mean it!&lt;/p&gt;

&lt;p&gt;Propel is now ready to be used. You don’t need to set &lt;code&gt;PATH&lt;/code&gt; or &lt;code&gt;include_path&lt;/code&gt;, you don’t need to copy executables anywhere and you don’t have to modify a single file.&lt;/p&gt;

&lt;h2&gt;Building a Propel Project&lt;/h2&gt;

&lt;p&gt;Create your &lt;code&gt;schema.xml&lt;/code&gt;, &lt;code&gt;runtime-conf.xml&lt;/code&gt; and &lt;code&gt;build.properties&lt;/code&gt; files in &lt;code&gt;dev/db&lt;/code&gt;. To build your project go to your project root and run&lt;/p&gt;

&lt;pre&gt;
dev/libs/propel/bin/propel-gen dev/db
&lt;/pre&gt;

&lt;p&gt;… and whatch Propel do its magic. Propel creates output files into ´dev/db/build/´&lt;/p&gt;

&lt;h2&gt;Fine-tuning The Building Process&lt;/h2&gt;

&lt;p&gt;You can control where Propel puts the output with a few &lt;code&gt;build.properties&lt;/code&gt; directives. Here’s an example that probably needs no explanation.&lt;/p&gt;

&lt;pre&gt;
#relative to propel-gen script
propel.output.dir = ../../..
propel.php.dir = ${propel.output.dir}/app/lib/propel
propel.phpconf.dir = ${propel.output.dir}/dev/db/config
propel.sql.dir = ${propel.output.dir}/dev/db/sql
&lt;/pre&gt;

&lt;h2&gt;What About Runtime?&lt;/h2&gt;

&lt;p&gt;Yeah, you got me there - there’s still one thing you need to take care of before everything “just works”.&lt;/p&gt;

&lt;pre class="sh_php"&gt;
//propel runtime + path to your om classes
$path = '/my/project/libs' . PATH_SEPARATOR . '/my/project/app/lib/propel';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
&lt;/pre&gt;</description><link>http://blog.veikko.fi/post/82466126</link><guid>http://blog.veikko.fi/post/82466126</guid><pubDate>Sun, 01 Mar 2009 10:11:00 +0200</pubDate><category>tips</category><category>propel</category></item><item><title>Agavi 1.0.0 Beta 8 Includes a Critical Security Fix</title><description>&lt;h1&gt;Agavi 1.0.0 Beta 8 Includes a Critical Security Fix&lt;/h1&gt;

&lt;p&gt;A new &lt;a href="http://agavi.org"&gt;Agavi&lt;/a&gt; 1.0.0 Beta 8 was released late yesterday (European time). As usual, the new version contains several improvements and bug fixes but &lt;strong&gt;also a fix to a critical cross-site scripting vulnerability&lt;/strong&gt; described in &lt;a href="http://trac.agavi.org/ticket/1019"&gt;&lt;a href="http://trac.agavi.org/ticket/1019"&gt;http://trac.agavi.org/ticket/1019&lt;/a&gt;&lt;/a&gt;. The vulnerability actually affects, as far as we know, only Internet Explorer 6 and 7 which fail to encode URL according to standards.&lt;/p&gt;

&lt;h2&gt;Affected versions:&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Agavi 0.11 up to and including 0.11.6-RC2&lt;/li&gt;
&lt;li&gt;Agavi 1.0 up to and including 1.0.0-beta7&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Solutions&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Upgrade to 0.11.6 or 1.0.0 Beta 8&lt;/li&gt;
&lt;li&gt;Patch your Agavi with a hot fix attached to the &lt;a href="http://trac.agavi.org/ticket/1019"&gt;ticket&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Use one of the workarounds described in the ticket.&lt;/li&gt;
&lt;/ul&gt;</description><link>http://blog.veikko.fi/post/75810346</link><guid>http://blog.veikko.fi/post/75810346</guid><pubDate>Thu, 05 Feb 2009 09:28:00 +0200</pubDate><category>agavi</category><category>security</category></item><item><title>Agavi Tip: Automatic Output of Validation Errors</title><description>&lt;h1&gt;Agavi Tip: Automatic Output of Validation Errors&lt;/h1&gt;

&lt;p&gt;I decided today to stop printing my validation error messages manually in the template. I knew that Form Population Filter (one of Agavi’s many excellent features also referred to as &lt;em&gt;FPF&lt;/em&gt;) could be used to inject error messages into the HTML form next to erroneous fields but I want my error messages above the form. Once again &lt;a href="http://blog.wombert.de"&gt;David&lt;/a&gt; was there to help me and with a few iterations of trial and error he offered a working solution for me. And the solution was so simple and nice that I just had to blog it.&lt;/p&gt;

&lt;h2&gt;Filter Configuration&lt;/h2&gt;

&lt;p&gt;global_filters.xml&lt;/p&gt;

&lt;pre class="sh_xml"&gt;

&lt;filter name="FormPopulationFilter" class="AgaviFormPopulationFilter"&gt;

  &lt;ae:parameter name="methods"&gt;
    &lt;ae:parameter&gt;write&lt;/ae:parameter&gt;
  &lt;/ae:parameter&gt;
  
  &lt;ae:parameter name="output_types"&gt;
    &lt;ae:parameter&gt;html&lt;/ae:parameter&gt;
  &lt;/ae:parameter&gt;

  &lt;ae:parameter name="error_messages"&gt;
    &lt;ae:parameter name="self::${htmlnsPrefix}form"&gt;
    &lt;ae:parameter name="location"&gt;before&lt;/ae:parameter&gt;
    &lt;ae:parameter name="container"&gt;&lt;![CDATA[&lt;div class="errors"&gt;${errorMessages}&lt;/div&gt;]]&gt;&lt;/ae:parameter&gt;
    &lt;ae:parameter name="markup"&gt;&lt;![CDATA[&lt;p class="error"&gt;${errorMessage}&lt;/p&gt;]]&gt;&lt;/ae:parameter&gt;
    &lt;/ae:parameter&gt;
  &lt;/ae:parameter&gt;
  
&lt;/filter&gt;

&lt;/pre&gt;

&lt;p&gt;And that’s it. FPF injects all error messages above your form. Each error message in its own paragraph and all paragraphs wrapped inside a &lt;div&gt;&lt;/p&gt;

&lt;h2&gt;Want More?&lt;/h2&gt;

&lt;p&gt;FPF can have different rules for different kinds of errors and with XPath you can inject them pretty much anywhere you want. See the Agavi’s sample application for &lt;a href="http://trac.agavi.org/browser/branches/1.0/samples/app/config/global_filters.xml"&gt;more examples&lt;/a&gt;.&lt;/p&gt;</description><link>http://blog.veikko.fi/post/75101068</link><guid>http://blog.veikko.fi/post/75101068</guid><pubDate>Mon, 02 Feb 2009 21:13:48 +0200</pubDate><category>agavi</category><category>tips</category></item><item><title>Running IE6, IE7 and IE8 Virtually</title><description>&lt;h1&gt;Running IE6, IE7 and IE8 Virtually&lt;/h1&gt;

&lt;p&gt;Now, this is not easy for me to admit but I just learned about an awesome Windows application by Microsoft.. from a &lt;a href="http://blog.wombert.de/post/72614373/running-ie6-ie7-and-ie8-on-your-mac"&gt;mac user&lt;/a&gt;  :)&lt;/p&gt;

&lt;h2&gt;Microsoft Virtual PC 2007 SP1 &amp; Internet Explorer VPC Images&lt;/h2&gt;

&lt;p&gt;I cannot believe this has been under my radar all this time. Finally I can &lt;strong&gt;easily&lt;/strong&gt; have different windows/IE setups. The software is free (yes, I found it hard to believe too but it’s true!) and Microsoft gives you ready-to-use virtual hard-drive images with operating system and IE ready.&lt;/p&gt;

&lt;p&gt;It has been a long time since I last praised Microsoft for doing something right. And now I’m getting suspicious… what’s the catch here?!&lt;/p&gt;

&lt;h2&gt;Installation&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://www.microsoft.com/Downloads/details.aspx?FamilyID=21eabb90-958f-4b64-b5f1-73d0a413c8ef&amp;displaylang=en"&gt;Download&lt;/a&gt; Virtual PC 2007 setup.exe, execute it and enjoy the no-reboot-required installation (yet another amazing thing).&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=28C97D22-6EB8-4A09-A7F7-F6C7A1F000B5&amp;displaylang=en"&gt;Download&lt;/a&gt; one or more hard-drive images, execute and select a directory where you want the image to be extracted.&lt;/li&gt;
&lt;li&gt;Start Virtual PC 2007 and create a new virtual machine. Use the extracted hard-drive image.&lt;/li&gt;
&lt;li&gt;Boot up the virtual machine and enjoy the IE experience&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;P.S. Like the &lt;a href="http://blog.mozmonkey.com/2008/vpc-ie6-ie7-ie8-on-mac-os-x/"&gt;original post&lt;/a&gt; describes you can use virtual images provided by MS with other operating systems / virtual machine hosts too.&lt;/p&gt;</description><link>http://blog.veikko.fi/post/73204624</link><guid>http://blog.veikko.fi/post/73204624</guid><pubDate>Mon, 26 Jan 2009 13:34:00 +0200</pubDate><category>tips</category><category>web development</category></item><item><title>Agavi 1.0.0 beta 7 released!</title><description>&lt;h1&gt;Agavi 1.0.0 Beta 7&lt;/h1&gt;

&lt;p&gt;Out of many changes there are two (or actually three) I want to emphasise because they may be backwards compatibility breaks for someone.&lt;/p&gt;

&lt;h2&gt;Default View Security Fixes&lt;/h2&gt;

&lt;p&gt;Two separate changes have been made to action’s default view handling to ensure strict security.&lt;/p&gt;

&lt;p&gt;To make sure a developer doesn’t use unvalidated input data by mistake global unvalidated request data is locked during action and view execution. However, before 1.0.0 beta 7 it was possible to access the global request data in &lt;code&gt;Action::getDefaultViewName()&lt;/code&gt;. This has now been fixed and anyone using the global request will be punished severely with an exception. Mind you, it has always been recommended that no application logic is put into &lt;code&gt;getDefaultView()&lt;/code&gt;. It should just return the default view name for the action.&lt;/p&gt;

&lt;p&gt;It was also recently discovered that the strict validation mode (default mode in Agavi 1.0) wasn’t working as it is supposed to when an action didn’t provide an execute method for the current request and the default view was used. In this case the request data was given to the view unfiltered which is against the strict validation mode principles.&lt;/p&gt;

&lt;h2&gt;PHP 5.2.8 Requirement (conditional)&lt;/h2&gt;

&lt;p&gt;Due to issues with magic quotes in PHP’s earlier versions and the fact that making Agavi bullet proof in all situations is beginning to be a maintenance nightmare it was decided to require PHP 5.2.8 if magic_quotes_gpc is ON. I’ll repeat: &lt;strong&gt;Agavi requires PHP 5.2.8 ONLY if magic_quotes_gpc is enabled on your server.&lt;/strong&gt; If it’s not you can still use Agavi with PHP 5.2.0 or later (5.1.3 with Agavi 0.11).&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://blog.agavi.org/post/69709059/agavi-1-0-0-beta-7-released"&gt;Agavi Blog&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://trac.agavi.org/browser/tags/1.0.0beta7/RELEASE_NOTES"&gt;1.0.0 Beta 7 Release Notes&lt;/a&gt;
&lt;/p&gt;</description><link>http://blog.veikko.fi/post/69754879</link><guid>http://blog.veikko.fi/post/69754879</guid><pubDate>Sun, 11 Jan 2009 15:41:15 +0200</pubDate><category>agavi</category></item><item><title>Agavi Tip: Validation Gotchas</title><description>&lt;h1&gt;Agavi Validation Gotchas&lt;/h1&gt;

&lt;p&gt;Agavi’s input validation system is extremely versatile and even people with long history with Agavi - me for example - sometimes struggle to get their head around it.
So I decided to put down a few gotchas. Here goes…&lt;/p&gt;

&lt;h2&gt;Validators Can Be Grouped&lt;/h2&gt;

&lt;p&gt;You can use AgaviAndValidator, AgaviOrValidator and AgaviXorValidator to group several validators.&lt;/p&gt;

&lt;pre class="sh_xml"&gt;

&lt;validator class="or"&gt;
  &lt;validators&gt;
    &lt;validator class="email" required="false" &gt;
      &lt;arguments&gt;
        &lt;argument&gt;email&lt;/argument&gt;
      &lt;/arguments&gt;
    &lt;/validator&gt;
    &lt;validator class="MyPhoneNumberValidator" required="false" &gt;
      &lt;arguments&gt;
        &lt;argument&gt;phone&lt;/argument&gt;
      &lt;/arguments&gt;
    &lt;/validator&gt;
  &lt;/validators&gt;
  &lt;errors&gt;
    &lt;error&gt;Please provide email or phone&lt;/error&gt;
  &lt;/errors&gt;
&lt;/validator&gt;

&lt;/pre&gt;

&lt;h2&gt;Validator Can Depend on Another Validator&lt;/h2&gt;

&lt;p&gt;Quite often you only want validate input B only if the user provided input A. Agavi makes this simple:&lt;/p&gt;

&lt;pre class="sh_xml"&gt;

&lt;validator ... required="false" provides="street_set"&gt;
  &lt;arguments base="contact"&gt;
    &lt;argument&gt;Street&lt;/argument&gt;
  &lt;/arguments&gt;
&lt;/validator&gt;

&lt;validator ... required="true" depends="contact[street_set]"&gt;
  &lt;arguments base="contact"&gt;
    &lt;argument&gt;Zip&lt;/argument&gt;
  &lt;/arguments&gt;
&lt;/validator&gt;

&lt;/pre&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; argument’s &lt;code&gt;base&lt;/code&gt; attribute affects also provides/depends attributes (see example above) &lt;strong&gt;!!&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;Pimp My Error Messages&lt;/h2&gt;

&lt;p&gt;A validator can throw different error message based on what went wrong and &lt;strong&gt;error messages can be translated on the fly&lt;/strong&gt;. Error message options vary between validators. See API docs for more.&lt;/p&gt;

&lt;pre class="sh_xml"&gt;

&lt;validator class="string" translation_domain="default.errors"&gt;
  &lt;arguments&gt;
    &lt;argument&gt;my_input&lt;/argument&gt;
  &lt;/arguments&gt;
  &lt;errors&gt;
    &lt;error for="required"&gt;Please fill this input&lt;/error&gt;
    &lt;error for="max"&gt;Please keep it shorter than 40 characters&lt;/error&gt;
  &lt;/errors&gt;
  &lt;ae:parameters&gt;
    &lt;ae:parameter name="max"&gt;40&lt;/ae:parameter&gt;
  &lt;/ae:parameters&gt;
&lt;/validator&gt;

&lt;/pre&gt;

&lt;h2&gt;Validating Array Inputs&lt;/h2&gt;

&lt;h3&gt;&lt;input name=”rows[Id]”&lt;/h3&gt;

&lt;pre class="sh_xml"&gt;

&lt;arguments base="rows"&gt;
    &lt;argument&gt;Id&lt;/argument&gt;
&lt;/arguments&gt;

&lt;!-- or --&gt;

&lt;arguments&gt;
    &lt;argument&gt;rows[Id]&lt;/argument&gt;
&lt;/arguments&gt;

&lt;/pre&gt;

&lt;h3&gt;&lt;input name=”rows[1][Id]”&lt;/h3&gt;

&lt;pre class="sh_xml"&gt;

&lt;arguments base="rows[]"&gt;
    &lt;argument&gt;Id&lt;/argument&gt;
&lt;/arguments&gt;

&lt;/pre&gt;

&lt;h3&gt;&lt;input name=”rows[]”&lt;/h3&gt;

&lt;pre class="sh_xml"&gt;

&lt;arguments base="rows[]"&gt;
    &lt;argument/&gt;
&lt;/argument&gt;

&lt;/pre&gt;

&lt;h2&gt;Validator Can Normalize And Export Combined Values&lt;/h2&gt;

&lt;p&gt;This example shows how to get AgaviDateValidator to validate a compound value. But that’s not all! It’ll even export a proper timestamp for you to use in your application code.&lt;/p&gt;

&lt;pre class="sh_xml"&gt;

&lt;validator class="AgaviDateTimeValidator"&gt;
    &lt;arguments&gt;
        &lt;argument name="AgaviDateDefinitions::DATE"&gt;day&lt;/argument&gt;
        &lt;argument name="AgaviDateDefinitions::MONTH"&gt;month&lt;/argument&gt;
        &lt;argument name="AgaviDateDefinitions::YEAR"&gt;year&lt;/argument&gt;
    &lt;/arguments&gt;
    &lt;errors&gt;
        &lt;error&gt;Validation error&lt;/error&gt;
    &lt;/errors&gt;
    &lt;ae:parameters&gt;
        &lt;ae:parameter name="export"&gt;MyDatestamp&lt;/ae:parameter&gt;
    &lt;/ae:parameters&gt;
&lt;/validator&gt;

&lt;/pre&gt;

&lt;h2&gt;Remember to Validate ALL Input&lt;/h2&gt;

&lt;p&gt;Validation is not limited to GET/POST input parameters but HTTP headers and cookies can (&lt;strong&gt;and should&lt;/strong&gt;) be validated too. Use the source attribute to tell the validator where to get the data from.&lt;/p&gt;

&lt;pre class="sh_xml"&gt;

&lt;validator ... source="headers"&gt; &lt;argument&gt;REFERER&lt;/argument&gt;

&lt;/pre&gt;

&lt;h2&gt;Validator is ran only if the parameter is non-empty.&lt;/h2&gt;

&lt;p&gt;By default the validator base class AgaviValidator checks that all the arguments are set before executing the actual validation. If the input value is empty or non-existent but required error is thrown. But if required attribute is set to False the validation just quietly continues to another validator. Normally this is not a problem but you might want to code a custom validator that exports a default value for empty parameters. In this case you need to override AgaviValidator’s &lt;code&gt;checkAllArgumentsSet()&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Did I forget something?&lt;/h2&gt;

&lt;p&gt;Join #agavi IRC channel and hassle me there or send email to &lt;a href="mailto:veikko@veikko.fi"&gt;veikko@veikko.fi&lt;/a&gt;.&lt;/p&gt;</description><link>http://blog.veikko.fi/post/68983308</link><guid>http://blog.veikko.fi/post/68983308</guid><pubDate>Wed, 07 Jan 2009 21:18:00 +0200</pubDate><category>agavi</category><category>tips</category></item><item><title>Agavi Tip: Checking Validation Results</title><description>&lt;h1&gt;Agavi Tip: Checking Validation Results&lt;/h1&gt;

&lt;p&gt;Normally when an input validator fails you’ll just want to show the form again and let FormPopulationFilter do its magic (you do know you can it have re-populate the form &lt;strong&gt;and&lt;/strong&gt; inject error messages into the form, don’t you?-). But occasionally you want to decide the next move based on what validator failed. With Agavi 1.0 getting validation incidents of a named validator is this simple:&lt;/p&gt;

&lt;pre class="sh_php"&gt;
public function handleError(AgaviRequestDataHolder $rd)
{
  $vm = $this-&gt;container-&gt;getValidationManager();
  if (count($vm-&gt;getReport()-&gt;getValidatorResult('my_special_validator')-&gt;getIncidents())) {
    return 'CriticalError';
  }
  else {
    return 'Error';
  }
  
}
&lt;/pre&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; that AgaviValidationValidatorResult was missing from the core autoload.xml in 1.0 Beta 6. This has been fixed in the SVN If you aren’t using the bleeding edge version add the following line to your &lt;code&gt;config/autoload.xml&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;pre class="sh_xml"&gt;
&lt;autoload name="AgaviValidationValidatorResult"&gt;%core.agavi_dir%/validator/AgaviValidationValidatorResult.class.php&lt;/autoload&gt; 
&lt;/pre&gt;</description><link>http://blog.veikko.fi/post/68773061</link><guid>http://blog.veikko.fi/post/68773061</guid><pubDate>Tue, 06 Jan 2009 23:25:00 +0200</pubDate><category>agavi</category><category>tips</category></item><item><title>Agavi Debug Tools now supports Propel query logging (both...</title><description>&lt;img src="http://29.media.tumblr.com/8wIjDX8qOid572mwDzIv0tZro1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Agavi Debug Tools now supports &lt;a href="http://propel.phpdb.org"&gt;Propel&lt;/a&gt; query logging (both FirePHP and HTML output). Just configure Propel to use DebugPDO and AdtFilter to use AdtPropelDataSource. Nothing else required.&lt;/p&gt;</description><link>http://blog.veikko.fi/post/68560026</link><guid>http://blog.veikko.fi/post/68560026</guid><pubDate>Mon, 05 Jan 2009 22:41:09 +0200</pubDate><category>agavi</category><category>tips</category><category>php</category></item><item><title>Agavi 1.0.0 Beta 6</title><description>&lt;h1&gt;Agavi 1.0.0 Beta 6 - Even More Secure&lt;/h1&gt;

&lt;h2&gt;Default: Strict Validation ALWAYS&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://www.agavi.org"&gt;Agavi&lt;/a&gt; has a very special input validation system which, by default, will not let your application use any unvalidated input data. And this doesn’t mean only POST or GET parameters in HTTP world but also &lt;strong&gt;cookies&lt;/strong&gt; and &lt;strong&gt;headers&lt;/strong&gt;. Remember, those too are user input and must be considered insecure.&lt;/p&gt;

&lt;p&gt;This strict validation mode has been the default setting for production environment for quite some time already but after Agavi was &lt;a href="http://blog.agavi.org/post/58189391/false-agavi-vulnerability-reports"&gt;blamed&lt;/a&gt; for somebody’s poor input validation it was made default for development environments too. It had already been discussed earlier because different defaults for different environments was sometimes confusing and caused applications to break when moved to production.&lt;/p&gt;

&lt;h2&gt;Production-ready Exception Templates&lt;/h2&gt;

&lt;p&gt;Because people seem to be too &lt;a href="http://www.google.fi/search?q=agavi+exception"&gt;lazy&lt;/a&gt; to configure exception templates for production use a new set of default templates was added to Agavi 1.0.0 Beta 6.&lt;/p&gt;

&lt;p&gt;Download Agavi: &lt;a href="http://www.agavi.org/download"&gt;http://www.agavi.org/download&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.veikko.fi/post/59493548</link><guid>http://blog.veikko.fi/post/59493548</guid><pubDate>Tue, 25 Nov 2008 21:55:00 +0200</pubDate><category>agavi</category><category>php</category><category>security</category></item><item><title>Thanks to Harald “digitarald” Kirschner ADT’s...</title><description>&lt;img src="http://25.media.tumblr.com/8wIjDX8qOgfsk949WGf9HuVNo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Thanks to &lt;a href="http://digitarald.de"&gt;Harald “digitarald” Kirschner&lt;/a&gt; ADT’s FirePHP output is now 174% nicer. And a few bugs was fixed too. Check out ADT at &lt;a href="http://adt.projectbin.org/."&gt;http://adt.projectbin.org/.&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.veikko.fi/post/60254039</link><guid>http://blog.veikko.fi/post/60254039</guid><pubDate>Tue, 18 Nov 2008 09:51:00 +0200</pubDate><category>agavi</category><category>php</category></item><item><title>Kübler-Ross Model</title><description>&lt;h1&gt;Five Steps to Agile Development&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Denial&lt;/li&gt;
&lt;li&gt;Anger&lt;/li&gt;
&lt;li&gt;Bargaining&lt;/li&gt;
&lt;li&gt;Depression&lt;/li&gt;
&lt;li&gt;Acceptance&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Elisabeth Kübler-Ross’ &lt;a href="http://en.wikipedia.org/wiki/Kubler-Ross_model"&gt;Five Stages of Grief&lt;/a&gt; describes how people handle grief and tragedy, especially when diagnosed with a terminal illness. &lt;a href="http://agileproductdesign.com/blog/emerging_best_agile_ux_practice.html"&gt;Apparently&lt;/a&gt; these also apply to agile development and user experience practice &lt;code&gt;:D&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Originally blogged/linked by &lt;a href="http://agileweb.org/"&gt;&lt;a href="http://agileweb.org/"&gt;http://agileweb.org/&lt;/a&gt;&lt;/a&gt;.&lt;/p&gt;</description><link>http://blog.veikko.fi/post/60147695</link><guid>http://blog.veikko.fi/post/60147695</guid><pubDate>Mon, 17 Nov 2008 20:01:00 +0200</pubDate></item><item><title>Happy Birthday to Me</title><description>&lt;p&gt;28 (0x1c) years today.&lt;/p&gt;</description><link>http://blog.veikko.fi/post/60051940</link><guid>http://blog.veikko.fi/post/60051940</guid><pubDate>Mon, 17 Nov 2008 06:23:08 +0200</pubDate><category>personal</category><category>nonsense</category></item><item><title>How to Enable Syntax Highlighting in Tumblr</title><description>&lt;h1&gt;How to Enable Syntax Highlighting in Tumblr&lt;/h1&gt;

&lt;p&gt;It’s alwasy nicer to read code snippets with a proper syntax highlighting but unfortunately Tumblr, although used by many code monkeys, doesn’t support this. It is however pretty simple to add syntax highlighting to Tumblr. All you need is a Javascript library (you have several to choose from) and a bit of Tumblr template editing. You of course also need a web host for these additional Javascript and CSS files.&lt;/p&gt;

&lt;h2&gt;Prerequisites&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Web host for a few additional Javascript and CSS files. You cannot upload files to Tumblr.&lt;/li&gt;
&lt;li&gt;Custom Tumblr template. You need to add a few lines of HTML code into your template.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;SHJS - Syntax Highlighting in JavaScript&lt;/h2&gt;

&lt;p&gt;From all the alternatives Google found for me my choice was &lt;a href="http://shjs.sourceforge.net/"&gt;SHJS&lt;/a&gt;. It seemed simple enough.&lt;/p&gt;

&lt;h3&gt;1. Install SHJS&lt;/h3&gt;

&lt;p&gt;Just upload the SHJS files to your web host.&lt;/p&gt;

&lt;h3&gt;2. Edit Your Template&lt;/h3&gt;

&lt;p&gt;SHJS requires one main Javascript file plus one for each syntax you want to use. In the example only PHP syntax is loaded. You also need to load a CSS file. And the final thing to add is the onload call to body.&lt;/p&gt;

&lt;pre class="sh_html"&gt;
&lt;head&gt;
  ...
  &lt;script type="text/javascript" 
    src="http://mydomain.tld/blog_resources/sh_main.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" 
    src="http://mydomain.tld/blog_resources/lang/sh_php.js"&gt;&lt;/script&gt;
  &lt;link type="text/css" rel="stylesheet" 
    href="http://mydomain.tld/blog_resources/css/sh_nedit.css"&gt;
&lt;/head&gt;
&lt;body onload="sh_highlightDocument();"&gt;
&lt;/pre&gt;

&lt;h3&gt;3. Start Showing off Your Mad Coding Skilz&lt;/h3&gt;

&lt;p&gt;SHJS automatically parses code wrapped inside &lt;pre&gt;. Use special class identifiers to tell it what syntax highlighting to use. Refer to &lt;a href="http://shjs.sourceforge.net/doc/documentation.html"&gt;SHJS documentation&lt;/a&gt; for available syntaxes/class names.&lt;/p&gt;

&lt;pre class="sh_html"&gt;
&lt;pre class="sh_php"&gt;
  $foo = new MyClass('string', array(123, 456));
&lt;/pre&gt;
&lt;/pre&gt;</description><link>http://blog.veikko.fi/post/59933375</link><guid>http://blog.veikko.fi/post/59933375</guid><pubDate>Sun, 16 Nov 2008 13:34:00 +0200</pubDate><category>tips</category></item><item><title>ADT Agavi Debug Tools</title><description>&lt;a href="http://adt.projectbin.org/"&gt;ADT Agavi Debug Tools&lt;/a&gt;: &lt;p&gt;I’ve released a first public version of a debug toolbar for &lt;a href="http://agavi.org"&gt;Agavi&lt;/a&gt;. It supports traditional HTML output but you can also use it with &lt;a href="http://firephp.org"&gt;FirePHP&lt;/a&gt; - extremely helpful when developing AJAX stuff with Agavi. Check it out at &lt;a href="http://adt.projectbin.org/."&gt;http://adt.projectbin.org/.&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.veikko.fi/post/59739290</link><guid>http://blog.veikko.fi/post/59739290</guid><pubDate>Sat, 15 Nov 2008 01:34:00 +0200</pubDate><category>agavi</category><category>php</category></item><item><title>Hans explains what is wrong with PHP</title><description>&lt;a href="http://propel.tigris.org/servlets/ReadMsg?list=dev&amp;msgNo=3480"&gt;Hans explains what is wrong with PHP&lt;/a&gt;: &lt;p&gt;(via &lt;a href="http://blog.wombert.de/"&gt;wombert&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;I just had to reblog this for two reasons - I wanted to learn how rebloging works with Tumblr &lt;strong&gt;AND BECAUSE HE IS SO RIGHT…&lt;/strong&gt;&lt;/p&gt;</description><link>http://blog.veikko.fi/post/59688821</link><guid>http://blog.veikko.fi/post/59688821</guid><pubDate>Fri, 14 Nov 2008 18:56:00 +0200</pubDate><category>php</category></item><item><title>http://www.camilla.fi/</title><description>&lt;a href="http://www.camilla.fi/"&gt;http://www.camilla.fi/&lt;/a&gt;: &lt;p&gt;Just finished upgrading my wife’s site. The site is of course built with &lt;a href="http://www.agavi.org"&gt;Agavi&lt;/a&gt; :) English translation is almost ready but we decided to release the site without it for now.&lt;/p&gt;</description><link>http://blog.veikko.fi/post/59555298</link><guid>http://blog.veikko.fi/post/59555298</guid><pubDate>Fri, 14 Nov 2008 16:12:48 +0200</pubDate><category>personal</category></item></channel></rss>
