Almer/Blank Labs

ZamfBrowser 1.0 – ZendAMF Service Browser

ZamfBrowser is a ZendAMF Service Browser, like the AMFPHP Service Browser, which lets a developer unit test ZendAMF services.  I posted this project today for download on RIAForge at http://zamfbrowser.riaforge.com.   …read more…

Cool Features in Flash Builder 4

I was recently working on a project in the latest beta release of the forthcoming Flash Builder 4 and wanted to point out the new contextual help feature. What's nice about this feature is that I had just added the highlighted event to the event class and was busy implementing it in a view class and because of FB4's new code-hinting muscle I was able to see everything that I had documented in the event class concerning the event without having to have the event class open. This is definitely a much appreciated usability enhancement. Now, if we could just get editable code (not file) templates (think FDT, Zend Studio, etc), FB4 would be that much closer to being ready for prime time...Big grin

AMFPHP Fatal Errors After PHP 5.3 Upgrade (Part 2)

As promised in Part 1, I'm documenting yet another issue that must be addressed in your AMFPHP installation upon upgrading to PHP 5.3. This issue stems from the usage of the eregi_replace function that has been deprecated in PHP 5.3. If you run into a fatal error in your AMFPHP application with the message Function eregi_replace() is deprecated, you have (2) options:
  1. Modify your PHP configuration to disable the warnings
  2. Replace the deprecated code with the new, recommended equivalent
I'd advise against #1 since you will also lose warning and error notices that could be helpful to you during development. And, by choosing #2 you will be bringing the AMFPHP code into compliance with a change that is also backwards-compatible with previous versions of PHP since the replacement function you're going to use has been around since PHP 4. So, to update your AMFPHP source, you need to modify MethodTable.php which can be found @ /path/to/amfphp/core/shared/util/MethodTable.php. Open up this file in your favorite text editor (ie, TextMate Smiling ) and jump to line 505. Once there, you need to replace these three lines:
$comment = eregi_replace(”\n[ \t]+”, “\n”, trim($comment));
$comment = str_replace(”\n”, “\\n”, trim($comment));
$comment = eregi_replace([\t ]+”, ” “, trim($comment));
with these equivalent lines of code:
$comment = preg_replace('\n[ \t]+'U”, “\n”, trim($comment));
$comment = str_replace(”\n”, “\\n”, trim($comment));
$comment = preg_replace('[\t ]+'U”, ” “, trim($comment));
Save and close the file, fire up your service browser and you should now be good to go with no more fatal errors in your AMFPHP applications produced by this deprecated function. Happy coding! Big grin

AMFPHP Fatal Errors After PHP 5.3 Upgrade (Part 1)

If you experience the following error in your AMFPHP-based applications: PHP Fatal error: Uncaught exception 'VerboseException' with message 'date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead' in /path/to/amfphp/core/amf/app/Gateway.php:213\nStack trace:\n#0 [internal function]: amfErrorHandler(2, 'date(): It is n...', '/path/to/amfphp...', 213, Array)\n#1 /path/to/amfphp/core/amf/app/Gateway.php(213): date('D, j M Y ')\n#2 /path/to/amfphp/gateway.php(154): Gateway->service()\n#3 {main}\n thrown in /path/to/amfphp/core/amf/app/Gateway.php on line 213, referer: http://www.yourdomain.com/path/to/amfphp/browser/servicebrowser.swf You can fix it by uncommenting and defining the date.timezone line in your php.ini configuration file. For my local environment that would look like the following:
date.timezone = "America/Los Angeles"
This, unfortunately, is just one of the things that breaks upon upgrading to PHP 5.3. Stay tuned as I try to catalog them along with the fixes...Smiling

New Screencasts Available

Posted (2) new walkthroughs this morning on my labs site. The 1st demonstrates basic usage of the KwikUML AIR app (model creation/editing, stub code generation, etc).

The 2nd one is an overview of, the soon-to-be-released, KwikDoc AIR app. This app demonstrates a really cool way to integrate your AIR applications with the underlying OS.

Enjoy!! Big grin