Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 09-08-2008
trivian trivian is offline
Registered User
 
Name: Thorvald Natvig
Organization: Mumble
Project: Mumble
 
Join Date: Jun 2008
Posts: 13
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.
Reply With Quote
  #2 (permalink)  
Old 09-08-2008
xdm's Avatar
xdm xdm is offline
ZeroC Staff
 
Name: José Gutíerrez de la Concha Martínez
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Sep 2003
Location: La Coruña, Spain
Posts: 299
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
Code:
$router = $this->ice->propertyToProxy("Ice.Default.Router");
$router = $router->ice_uncheckedCast("::Glacier2::Router")->ice_router(null);
$session = $router->createSession($username, $password);
Regards,
José
Reply With Quote
  #3 (permalink)  
Old 09-08-2008
trivian trivian is offline
Registered User
 
Name: Thorvald Natvig
Organization: Mumble
Project: Mumble
 
Join Date: Jun 2008
Posts: 13
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:
Code:
$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
Code:
$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?
Attached Files
File Type: txt icephpproxy.txt (467 Bytes, 35 views)
Reply With Quote
  #4 (permalink)  
Old 09-08-2008
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 976
Quote:
Originally Posted by trivian View Post
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
Thanks for the patch, we'll fix this for the next release (along with a similar bug in ice_locator).
Quote:
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?
No, there's no way to do that. The router is a strictly local configuration that is not included in a proxy's marshaled form.

Take care,
Mark
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and Glacier2 Problem neons Help Center 2 12-30-2007 11:50 PM
2 .Ice in php cesartovic Help Center 11 12-20-2007 04:30 AM
Ice Php mahmoodlebbai Help Center 7 06-22-2006 06:17 AM
Icepack and PHP sac_urs Help Center 4 11-02-2005 12:53 PM
somebody can help me ! it's php wrong! it's really php wrong! damingyipai Help Center 0 07-28-2004 06:16 AM


All times are GMT -4. The time now is 11:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.