Jan 27
Permalink

Agavi 1.0.2 released!

The Agavi team is happy to announce that Agavi 1.0.2 is now available for download at www.agavi.org.

The CHANGELOG for this release counts 8 additions, 22 changes and at least 39 fixes over Agavi 1.0.1; the most important ones are:

  • Support for HTML 5 forms in AgaviFormPopulationFilter.
  • Support for Doctrine 1.2.
  • Support for Propel 1.4.
  • Support for Phing 2.4.0.
  • Support for PHPTAL 1.2.
  • Support for PHP 5.3 Namespaces

Several validation-related fixes and changes have been made, and a ton of bugfixes were backported from the ICU project in the internationalization subsystem.

The bundled PHPUnit, timezonedb and Schematron versions have also been updated to their latest releases.

As always, the RELEASE_NOTES have the full story.

Jan 19
Permalink

Agavi 1.0.2 RC4 released!

Agavi 1.0.2 RC4 is now available for download at www.agavi.org.

This release adds support for Doctrine 1.2 and implements HTML 5 forms in AgaviFormPopulationFilter.

A couple of bugs have also been fixed; the most important one results in whitespace-only configuration parameter values being cast to null now instead of an empty string.

The timezone database has also been updated to their latest versions.

As always, the CHANGELOG has the full list of changes in this release.

Please test this thoroughly; a final release is scheduled to follow next week.

Dec 23
Permalink

Server Migration Wednesday/Thursday

We’re about to move agavi.org and a ton of related stuff to a new server. This will affect the website, Trac, SVN, PEAR Channels, Mailing Lists and so forth.

The DNS TTL for agavi.org is 24 hours and unfortunately, we can’t change that, so it’ll take quite a bit for the updated nameserver records to propagate. Because of this, we’re switching all services on the old servers to a read-only mode until the migration is completely finished. The mailing lists should migrate relatively instantly (and seamlessly), but you never know.

If you’re still experiencing any kind of trouble after Thursday, please let us know so we can investigate.

Thank you for your patience and have very happy holidays!

Dec 15
Permalink

Save Letters, Use Short Validator Names!

Something’s been bugging me lately. Be it customer projects or code people post on the channel, I often find code that spells out long validator names, over and over again:

<?xml version="1.0" encoding="UTF-8"?>
<ae:configurations
    xmlns="http://agavi.org/agavi/config/parts/validators/1.0"
    xmlns:ae="http://agavi.org/agavi/config/global/envelope/1.0"
    parent="%core.module_dir%/Account/config/validators.xml"
>
    <ae:configuration>

        <validators>
            <validator class="FooBarValidatorWithVeryLongClassname">
                <arguments>
                    <argument>foo</argument>
                </arguments>
            </validator>

            <validator class="FooBarValidatorWithVeryLongClassname">
                <arguments>
                    <argument>bar</argument>
                </arguments>
            </validator>

            <validator class="string">
                <arguments>
                    <argument>baz</argument>
                </arguments>
            </validator>

        </validators>

    </ae:configuration>
</ae:configurations>

Granted, this is one of the less documented features in Agavi, but does nobody ever wonder whether there’s a better way? There’s obviously a way to create shortcuts or the validator named string couldn’t be resolved - the full classname is AgaviStringValidator.

Actually, it’s quite simple. At any point in a validation file you can define shortnames and use like this:

<?xml version="1.0" encoding="utf-8"?>
<ae:configurations xmlns="http://agavi.org/agavi/config/parts/validators/1.0" 
xmlns:ae="http://agavi.org/agavi/config/global/envelope/1.0">

    <ae:configuration>
        <validator_definitions>

            <validator_definition name="foo" class="FooBarValidatorWithVeryLongClassname" />

        </validator_definitions>

        <validators>
            <validator class="foo">
                <arguments>
                    <argument>foo</argument>
                </arguments>
            </validator>

            <validator class="foo">
                <arguments>
                    <argument>bar</argument>
                </arguments>
            </validator>

            <validator class="string">
                <arguments>
                    <argument>baz</argument>
                </arguments>
            </validator>

        </validators>
    </ae:configuration>
</ae:configurations>

Validatordefinitions can include default parameters and multiple definitions can reference the same class:

<?xml version="1.0" encoding="utf-8"?>
<ae:configurations xmlns="http://agavi.org/agavi/config/parts/validators/1.0" 
xmlns:ae="http://agavi.org/agavi/config/global/envelope/1.0">

    <ae:configuration>
        <validator_definitions>

            <validator_definition name="foo" class="FooBarValidatorWithVeryLongClassname" />


            <validator_definition name="foobar" class="FooBarValidatorWithVeryLongClassname">
                <ae:parameters>
                    <ae:parameter name="bar">baz</ae:parameter>
                <ae:parameters>
            </validator_definition>

        </validator_definitions>

    </ae:configuration>
