New version of SWX released - supports PHP 4

Update #2: SWX Alpha 0.1d is now available for download.

What's new in Alpha 0.1d:

  • Fixed bug with the SWX gateway that threw script errors for incorrectly formed requests. This bug was introduced with the addition of GET functionality in 0.1b.

What's new in Alpha 0.1c:

  • The example FLA is now saved in a format that can be read by Flash 8 (oops, sorry + thanks Paddy for alerting me to this!)

What's new in Alpha 0.1b:

  • PHP 4 and PHP 5 support. Tested with PHP 4.4.2 and PHP 5.1.4
  • Added GET support to the gateway. You can now call the gateway with both POST and GET

This release brings PHP 4 support to SWX. I've only tested it with 4.4.2 and 5.1.4 so if you do test with a different version of PHP, please let me know how it goes.

Download SWX Alpha 0.1b from the download page at swxformat.org.

6 Responses to “New version of SWX released - supports PHP 4”


  1. 1 paddy

    Hi Aral, as many others have said thanks for a great talk last night! I can’t help thinking that SWX just feels inherently right. using php to talk to php and swfs to talk to swfs has a beautiful feel to it. Never being very good with languages ( I had to give up French to do extra English) I love the idea of communicating in native tongue. It does seem like a potential generator-esque comeback.

    When optimisation is complete it would be great to see some performance/benchmark tests against other technologies like Remoting to see who wins the data race.
    Someone mentioned this won’t work off-line. I though of this too. Most of the projects we work on are for on-line deployment. However we’re often asked to supply demos that work offline for client conferences or we may need to supply the project to be deployed on the clients servers rather than our own. In which case we tend to use XML to transfer data as working with client tech teams is a whole different kettle of fish, my experience is supplying them with an xml schema and hand over responsibility as to how they implement it the safest. Any way back to point - What’s stopping the development of a project in an on-line environment. Then setting up a ‘SWX publish’ feature that saves the .swfs to file. You can then package them up for offline deployment (these .swfs could always be obfuscated for ADDED security too if need be!). I’d imagine having a little utils class that checks internet connectivity, if on - loads via SWX, if down - load .swfs locally (or having a flashVar/config file telling project how to load data.) This might be an advantage over Remoting which is a server side technology only. Also from what I understood from the talk last night there was mention of allowing the developer to decide how to expose the data? i.e. you could use the same framework to serve up the data as xml/JSON (love the logo http://www.json.org/, slightly less scary than datum ;)) if need be without having to re-write all the serve side code. is that right?
    One thing I love about amfphp is the methods browser. it’s a great way to show what data needs to be supplied to a method and what it returns. I know it’s ‘Bad’ but I never tend to bother with VO objects. just load the data in and stick it straight in a model. I rely on documentation and this browser to help explain data structure for debugging. It would be great to have a similar feature in SWX. I don’t think the analyser will allow quite the same browsing faculties for data requests.

    I know at the moment SWX is only meant to transfer Objects,Array,Strings,Booleans,Null (data) but as someone also said why not also have the ability to sent back an actual image? Is this feasible? This could be particularly useful if AS3 is ever implemented with it’s ability to re-parent the display list. but that might be another tangent… amazing to see what you’ve done in 2.5 weeks!

    Last thing I can’t open the examples/echo.fla any chance of saving it as a flash 8 file for the less fortunate amounts us who aren’t on the flash 9 beta, best p ;)

  2. 2 aral

    Hi Aral, as many others have said thanks for a great talk last night!

    Thanks, man. It was a lot of fun for me too.

    I can’t help thinking that SWX just feels inherently right. using php to talk to php and swfs to talk to swfs has a beautiful feel to it.

    Thank you! That’s exactly how I feel about it as well :)

    When optimisation is complete it would be great to see some performance/benchmark tests against other technologies like Remoting to see who wins the data race.

    I will definitely carry these out in due course — perhaps even as early as the beta stage but for me, the most important thing is the simplicity of it. Of course, that doesn’t mean that I’m not going to optimize it as much as I can.

    Someone mentioned this won’t work off-line . . . What’s stopping the development of a project in an on-line environment. Then setting up a ‘SWX publish’ feature that saves the .swfs to file.

    Nothing, actually. As of Alpha 0.1b, I’ve added the ability to do this by supporting GET requests. Now you can use a browser to hit the SWX gateway and you’ll get the SWF returned to you.

    Here, try it out: Click this link and look in your downloads panel.

    Now, if you open the Analyzer in the Standalone Flash Player and open the SWF you downloaded in the Standalone Flash Player too, you’ll see the data that was returned in the Analyzer.

    You can then package them up for offline deployment (these .swfs could always be obfuscated for ADDED security too if need be!). I’d imagine having a little utils class that checks internet connectivity, if on - loads via SWX, if down - load .swfs locally (or having a flashVar/config file telling project how to load data.) This might be an advantage over Remoting which is a server side technology only.

    Good ideas, all — I can’t wait to see what creative uses people find for it.

    Also from what I understood from the talk last night there was mention of allowing the developer to decide how to expose the data? i.e. you could use the same framework to serve up the data as xml/JSON (love the logo http://www.json.org/, slightly less scary than datum ) if need be without having to re-write all the serve side code. is that right?

    Yes. Basically, you only write your service classes once. These classes have methods that return PHP data structures (this can be an array or an array of objects, etc.) These are the methods that you call from Flash via SWX.

    So once you have these service classes, if you hit the SWX gateway, you will get your data in a SWX SWF. If, however, you have Amfphp installed also (and SWX will contain Amfphp in the bundle packages), you can hit the Amfphp remoting gateway instead and get your data via Remoting. If you hit Amfphp’s JSON gateway, you get the results as JSON. Finally, you will be able to easily create XML versions of your methods too so you can expose them that way too if you want. So you can write a single service class and then hit it via SWX, remoting, JSON or XML. Pretty sweet, no? :)

    One thing I love about amfphp is the methods browser. it’s a great way to show what data needs to be supplied to a method and what it returns . . . I rely on documentation and this browser to help explain data structure for debugging. It would be great to have a similar feature in SWX.

    Feature request noted. I don’t think it should be difficult at all to incorporate that functionality into SWX. Great suggestion! I’ll put it on the roadmap. :)

    I know at the moment SWX is only meant to transfer Objects,Array,Strings,Booleans,Null (data) but as someone also said why not also have the ability to sent back an actual image? Is this feasible?

    It’s feasible but whether or not it’s desirable is another question. At the moment, I don’t think this feature would be on the roadmap for SWX. It’s not meant to be a general Generator clone (there are couple already that do this, like JGenerator and you can actually do this with Swfmill also.) SWX is about simple data exchange. I’m going to concentrate on making it do that really well!

    but that might be another tangent…

    Definitely sounds like it! ;)

    amazing to see what you’ve done in 2.5 weeks!

    Thanks, man! :)

    Last thing I can’t open the examples/echo.fla any chance of saving it as a flash 8 file for the less fortunate amounts us who aren’t on the flash 9 beta

    Oops! Well, during the course of writing you this reply, I’ve put out two new releases (so it’s been very helpful!) The current alpha is 0.1d. Please let me know if you experience any issues with it and thanks again for taking the time to write such an in-depth comment and provide such useful feedback and suggestions.

  3. 3 jack

    its really ossum, i am so happy

  4. 4 Kosso

    HI Aral,

    I’m really disappointed to have missed the FPUG meetup/talk the other night to to injury.

    This sounds like a great a really interesting idea. I constantly get flash talking to stuff via PHP, so I’m going to dig deeper.

    I have loads of easy data to play with at http://podcast.com where I’m CTO (and the sole ‘createc’ too at the mo.) all in OPML and RSS for now, with an API to come.

    Every night I dream of a new Flash UI to it. Maybe I’ll try some Apollo too, to make a podcatcher, or some such other widgetty thing.

    Cheers! Lovin’ your work!

    kosso
    (twitter.com/kosso)

  5. 5 aral

    Sounds great, Kosso, and I hope that you’re feeling better. Looking forward to seeing your experiments. And, do let me know when your APIs are up.

  6. 6 CS

    hi,

    This sounds like a great a really interesting idea. I constantly get flash talking to stuff via PHP, so I’m going to dig deeper.

    i like this site ;)

Leave a Reply






Bad Behavior has blocked 0 access attempts in the last 7 days.