Amfphp is a software tool to help you create cloud services. You create the functionality, and Amfphp allows clients to access it. It also provides a variety of tools to help you be a more productive developer.
Baguette AMF with Amfphp is recommended for Enterprise Applications.
Simply put, Baguette AMF makes Amfphp faster. Amfphp does many things, but one of its main tasks is converting of PHP objects to and from AMF. This is complex code written in PHP. As such it works but is quite slow. What Baguette AMF does is replace that part of the process with code written in C that is many times efficient. Baguette AMF integrates seamlessly with Amfphp with an Amfphp plugin.
For small amounts of data, Baguette AMF doesn’t make much difference. However when transferring large amounts of data, using Baguette AMF can make a huge difference in server performance and response times. So, using Amfphp with Baguette AMF you get all the functionalities and ease of use of Amfphp, and a big speed increase for big data. For details on what kind of performance gains you can expect, please see the page on performance testing.
First get Amfphp up and running on this server. Please look at Amfphp’s site to get started. Baguette AMF works with versions 2.0 and onwards. It is of course recommended that you use the latest stable version.
You should have a zip containing a folder called BaguetteAmf, itself containing some PHP files. Just drop this folder into your Amfphp plugins folder and you should be good to go.
On your server you should have the following folder hierarchy:
(Amfphp -> )Plugins -> BaguetteAmf -> BaguetteAmf.php
(Amfphp -> )Plugins -> BaguetteAmf -> BaguetteAmfDeserializer.php
(Amfphp -> )Plugins -> BaguetteAmf -> BaguetteAmfSerializer.php
(Amfphp -> )Plugins -> BaguetteAmf -> BaguetteAmfService.php
The BaguetteAmfService has a simple method to tell you if things are properly installed. Open the Amfphp Back Office, go to the service browser, you should see a new service called “BaguetteAmfService” with a “testInstalled” method. Call it, and it should tell you if Baguette AMF is properly installed.
Baguette AMF Service in the Amfphp Service Browser
You’ll also notice a “testFasterVoConverter” method. Since Baguette 1.0.1, the plugin supports using Amfphp 2.2 and later’s faster Value Object conversion. This is a tweak that is implemented in Amfphp 2.2 and later where Value Objects are handled much faster for protocols that can handle it, such as AMF. It is of course recommended to use the latest Baguette AMF with the latest Amfphp.This tells you if the Amfphp installation you supports fast Value Object conversion.
Differences in data with and without Baguette AMF
The one known difference is that a Flex Array Collection is deserialized as an array with Baguette AMF, whereas with some Amfphp versions there is a container object.