Flex and PHP Together with Midnight Coders WebORB

Send to friendPrinter-friendly version

The Midnight Coders updated their release of WebORB for PHP last week. This new release, v. 2.0, adds a number of awesome features for PHP developers. There's a Flex based console that includes a service browser, as well as a number of useful examples, showing both the client side code (in Flex) and server side code in PHP. The getting started guide (again, built into the console or available on the web) provides a good tutorial for creating your first WebORB powered application.

However, one of the things that I don't like about the existing documentation is that it prompts you to use Flex Data Services when starting up a new project. I spoke to Mark Piller from Midnight Coders last week, and it turns out you don't need to do that. You can start up a new Flex project, and just like with AMFPHP you can create a services-config.xml file that you can put into the root of your project. I've created a sample services-config.xml file for WebORB. Put this in the root of your Flex project, modify the URL of the endpoint URI to point to your installation of Weborb, and add the line -services "services-config.xml" to the Flex compiler. To me this is much easier than the documented method, although more experienced Flex developers may disagree.

If you're building Flex based PHP solutions, check out WebORB for PHP. Now that Patrick Mineault has retired from the AMFPHP project, this appears to be the best solution for PHP developers looking to get started with Flex.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

WebOrb 2.0 is better but still slow when you compare with AMFPHP

Hello Mike,

WebOrb 2.0 is better but still slow when you compare with AMFPHP.

I think Mark and his team must to working in it.

sorry that AMFPHP is alone, and look like in future died.

Tom,

We won't let AMFPHP die

It's true that Patrick is retiring. It's also true that Patrick is a great developer... almost irreplaceable. But AMFPHP is an open-source project, and as long as there is an open-source community out there (www.osflash.org) i doubt AMFPHP will die. We have been discussing this subject on the amfphp mailing list: http://sourceforge.net/mailarchive/forum.php?forum_name=amfphp-general . I think that it would help if everybody who uses and cares about AMFPHP could give it's opinion on the AMFPHP mailing list, and maybe offer some help. :)

A word on services-config.xml

Thanks for sharing!
And just like with amfphp, you don't actually need the services-config.xml file neither. Just specifying the endpoint and destination in a RemoteObject Tag is enough. I guess this is pretty obvious but it wasn't for me at first ;)

mikepotter's picture

That's great

Hey, that's great. I actually didn't know that. Neat. I'll publish an example shortly.

Mike

when specifying endpoint and

when specifying endpoint and destination without using a services-config.xml file, the destination can be any arbitrary string. so why is it even needed?

and anyone know the difference between mx.rpc.remoting.RemoteObject and mx.rpc.remoting.mxml.RemoteObject? you can programatically specify endpoint when using mx.rpc.remoting.mxml.RemoteObject; but not with mx.rpc.remoting.RemoteObject;.

Flex weborb without data services

Hi

Thanks for the e-Seminar on Flex and php!

you wrote that it is possible to use weborb without the Flex Data services (if I understood correctly) and that one needs to-

"...add the line -services "services-config.xml" to the Flex compiler."

Can you please explain how this is done?
(I'm a newbe with Flex & I'm using the Flex builder)

Thanks :)

Paul

compiler settings in Flex Builder 2

Hi,

to add compiler settings in Flex Builder is easy. You select your project, go to it's Properties and there to the point "Flex Compiler". On the right side you have then an field where you can add additional compiler settings.

Philipp

this requires to modify weborb code...

By playing a little with the solution you explain (and I agree to say it is better), I've noticed a few dysfunctions...
as weborb doesn't use the root remote-config.xml but only the file in WEB-INF/flex...

ORBConfig.php has to be modified this way :

public function getFlexConfigPath()
{
//return WebOrb . "WEB-INF" . DIRECTORY_SEPARATOR . "flex" . DIRECTORY_SEPARATOR;
return ".." . DIRECTORY_SEPARATOR;
}

to force weborb to read the right remote-config.xml file.

Moreover, it implies remote-config.xml and services-config.xml can not be merged into the same file, as you did, because weborb setup is done by reading remote-config.xml only.

Now, it works : I have xml config files at root directory, have removed 'WEB-INF/flex', and don't need anymore a weborb.php on project root directory. No more FDS project to make weborb work ! Thanks for having given this solution !

(btw, I would like to know how this could be done by only setting up RemoteObject destination, as it is said here... I have been unable to make it work this way.)

this requires to modify weborb code...

By playing a little with the solution you explain (and I agree to say it is better), I've noticed a few dysfunctions...
as weborb doesn't use the root remote-config.xml but only the file in WEB-INF/flex...

ORBConfig.php has to be modified this way :

public function getFlexConfigPath()
{
//return WebOrb . "WEB-INF" . DIRECTORY_SEPARATOR . "flex" . DIRECTORY_SEPARATOR;
return ".." . DIRECTORY_SEPARATOR;
}

to force weborb to read the right remote-config.xml file.

Moreover, it implies remote-config.xml and services-config.xml can not be merged into the same file, as you did, because weborb setup is done by reading remote-config.xml only.

Now, it works : I have xml config files at root directory, have removed 'WEB-INF/flex', and don't need anymore a weborb.php on project root directory. No more FDS project to make weborb work ! Thanks for having given this solution !

(btw, I would like to know how this could be done by only setting up RemoteObject destination, as it is said here... I have been unable to make it work this way.)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.