Archive

Archive for November, 2008

Bootstrap file for Zend Amf

November 4th, 2008

There seems to be lots of questions about the best way to setup your bootstrap/endpoint/index.php file in order to work with Zend Amf. The idea of leveraging the Zend MVC framework to route to your server endpoint is a common question but personally seems like a bad idea. Although it may seem convenient it does not provide any MVC integration and second will slow down the response time of your service greatly.

I typically have something like the following structure:

public/
  .htaccess
  index.php
  xmlrpc.php
  jsonrpc.php
  amf.php

In my .htaccess, I have the following:

php_value date.timezone "UTC"
php_value short_open_tag 1
php_value error_reporting 8191
php_flag  display_errors Off
php_flag  display_startup_errors Off

# Rewrite Rules
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^/?xmlrpc  xmlrpc.php  [NC,L]
RewriteRule ^/?jsonrpc jsonrpc.php [NC,L]
RewriteRule ^/?amf     amf.php     [NC,L]
RewriteRule ^.*$       index.php   [NC,L]

Then, in my amf.php, I’d have the following:

setClass(...); // etc...
echo $server->handle();

The rewrite rules allow you to go directly to the given file, and then each file sets up the include_path, autoloading, and the server.

Flash Platform, Zend_Amf

MAX Scheduale set!

November 2nd, 2008

I finally purchased my Adobe MAX ticket and filled out my scheduale. Let me know if you are speaking or attending and read this blog. Would love to attend your session or grab a beer/coffee to chat about the type of things that make you come back to this page! I will make sure I blog, twitter, etc while I am there.

Speaking