Archived
This forum has been archived. Please start a new discussion on GitHub.
Glacier2 with PHP
Hi,
Is it possible (in an easy manner) to connect to glacier2 with username/password from the PHP bindings? getDefaultRouter() seems to be missing.
Is it possible (in an easy manner) to connect to glacier2 with username/password from the PHP bindings? getDefaultRouter() seems to be missing.
0
Comments
-
Hi Thorvald
You can connect to Glacier2 from php, but session would expire with each request as the connection could not keep open in php.
For configure the default router you could use "Ice.Default.Router" property.
You need something similar this code with normal Exception handling for php$router = $this->ice->propertyToProxy("Ice.Default.Router"); $router = $router->ice_uncheckedCast("::Glacier2::Router")->ice_router(null); $session = $router->createSession($username, $password);
Regards,
José0 -
Explicit router
Hi,
Instead of using a default router, I'd rather specify the router in the php since that avoids using the same router for the entire profile.
I had to fix a small bug in $obj->ice_router() in Ice-3.3.0 (patch appended); I'm not sure if it was in the patches yet or not, but at least it's not in the RPMs and had me stumped for a while
Anyway, I still have the problem that if I have a method on the server that returns a proxy (pointer to another instance), that proxy will get the default (null) router in the client.
For example:$s = $meta->getServer();
Here $meta is a proxy for a remote object (as is $s). Before I can use $s, I have to do the equivalent of$s->ice_router($meta->ice_getRouter());
Is there a way to specify on the server that it should return a proxy with the same routing/whatever that was used to reach the method that returns the proxy?0 -
I had to fix a small bug in $obj->ice_router() in Ice-3.3.0 (patch appended); I'm not sure if it was in the patches yet or not, but at least it's not in the RPMs and had me stumped for a whileIs there a way to specify on the server that it should return a proxy with the same routing/whatever that was used to reach the method that returns the proxy?
Take care,
Mark0