AMFPHP recent updates

http://www.feellights.com/dissertation-on-banking/ dissertation on banking Well, after a long time without any news it seems now we’re close to different updates about AMFPHP.

As you probably know Wade Arnold took the place of Patrick some time ago as project leader but no real big changes were committed since then.
But after the partnership between Zend and Adobe things started to change and amfphp started to move forward to the Zend Framework… and in fact many developers were afraid about the real future of amfphp.
Bt, as Wade said, the amfphp core will remain separated from the framework implementation ( a framework which I will never use however ), in order to have a shared core and 2 different branches for the implementation. ( a new release was promised before Adobe MAX )
However I’m afraid too about what could happen expecially when 2 major software houses “promote” an opensource project.
Probably I’m too sceptical, but I believe that in the future more and more things will be only supported in the zend_amf and not in the standalone amfphp project.

AMFPHP issue referencing ByteArray

http://www.arcosrl.info/?economics-assignment-help economics assignment help Recently I made some test in AMFPHP sending an retrieving ByteArray to be stored in a mysql blob field.

http://edificiosnakawe.com/dissertation-com-uacart/ dissertation com uacart But suddenly I encounter a problem when I was trying to return an array of ByteArrays and I could not find out the reason flash continued to show me this error:

term white paper

bronstein pulst, 2003 The php file which was generating this error was:

1
2
3
4
5
6
7
8
9
10
11
class Service
{
public function getArray( )
{
$GLOBALS['amfphp']['encoding'] = 'amf3';
$a = new ByteArray("\x00\x10this is a string");
$b = new ByteArray("\x00\x16this is another string");
$c = $a;
return array( $a, $b, $c );
}
}

http://plumberreview.com.au/descriptive-essay-about-the-beach/ descriptive essay about the beach While the Actionscript test class was:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package
{
    import flash.display.Sprite;
    import flash.net.NetConnection;
    import flash.net.ObjectEncoding;
    import flash.net.Responder;
    import flash.utils.ByteArray;

    public class test extends Sprite
    {
        private var nc: NetConnection;
        private var rsp: Responder;

        public function test()
        {
            rsp = new Responder( onResult, null );
            nc = new NetConnection();
            nc.objectEncoding = ObjectEncoding.AMF3;
            nc.connect( "http://localhost/amfphp/trunk/gateway.php" );
            nc.call( "test.bytearray.Service.getArray", rsp );
        }

        private function onResult( e: * ): void
        {
            if ( e is Array )
            {
                for each ( var b: ByteArray in( e as Array ) )
                {
                    trace( 'reading bytearray...' );
                    b.position = 0;
                    trace( b.readUTF() );
                }
            }
        }
    }
}

levitra online sales After some investigation I found that the error was into the AMFSerializer.php file in the writeAmf3ByteArray method which doesn’t reference correctly the bytearray objects.

http://www.visiteday.com/?custom-writingorg-review custom-writing.org review Thus I made a little modification and after that I succeeded to retrieve correctly the bytearray list ( with the 3rd element as reference of the first one ).

custom reasearch essay Here you can download the patch file, if you want to test the modification ( at your own risk 🙂 ). The patch has been created using the last svn version of amfphp and you can apply the patch with the following command:

1
patch -p0 -i bytearray.patch

AMF news coming?

help write term papers Today I’ve read a couple of guys who posted about the new Ted’s post on his blog.
Nothing new about Ap World History Change Over Time Essay amf, just some “best practices” on how to save using writeObject and readObject ByteArray’s methods.

http://www.greedyrooster.it/how-to-write-a-postgraduate-dissertation-proposal/ how to write a postgraduate dissertation proposal But what caught my attention was the last sentence in his post:

homework help logarithms “There is some big AMF news coming in December…. :)”

no home work Damn, This is cool!
Does anyone know anything about this? I can’t wait!

AMFPHP and mbstring

http://seattlebusinesscapital.com/dissertation-abstracts-online-university-microfilms/ Dissertation Abstracts Online University Microfilms These days I was working on a flex 2/amfphp project and I discovered a very strange issue accidentally.
With PHP 5.2.4 installed both on local and remote server, the local amfphp works and the remote gave errors.

Dissertation Writing Assistance Where To Start Connecting to the service browser I was receiving the error “Channel.Ping.Failed” error and investingating a bit more in the fault message I discovered that the source error was:

Essay My Best Friend The class {Amf3Broker} could not be found under the class path {/var/htdocs/amfphp/services/amfphp/Amf3Broker.php}

