Microsoft introduced a new protocol for the data they put in the Azure cloud. It is called “OData”. MS also published some client and server tools to consume and produce OData (see: http://odataphp.codeplex.com/ ). The PHP consumer for OData has some trouble with non Windows systems. That’s strange because the doc’s for the tool say it should run on all platforms. The problem is with Windows specific slashes in the PHP source. To fix this make some changes in the files:
Action: change all the slashes in the “require_once” part
1 2 3 4 5 6 7 8 9
require_once 'ResourceMessages.php'; require_once 'CommonCollection.php'; require_once 'WebUtilHttpVerb.php'; require_once 'WebUtilHttpRequest.php'; require_once 'WebUtilMicrosoft_Http_Response.php'; require_once 'WebUtilHttpResponse.php'; require_once 'CommonHttpProxy.php'; require_once 'ExceptionACSUtilException.php'; require_once 'ExceptionInvalidOperation.php';
1 2 3 4 5 6 7 8 9
require_once 'Resource/Messages.php'; require_once 'Common/Collection.php'; require_once 'WebUtil/HttpVerb.php'; require_once 'WebUtil/HttpRequest.php'; require_once 'WebUtil/Microsoft_Http_Response.php'; require_once 'WebUtil/HttpResponse.php'; require_once 'Common/HttpProxy.php'; require_once 'Exception/ACSUtilException.php'; require_once 'Exception/InvalidOperation.php';
File: PHPDataSvcUtil.php line 129
Action: change “\” into “/”
"\" . $this->_getFileName());
"/" . $this->_getFileName());
If you installed the OData PHP consumer according to the readme, then you should be able to generate a proxy file with a command like this:
– Open a Terminal
– Go to you OData dir (where PHPDataSvcUtil.php lives)
– Type: php PHPDataSvcUtil.php /uri=http://odata.netflix.com/Catalog
– Or if you are behind a proxy: php PHPDataSvcUtil.php /uri=http://odata.netflix.com/Catalog /ph=proxyserver /pp=8080
(Change “proxyserver” for your proxy server and “8080” for your proxy port)
The parameter “/out” also has a problem. That has not been fixed with these changes. Just generate the proxy in the current dir 🙂
Why don’t you submit this change to the original project? This way, everyone would benefit from it.
Thanks for your comment.
As the bug has been known to the authors since april 2010 (the date of the first review on the PHP client that mentions this bug) it looks like putting it on this website reaches more people. Putting it on the PHP client website does not seem to help.
But of course there is no harm in uploading the partial (this code only fixes part of the bugs) bugfix to the source repository. Do you have some guidance how to upload the fixes to the source control system? You are a Microsoft employee, so i guess you know how to upload sources to the PHP client source repository. A bit of help with that would be great.
Thanks in advance.