Over the last couple of weeks I have been doing quite a bit of work on the PHP RedBack Gateway. At this stage most functionality is working and is working quite well.
The best thing that I have done is that it can now communicate directly with the RedBack Object Server, and the best thing is that it is still 100% PHP. I have not had to do what I thought I was going to need to do and create an extension for my c library to get faster access.
I have been done some testing and from what I can tell it is pretty lean and mean. The most of the time is spent talking to the RBO Server and not the internal processing of the data within the object.
If anyone is interested please contact me at gordon@heydon.com.au
Since LCA when I went to a session with Rasmus Lerdorf (The creator of PHP) and showed some really cool things with php5 objects, I have been busy in my spare time creating the redback gateway for php.
At this stage it only works through the rgw cgi gateway. But it will work with librbo some day as well. This will mean that it will be as deployable as possible, and the only php extension that you require is the socket interface.
Now as I suspected and the method that I implemented the handling of multi values it just works. I is some much easier to use that the asp or jsp gateways.
The method that the properties and methods are exposed to php it looks like a native object. So in asp it would be accessed like so.
<%
rbo("EmpId").value = '1002'
rbo.CallMethod("ReadData")
%>
and in jsp like this.
<%
rbo->setproperty('EmpId', '1002');
rbo->callmethod('ReadData');
%>but in php it is like this.
<?php
$rbo->EmplId = 1002;
$rbo->ReadData();
?>
This is really cool. The supprising thing is that I think it is faster the the asp gateway even though I am just
Well, I haven't been doing too much on librbo, I started looking at creating a binding to php, but I have run into a few problems. I have gotten myself a book, but I haven't had too much time to proceed.
One thing that I have been going to investigating how to implement this, and one thing that I want is to make this as deployable as possible. So by creating an extension for php is going to make it a little dificult to create a connection with most hosting companies. In realising this I decided that I would create an object in php where initially I would do with a dependance on the curl extension, and then later add an interface using the socket extension if the curl extension is not there.
I will model the object on the redbeans object but make it smart enough so that if you have the librbo extension it will use that or it will down size to using curl or the socket interface.
The major advantage that this will have over any of the other interfaces that are available for RedBack, is that I will be making use of php arrays, and nested arrays.
An example of this would be:-
VAR<1,1> = $VAR[0][0]and I hope to expand the setProperty() so that you can pass an array of values and they will get set into properites in 1 go. This means that an input form can be posted to any array, and straight into RedBack
One thing I would like to know is if there is anyone wanting to use php to access RedBack, please contact me, and I will then raise the priority to get it done.
well I have been working really hard on librbo, and yesterday I completed the alpha version. Basically it works from end to end and can do everything that you can do in asp and jsp.
some of the features include
So basically the feature set is more or less complete and I am starting to work on the php binding so that I can reproduce all the functionality that is currently in asp or jsp.
At this stage it is still very alpha, I wouldn't want to push it too hard, but once I have the binding for php working I will go back and see if I can improve some of the areas in librbo and make it alot more bullet proof.
If there is anyone interested in thisjust email me, and I will see what I can do.
Since my last post on my little project I have had some developments, The first is that I changed direction and started using the redbeans protocol, which is some what undocumented, but was not that hard to fill in the blanks.
The biggest change is not only the name, but as it says it is now a shared library which will allow any application to talk to redback. Out of this will then come firstly the php extension and a few tools, such as a php version of rboscope and a php gateway, for development via the RBODesigner.
One problem that I have come to realise is that I may not be abke ti just release this code as GPL as I hoped. Unforcantly the more I think about this I feel I have a conflict of interest with my place of work and our relationship with IBM U2. Even though I wrote 100% of the code, I feel that I need to get premission from my place of employment before I release it. I just need to build a business case to prove that it is in there best interest to release this.
I am going to be continuing development no matter what, as this will mean that I can stop having to develop in ASP, but do it in php, which is far more enjoyable.
Well, I was going to use libcurl and libxml2 to create a gateway to redback from php. but while I was doing some work for a client and I uped the logging to display the data that was received and transmitted so I could see what the SOAP client was sending me, I was nicely surprised to see that it did thisfor the redbeans protocol as well. So I was able to reverse engineer the protocol in a few minutes.
So with a little more testing I will now use the redbeans protocol, instead of the SOAP on as it is alot more simpler and also helped me understand why some data doesn't got thru the redback interface.
Because I seem to have quite a few people using my little projects and some of them would like to send me something to thank me for the work, I have set up a wish list at a amazon.com.
It is not required and I do not expect anyone to do this as I do this mainly because I like doing it, and it is a good distraction. but I am also willing to work something out for particular modification to any of my projects.