http://fullyfurnishednyc.com/proquest-dissertation-express/ Proquest Dissertation Express and the Amf3Broker php class does not exists anywhere in amfphp! But in the Actions.php file on line 78 I found this:

1
2
3
4
5
6
7
if(!$handled)
{
$uriclasspath = "amfphp/Amf3Broker.php";
$classpath = $baseClassPath . "amfphp/Amf3Broker.php";
$classname = "Amf3Broker";
$methodname = "handleMessage";
}

That’s the strange thing because the $handled variable should be true ’cause usually the first request sent by flash is a Thesis On A Law Research Paper $messageType = “flex.messaging.messages.CommandMessage”. So I continued in my investigation logging all the messages that php was receiving.
So at the end I discovered that amfphp didn’t deserialize the amf data correctly! All the packet were corrupted (that’s why $messageType wasn’t handled), all the strings were not correctly parsed.
Finally I discovered the reason. It’s because mbstring.
The only difference between the remote server and the local server is the php.ini setting about mbstring overload and the others mbstring settings.
The remote server has mbstring.func_overload = 2, that means all the strings functions are affected and that’s why the amfphp methods were returing corrupted data.
In fact I just changed this method into AMFDeserializer.php:

1
2
3
4
5
6
function readBuffer($len)
{
$data = substr($this->raw_data,$this->current_byte,$len);
$this->current_byte += $len;
return $data;
}

into:

1
2
3
4
5
6
7
8
9
10
function readBuffer($len)
{
$data = "";
for($i = 0; $i < $len; $i++)
{
$data .= $this->raw_data{$i + $this->current_byte};
}
$this->current_byte += $len;
return $data;
}

and the original error disappeared! Obviously I got other errors later, that’s because there are many other string functions in amfphp.. but at least I found the cause.

In fact, removing the mbstring.func_overload in the php.ini everything worked again!

AMFPHP 1.9 beta 2 – so fassssssst

On 26th January Patrick posted about the new amfphp beta which, thanks to the Emanuele Ruffaldi‘s php module (you can get the binary and source files here), seems to be “ridiculously faster“.

I had 5 minutes today for testing it. Just a simple test with an array of 1,000 objects and using ServiceCapture in background to see the performance differences between the older amfphp version and this one.
The new amfphp version gave me these results (I has to say I had many other programs running in background…):

Type: amf
This request bundled all of the following service calls:
amfphp.getList()
Request: 697 bytes
Response: 15968 bytes
Total: 16665 bytes
Response Time: 0.19 seconds

while the older one:

Type: amf
This request bundled all of the following service calls:
amfphp.getList()
Request: 697 bytes
Response: 16967 bytes
Total: 17664 bytes
Response Time: 0.541 seconds

So, incredible faster 🙂
This new beta comes with onther features such as gzip support, better recordset support and ByteArray support… but I strongly suggest to read the full article on Patrick’s blog here:
http://www.5etdemi.com/blog/…/amfphp-19-beta-2-ridiculously-faster/

AMFPHP 1.9 changes and future plans

Recently Patrick released a new testing version of AMFPHP which supports the Flex2 AMF3 object encoding.

Some changes:

http://suffahwelfaretrust.com/dissertation-toute-lecture-est-elle-enrichissante/ dissertation toute lecture est elle enrichissante $this->methodTable is DEAD. All methods in /services are now considered remotely accessible, unless you set them to protected or private (PHP5) or start the method name with an (_)
– Returning a http://talkingtech.net/apa-papers-assistance/ apa papers assistance mysql_query will now return either an Array or an ArrayCollection depending on the setting in gateway.php
– browser now brings up the brand spanking new Flex 2-based service browser

This is a testing version since it has still a lot of limitations and it has been tested only on PHP5. I see the post today and I haven’t tested yet…
You can read here for a detailed list of changes

Moreover Patrick plans to add to amfphp the Flex Data Services (read what they are). In this post he got a brief explanation about flash player/FDS communication and ask for developers to help him with the developement of FDS in amfphp (you might need a copy of charles).

AMFPHP 1.2 released

It’s not really a today news, in fact Patrick released the new version of AMFPHP on 26 of February, but I was so busy in the last weeks…
There’s a really improved service browser, here you can see a live demo, where you can test directly your methods via the web interface.
There is a final note of the author about this release:

A word of caution: I have fixed a bug with sql adapters which may have introduced some other issues. As I only have access to MySQL, these changes are largely untested except for the mysql adapter, so if you use another database, please test your functions using the service browser and report any issues my way.

http://sourceforge.net/project/showfiles.php?group_id=72483