Archive for the 'amfphp' Category

CakeSWXPHP – updated to SWX 2.0 beta 1

The first beta of the new version of SWX was released yesterday. This new version brings AS3 and Flash Player 10 support. I decided to update CakeSWXPHP, to support this new version of SWX. You can download a new version, from my CakeSWXPHP page.

Image search service

I had to search for (stock) images today, to include in a presentation. I found myself tabbing through different search engines all the time, so I decided to write an amf/swx service which has methods to search SXC, MorgueFile, Google Image search and Flickr. This way, I can write a flash frontend, which makes my life a little easier.

You can see a simple image browser at: http://labs.aboutme.be/image_search/.

And of course, the server side code is available for download aswell.. You can find the service itself in swx/services/ImageService.php. For Flickr, you will need to have an API key, and enter your API key in the ImageService PHP file.

benchmarking cakeswx/amfphp

Cakeswxphp enables you to use the cakphp rapid application framework as your remoting backend. No longer writing complex sqls, escaping query strings,… As some of you have noticed, cake does slow your remoting down a bit, as more classes are loaded to give you this ease-of-use. I did some benchmarks, comparing amfphp and swx with cakeswxphp 1.1 and cakeswxphp 1.2. I ran the echoData service 10 times, and took the average speed of those calls. These are the results:

SWX: 346ms
CakeSWXPHP 1.1: 350ms
CakeSWXPHP 1.2: 369ms
AMFPHP: 57ms
CakeAMFPHP 1.1: 111ms
CakeAMFPHP 1.2: 126ms

As we already know, AMFPHP is fast as hell. The CakePHP version is 2x slower because of the extra classes & functions cakephp executes. The difference between SWX and CakeSWX isn’t that big.

After that, I turned out eaccelerator (PHP caching / accelerator system) and ran the benchmark again:

SWX: 347ms
CakeSWXPHP 1.1: 364ms
CakeSWXPHP 1.2: 362ms
AMFPHP: 50ms
CakeAMFPHP 1.1: 64ms
CakeAMFPHP 1.2: 67ms

Not much difference between the first results without the caching, except for the Cake AMF gateway: it seems like using a php accelerator makes the cakeamfphp almost as fast as the native amfphp!

I’ve included the benchmark scripts:

cakeswxphp SWX benchmark
cakeswxphp AMF benchmark (AS3)

cakeswxphp: simpler and on cake 1.2

After some user input, I updated the cakeswxphp packages. I also started a branch which supports cakephp 1.2. There is a change in the gateway locations: you no longer connect to cake_swx_gateway.php or cake_amf_gateway.php, but to swx.php and amf.php (default locations in swx). This should make it even simpler to start with (cake)swx!

Again, you can download it at the cakesxwphp page

CakeSWXPHP updated to SWX version 1.01

Aral Balkan released SWX version 1.0 a few weeks ago. I finally found the time to incorporate the changes into CakeSWXPHP! The changes include the swxAssembler class (instead of the old swfCompiler) and the rebranded service explorer.

Go to the cakeswxphp page for the latest downloads!

CakeSWXPHP updated to SWX beta 1.3

I took some time updating my cakeswxphp package to the SWX beta 1.3. One of the new features is the new service explorer from SWX.

You can test your cake gateway, pointing your browser to the /explorer/ directory, gateway location being: cake_amf_gateway.php

Go to the cakeswxphp page for the latest downloads!

Enjoy!

call cakephp through swx / amf

As some of you might know, I’m a great fan of the cakephp framework. It is a rapid application framework for php. Cakephp already had a subproject called cakeamfphp. Looking at the code from cakeamfphp, I was able to get SWX running and call the cake controllers as remoting services.

Go to the cakeswxphp page for the latest downloads…

Just copy/past in your cake directory! Gateway locations are:

swx.php (SWX)
amf.php (AMFPHP)
json.php (JSON)

Currently it uses an adjusted version of SWX, based on SWX beta 1.0. I will try to update it to future versions of SWX when I get the time…

More info about SWX and cakephp at:

http://www.swxformat.org/
http://www.aralbalkan.com/ (Aral Balkan, SWX author)
http://www.cakephp.org/

Enjoy!