</ae:configurations>

The default parameters can be overwritten by the actual validator definition referencing that shortname. This is how all the shortnames we provide are implemented - the curious among you can have a peek in the config/defaults/validators.xml file.

Projects created with Agavi > 1.0.0 will have a cascade of validator files that are loaded: The actual validaton file for the action which references a validator config in the module’s config directory which in turn references a validator config file in the app’s config directory which in turn references the agavi default file. Older projects do not have this structure but I do recommend to create at least a global config file to shorten often used names.

Dec 10
Permalink

Agavi 1.0.2 RC3 released!

Agavi 1.0.2 RC3 is now available for download at www.agavi.org.

This release adds support for Propel 1.4 and introduces a new way to configure connection setting overrides for Propel; see the RELEASE_NOTES for details.

A couple of bugs have also been fixed, most notably an issue where the first element of a multi-dimensional array would be lost when exported from a validator.

PHPUnit and the timezone database have been updated to their latest versions.

As always, the CHANGELOG has the full list of changes in this release.

Unless there are any nasty surprises, a final release will follow next week.

Nov 06
Permalink

Agavi 1.0.2 RC2 released!

Hello everybody,

Agavi 1.0.2 RC2 is now available for download at www.agavi.org.

A couple of fixes have been made since RC1, and PHPUnit and the timezone database have been updated to their latest versions.

We’re currently planning a final release next week, after another new version of the timezone database has been released.

Enjoy your weekend,

David

Sep 16
Permalink

Fifth Agavi Article on IBM developerWorks

The fifth and final article in the series on Agavi over at IBM developerWorks has just been published.

This last part talks about handling of file uploads, storing data in sessions and writing custom validator classes. Go read it, rate it, blog about it and spread the word!

Sep 13
Permalink

Agavi 1.0.2 RC1 released!

Agavi 1.0.2 RC1 is now available for download at www.agavi.org.

This maintenance release fixes a number of issues over Agavi 1.0.1 and brings a couple of minor enhancements.

The following fixes are worth mentioning:

  • AgaviArraylengthValidator didn’t work with files.
  • AgaviValidationManager::clear() didn’t clear validation errors.
  • Multiple settings blocks and settings prefixes were not allowed in module configs.
  • AgaviNumberValidator does not mutate invalid input anymore.
  • Several ICU bugfixes have been ported.

Important Changes:

  • Optional strict comparison of elements in AgaviInarrayValidator now possible.
  • Validator shortcut “arraylength” now defaults to minimum of one element.
  • Routing callback parameters are now set before initialize method is called.
  • Lots of ICU bugfix and change backports to the date and translation system. As a result, custom time zones now have identifiers like “GMT+0200”.
  • Namespaced class identifiers can now be used in all configuration files.
  • AgaviValidator::getArgument() now accepts an argument identifier.
  • Support for PHPTAL 1.2.

Bundle updates:

  • The timezone database has been updated to version 2009m.
  • PHPUnit has been updated to version 3.4.0RC3.
  • ISO Schematron has been updated to version 2009-05-18.

Please refer to CHANGELOG for a full list of changes.

Sep 02
Permalink

Fourth Agavi Article on IBM developerWorks

The fourth article in the series on Agavi over at IBM developerWorks has just been published.

The new part details Agavi’s Output Types and how to quickly implement alternative response formats. Go read it, rate it, blog about it and spread the word!

Aug 19
Permalink

Get me a standard agavi project, the fast way

More often than not I want to create a new agavi project the “standard” way, that is:

  • Change the projects name
  • Change the projects prefix
  • Use the defaults for all other options

Calling agavi project-wizard makes me answer all questions, one by one. Sure, pressing enter at every prompt works, but I value my time too much to press enter at every prompt. I’d rather go write a blog post about how not to press enter at every prompt.

Enter “yes”

“yes” is a small commandline utility that answers “yes” or any given string to any prompt given to it:

yes '' | agavi project-wizard

will create a project with all default values. Now the only thing that needs fixing is the project name and the project prefix - we can do that on the commandline[1]:

yes '' | agavi -D project.name "My little test project" -D project.prefix "MyLTP" project-wizard

This is not faster in any way than running through the wizard, but I can do other things during that time.

[1] Please note this bug that prevents passing parameters with spaces to the build system: http://trac.agavi.org/ticket/1137