In preparation of 4.1 stable release of Agile Toolkit

Thursday, July 7th, 2011|Uncategorized|by Romans

We listen to your feedback and are cleaning code, adding PHPDOC support and more stuff. The “master” branch in github was switched to a version in preparation of 4.1 release.

If you were using 4.0 and are not quite ready to update then checkout “4.0″ branch from git. If you were on 4.1-beta1 then you are welcome to try “master”. If it produces errors, you can fall back to “4.1″ branch.

Of course we would love if you use “master” and gave us feedback on the errors you encounter. There are few minor thing to consider if you are switching from 4.1b1 though. Official upgrade guide is not out yet, hence the blog post:

hook() return

Previously hook() would return value which hooked function have returned. Now it returns array() with values. If no hooks were set then empty array is returned. This may have some impact on your code if you are checking for return from hook().

cd lib; grep -R hook | grep if

$tabs->addTab()

It has it’s arguments switched places. Previously using 1st argument with space would break the tabs. Now that works properly. You can still specify 2nd argument which is name, but it’s not essential since 4.0 version.

$tabs->addTab(‘Hello World’);

$view->frame(‘test’);

Frame function is now gone. Instead you have a “Frame” class and using it is just as straightforward:

$view->add(‘Frame’)->setTitle(‘test’);

If you have used frame() in 1000 places, then there is a compatibility controller.

(in api) $this->add->(‘Controller_Compat’);

This controller will continue to accumulate removed and obsolete functions.

Dynamic Methods

Long-time an experimental feature, we have added support for dynamic methods. This functionality should not be used casually. Basically it allows to register extra methods for any object. Just like JavaScript.

$obj->addMethod(‘test’,function($obj){ $obj->add(‘HelloWorld’); });

$obj->test();

This functionality is intended to be used by Controllers. Catch-all implementation in PHP is not so fast, so avoid using dynamic methods if possible.

Cleanups

Lots of other minor cleanups were done such as renaming exceptions. Those shouldn’t affect your code at all.

Automated test suite

http://github.com/atk4/atk4-testsuite is a project to incorporate all of Agile Toolkit testing. Our goal is to have tests for every single feature. Internal tests can be tested automatically, but visual tests will need to be triggered by user. Of course you can build a similar test-suite for your application classes.

If you have ideas on how to test UI components better, your comments are welcome.

Localization support

Application class now has “_” function, which is already used in some places. Currently it doesn’t do much. Our goal is to have messaging routed through this function internally. If you wish to localize Agile Toolkit application or have multi-lingual support, it’s there.

To Be Continued…

Still to be added would be:

  • New database driver. Replacement for DBlite based on PDO. It will use same dsql class though.
  • PostgreSQL support. Not many, but some of you have asked. We will try to add support.
  • Ability to change “id” fields in models. It’s possible even now, but I’ll need to write additional doc / blog about it.

Thanks to

I wanted to say Huge Thanks to people who have helped with feedback, suggestions and, most of all, testing: Janis, Trevor, Mayack, Fernando, Bruce, Tim, Prashanth, Dawid, Maxim, Ton, JStika, Killingfloorarg, Nanomo, Wilgucki.

2 Comments

Tim
Posted July 9, 20115:18 pm

I noticed when creating a new project with the master branch of atk4 that there is at least one usage of the depracated “frame()” method; in atk4/lib/BasicAuth.php on line 341, frame() is used to add the Authentication frame.

Romans
Posted July 9, 20115:24 pm