Zend Amf And Flex

67 %
33 %
Information about Zend Amf And Flex
Technology

Published on March 28, 2009

Author: riafox

Source: slideshare.net

Description

Introsuction to using Zend AMF with Zend Framework and Adobe Flex

Zend AMF and Flex

Zend Framework Web site: http://framework.zend.com Zend Framework (ZF) is an open source, object-oriented web application framework implemented in PHP 5 and licensed under the New BSD License.     ZF was publicly announced at the first Zend Conference in October 2005. On July 1, 2007, Zend Framework 1.0 was released.   Current Version 1.7.7 http://framework.zend.com/download/latest

Web site: http://framework.zend.com

Zend Framework (ZF) is an open source, object-oriented web application framework implemented in PHP 5 and licensed under the New BSD License.

 

  ZF was publicly announced at the first Zend Conference in October 2005. On July 1, 2007, Zend Framework 1.0 was released.

 

Current Version 1.7.7 http://framework.zend.com/download/latest

Why are people using Zend? Use-at-will Framework Provides components for MVC, Table Data Gateway and Row Data Gateway design patterns All components in Zend Framework are object oriented Takes advantage of the latest development features AJAX Search Engine Web Services BSD License (Enterprise Friendly) Well Documented

Use-at-will Framework

Provides components for MVC, Table Data Gateway and Row Data Gateway design patterns

All components in Zend Framework are object oriented

Takes advantage of the latest development features

AJAX

Search Engine

Web Services

BSD License (Enterprise Friendly)

Well Documented

Adobe Flex http://www.adobe.com/products/flex/   Flex is an open source framework used to create cross-platform Rich Internet Applications (RIA)    Adobe Released Flex 1.0 in March of 2004   Current SDK: 3.3   Flex Builder IDE based on Eclipse

http://www.adobe.com/products/flex/

 

Flex is an open source framework used to create cross-platform Rich Internet Applications (RIA) 

 

Adobe Released Flex 1.0 in March of 2004

 

Current SDK: 3.3

 

Flex Builder IDE based on Eclipse

AMF Action Message Format   Action Message Format is an object exchange binary format accessed through a Remote Procedure Call (RPC)   Adobe Systems published the AMF binary data protocol specification on December 13, 2007 and announced that it will support the developer community to make this protocol available for every major server platform.

  Action Message Format is an object exchange binary format accessed through a Remote Procedure Call (RPC)

 

Adobe Systems published the AMF binary data protocol specification on December 13, 2007 and announced that it will support the developer community to make this protocol available for every major server platform.

AMF Benefits AMF Objects are small compressed using zlib Fast serialization / deserialization Native Types and Custom classes supported

AMF Objects are small compressed using zlib

Fast serialization / deserialization

Native Types and Custom classes supported

http://www.jamesward.com/blog/2007/04/30/ajax-and-flex-data-loading-benchmarks/

Zend AMF   Info: http://framework.zend.com/manual/en/zend.amf.html    Download: http://framework.zend.com/download/amf Zend_Amf provides support for Adobe's Action Message Format (AMF), to allow communication between Adobe's Flash Player and PHP. Specifically, it provides a gateway server implementation for handling requests sent from the Flash Player to the server and mapping these requests to object and class methods and arbitrary callbacks.

 

Info: http://framework.zend.com/manual/en/zend.amf.html 

 

Download: http://framework.zend.com/download/amf

Zend_Amf provides support for Adobe's Action Message Format (AMF), to allow communication between Adobe's Flash Player and PHP. Specifically, it provides a gateway server implementation for handling requests sent from the Flash Player to the server and mapping these requests to object and class methods and arbitrary callbacks.

Files: Root app/ lib/ log/ pub/ tmp/

app/

lib/

log/

pub/

tmp/

Files: app/ conf/     setupdb.sql     main.ini models/     Contacts.php

conf/

    setupdb.sql

    main.ini

models/     Contacts.php

Files: lib/ Zend/     Acl.php     Acl/     ......... Riafox/     Flexstring.php     Flexstring/

Zend/

    Acl.php

    Acl/

    .........

Riafox/     Flexstring.php

    Flexstring/

Files: pub/ css/ img/      js/ swf/      main.swf xml/     crossdomain.xml     gateway-config.xml   .htaccess index.php

css/

