Hi Harris,

Glad to know that those info are useful to you.

My possible solution, which might not be the perfect one is:
1. There's only one local.php - and you may be able to register only one set
of services.
2. In the registered service, you may like to dispatch the requests
according to their containerId parameter, which is embedded in the security
token, pseudo-code as following:

*function DispatcherPeopleService() {
  if (containerId == "SNS_alpha") {
    // call sns_alpha's people service
  } else if (containerId == "SNS_beta") {
    // call sns_beta's people service
  } ... {
    // default handler
    // or, you may like to register all the services into an array, and call
it:
    // call_user_func(peopleServices[containerId], ...);
  }
}
*
Regards,
Jacky

On Wed, Mar 31, 2010 at 1:56 AM, Harris Wong <[email protected]>wrote:

> Thanks for the replies.  I would like to know more about the PHP one
> shindig, multiple sns schema.
>
> Jacky, I have a few questions and hoping if you can help me.  I have setup
> shindig/ with the default container.js, and my local.php is like how you
> described in your step2.  My "local.php" points to my social site's service
> classes.  Let's call this social site "SNS_alpha".  As a result, the Gadget
> on SNS_alpha will request people/activity data from shindig, which runs the
> local.php service classes, and return SNS_alpha's social data.  This works
> fine.
>
> Now, I have another installation of this SNS, let's call it SNS_beta.  My
> question is how do I include more than one service classes from 1+ location
> in the $shindigConfig array?  My understanding is local.php can only point
> to one container?  If so, how do I have multiple "local.php"?
>
> Any help is appreciated.  Thanks again!
>
>
>
>
>  To my understanding, PHP impl supports "one shindig, multiple SNS" schema
>> as
>> well:
>>
>> 1. Under directory //config, creates myContainer.js and specify the SPI
>> paths;
>> 2. In //php/config/local.php, developers could specify the concrete
>> services
>> which implemented people/activity APIs.
>> 3. In the concrete service, the requests can be distinguished with each
>> other by the "containerId" part encapsulated in the security token.
>> Developer may like to re-distribute the request to the specific SNS
>> handler.
>> 4. For the security token part, developer may like to apply different
>> algorithm/key according to the "containerId" parameter.
>>
>> It's just my roughly understanding.  Please feel free to correct me.
>>
>> - Jacky
>>
>> On Tue, Mar 30, 2010 at 5:05 AM, Kevin Brown<[email protected]>  wrote:
>>
>> >  I dunno about the PHP impl, but the Java impl is explicitly designed
>> for
>> >  such uses -- this is where the idea of "container configuration files"
>> >  comes
>> >  from.
>> >
>> >  On Mon, Mar 29, 2010 at 12:47 PM, Harris Wong<[email protected]
>> >  >wrote:
>> >
>> >  >  Hi all,
>> >  >
>> >  >  According to
>> >  >
>> >
>> http://www.mail-archive.com/[email protected]/msg11731.html
>> >  ,
>> >  >  I can host multiple social sites on 1 shindig.  Within
>> >  >  shindig/php/config/local.php, I can specify the SPI paths and the
>> >  >  extension_class_paths.  However, those are hardcoded on the shindig
>> >  server.
>> >  >   How do I dynamically load the local.php based on the requested
>> server?
>> >  >  ie.
>> >  >  http://al...@server_1 ->  shindig ->  loads Server_1's local.php ->
>> >  returns
>> >  >  Server_1 data (alice's friends)
>> >  >  http://j...@server_2 ->  shindig ->  loads Server_2's local.php
>> ->returns
>> >  >  Server_2 data (joe's friends)
>> >  >
>> >  >  My situation now is,
>> >  >  http://al...@server_1 ->  shindig ->  local.php ->  returns
>> Server_1 data
>> >  >  (alice's friends)
>> >  >  http://j...@server_2 ->  shindig ->  local.php ->  returns Server_1
>> data
>> >  >  (alice's friends)
>> >  >
>> >  >  Thanks!
>> >  >
>> >  >
>> >  >  Regards,
>> >  >  Harris Wong
>> >  >
>> >  >  --
>> >  >  Harris Wong
>> >  >  Accessible Software Developer
>> >  >  Adaptive Technology Resource Centre, University of Toronto
>> >  >  130 St. George Street
>> >  >  Toronto, ON, M5S 1A5
>> >  >
>> >  >
>> >
>>
>>
>>
>> --
>> Best Regards,
>>
>> Jacky Wang
>> (Office) +86-10-6250-3316
>> (Mobile) +86-1381-0018-677
>> Kejian Building, Tsinghua Science Park Building 6
>> No.1 Zhongguancun East Road, Haidian District
>> Beijing P.R.China 100084
>>
>>
>>
>


-- 
Best Regards,

Jacky Wang
(Office) +86-10-6250-3316
(Mobile) +86-1381-0018-677
Kejian Building, Tsinghua Science Park Building 6
No.1 Zhongguancun East Road, Haidian District
Beijing P.R.China 100084

Reply via email to