img/     

js/

swf/

     main.swf

xml/

    crossdomain.xml

    gateway-config.xml

 

.htaccess

index.php

Files: pub/xml/crossdomain.xml <cross-domain-policy> <allow-access-from domain=&quot;zendamf.riafox.com&quot; /> </cross-domain-policy>

<cross-domain-policy> <allow-access-from domain=&quot;zendamf.riafox.com&quot; /> </cross-domain-policy>

Files: pub/.htaccess RewriteEngine on RewriteRule ^(crossdomain.xml)$ pub/xml/crossdomain.xml [L] RewriteRule ^(gateway-config.xml)$ pub/xml/gateway-config.xml [L] RewriteRule !.(js|ico|gif|jpg|png|xml|swf)$ index.php php_flag magic_quotes_gpc off php_flag register_globals off php_flag display_errors on php_value session.auto_start 0

RewriteEngine on RewriteRule ^(crossdomain.xml)$ pub/xml/crossdomain.xml [L] RewriteRule ^(gateway-config.xml)$ pub/xml/gateway-config.xml [L] RewriteRule !.(js|ico|gif|jpg|png|xml|swf)$ index.php php_flag magic_quotes_gpc off php_flag register_globals off php_flag display_errors on php_value session.auto_start 0

Files: pub/index.html   error_reporting(E_ALL|E_STRICT); date_default_timezone_set('America/Boise'); $rootPath = dirname($_SERVER[&quot;DOCUMENT_ROOT&quot;]); define('APPLICATION_PATH', $rootPath . '/application'); set_include_path('.' . PATH_SEPARATOR . $rootPath.'/library' . PATH_SEPARATOR . $rootPath.'/application/models/' . PATH_SEPARATOR . $rootPath.'/application/library/' . PATH_SEPARATOR . APPLICATION_PATH . '/library/App/View/Helper/' . PATH_SEPARATOR . get_include_path()); session_save_path(APPLICATION_PATH . '/temp'); include &quot;Zend/Loader.php&quot;; $server = new Zend_Amf_Server(); $server->setProduction(false);$server->addDirectory('../application/models/'); $response = $server->handle();    echo $response;

 

error_reporting(E_ALL|E_STRICT); date_default_timezone_set('America/Boise'); $rootPath = dirname($_SERVER[&quot;DOCUMENT_ROOT&quot;]); define('APPLICATION_PATH', $rootPath . '/application'); set_include_path('.' . PATH_SEPARATOR . $rootPath.'/library' . PATH_SEPARATOR . $rootPath.'/application/models/' . PATH_SEPARATOR . $rootPath.'/application/library/' . PATH_SEPARATOR . APPLICATION_PATH . '/library/App/View/Helper/' . PATH_SEPARATOR . get_include_path()); session_save_path(APPLICATION_PATH . '/temp'); include &quot;Zend/Loader.php&quot;; $server = new Zend_Amf_Server(); $server->setProduction(false);$server->addDirectory('../application/models/');

$response = $server->handle(); 

  echo $response;

Files: app/models/Test.php <?php class Test{   public  function hello($text) {     return &quot;Message Received:{$text}&quot;;   } } ?>  

<?php class Test{   public  function hello($text) {     return &quot;Message Received:{$text}&quot;;   } } ?>

 

services-config.xml <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <services-config>     <services>         <service id=&quot;amfphp-flashremoting-service&quot; class=&quot;flex.messaging.services.RemotingService&quot; messageTypes=&quot;flex.messaging.messages.RemotingMessage&quot;>             <destination id=&quot;zend&quot;>                 <channels>                     <channel ref=&quot;my-zend&quot;/>                 </channels>                 <properties>                     <source>*</source>                 </properties>             </destination>         </service>     </services>     <channels>         <channel-definition id=&quot;my-zend&quot; class=&quot;mx.messaging.channels.AMFChannel&quot;>             <endpoint uri=&quot;http://zendamf.riafox.com/gateway.amf&quot; class=&quot;flex.messaging.endpoints.AMFEndpoint&quot;/>         </channel-definition>     </channels> </services-config>

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <services-config>     <services>         <service id=&quot;amfphp-flashremoting-service&quot; class=&quot;flex.messaging.services.RemotingService&quot; messageTypes=&quot;flex.messaging.messages.RemotingMessage&quot;>             <destination id=&quot;zend&quot;>                 <channels>                     <channel ref=&quot;my-zend&quot;/>                 </channels>                 <properties>                     <source>*</source>                 </properties>             </destination>         </service>     </services>     <channels>         <channel-definition id=&quot;my-zend&quot; class=&quot;mx.messaging.channels.AMFChannel&quot;>             <endpoint uri=&quot;http://zendamf.riafox.com/gateway.amf&quot; class=&quot;flex.messaging.endpoints.AMFEndpoint&quot;/>         </channel-definition>     </channels> </services-config>

compiler settings add -services &quot;C:path-to-servicesservices-config.xml&quot;

add -services &quot;C:path-to-servicesservices-config.xml&quot;

main.mxml <mx:RemoteObject id=&quot;myservice&quot;     fault=&quot;faultHandler(event)&quot;     showBusyCursor=&quot;true&quot;     source=&quot;Test&quot;     destination=&quot;zend&quot;>         <mx:method name=&quot;hello&quot; result=&quot;responseHandler(event)&quot; />     </mx:RemoteObject>   http://zendamf.riafox.com/public/test/main.html

<mx:RemoteObject id=&quot;myservice&quot;     fault=&quot;faultHandler(event)&quot;     showBusyCursor=&quot;true&quot;     source=&quot;Test&quot;     destination=&quot;zend&quot;>         <mx:method name=&quot;hello&quot; result=&quot;responseHandler(event)&quot; />     </mx:RemoteObject>

 

http://zendamf.riafox.com/public/test/main.html

Resources The ABCs of AMF Format Ajax and Flex Data Loading Benchmarks Wade Arnold Blog Zend AMF ZF Programmer's Reference Guide AMF3 Specifications Latest Zend Framework Download Zend AMF Download Adobe 3.3 Language Reference  

The ABCs of AMF Format

Ajax and Flex Data Loading Benchmarks

Wade Arnold Blog Zend AMF

ZF Programmer's Reference Guide

AMF3 Specifications

Latest Zend Framework Download

Zend AMF Download

Adobe 3.3 Language Reference  

Questions? http://www.slideshare.net/riafox/zend-amf-and-flex   How to Find Us     @riafox @richbreton @ben_whitaker Web site: http://www.riafox.com

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

Zend Framework - Issue

Connecting to your Zend_Amf_Server from your Flex project is quite simple; you simply need to point your endpoint URI to your Zend_Amf_Server script.
Read more

Zend Framework - Issue

Zum eigenen Zend_Amf_Server von einem Flex Projekt aus zu verbinden ist recht einfach; man muß zur Endpunkt URI des Zend_Amf_Server Sripts zeigen. Nehmen ...
Read more

Flex and PHP: remoting with Zend AMF | Mihai Corlan

The latest PHP library to add support for AMF and remoting is Zend Framework. The preview prelease version 1.7 offers a new component Zend_AMF that lets ...
Read more

Creating a basic CRUD application using Flex and PHP with ...

Set up the PHP code on the server, configure Zend AMF, and create the code needed on the client side.
Read more

Get to know Flex and Zend_Amf - Zend Developer Zone

Get to know Flex and Zend_Amf By Jack Herrington. The best applications for the rich Internet connect to the server to both read and write data. So,
Read more

File uploads with Adobe Flex and Zend AMF

Now our mxml that will load the bytes from the file to send to Zend AMF for encoding and transfer. Explore the full source code on my site. My blog: http ...
Read more

Working with Doctrine 2, Zend AMF, Flex, and Flash Builder ...

Create an application that uses Doctrine 2 for PHP on the server side, Flex on the client side, and remoting via the Zend Framework.
Read more

Flex, AMF, PHP and Zend Framework | Mihai Corlan

If you missed the last week announcements coming from Adobe and Zend, then you might want to read this post. Basically, the two companies announced a join ...
Read more

Adobe Flex 4 * Installing Zend Framework

For productions servers, Adobe recommends that you move the ZendFramework folder outside the web root. Update the zend_path variable defined in amf_config.ini
Read more

Creating a basic CRUD application using Flex and ... - DZone

Creating a basic CRUD application using Flex and PHP with Zend AMF by Ryan Stewart · ... Join the DZone community and get the full member ...
Read more