You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Reema Sardana <re...@google.com> on 2008/08/03 07:40:57 UTC
php/gadgets Missing
Hi,
I just build the Shindig PHP Server. From the instructions and the
README at http://incubator.apache.org/shindig/#php, I see that I
should expect a directory called 'gadgets' under shindig/php/ but I do
not see 'gadgets' in
http://svn.apache.org/repos/asf/incubator/shindig/trunk/php/
Am I missing something?
Thanks,
- Reema
Re: php/gadgets Missing
Posted by Reema Sardana <re...@google.com>.
Hey Chris,
Thanks a lot for the info. AllowOverride was set to 'None' in my web
server settings and hence the rewrite engine was not enabled. Works
now. :-)
Regards,
- - Reema
On Sun, Aug 3, 2008 at 1:08 AM, Chris Chabot <ch...@xs4all.nl> wrote:
> Hey Reema,
>
> No your not missing anything, what happens is that through something called
> 'mod_rewrite', all the URL's are redirected to /index.php, which then maps
> the request URL to an class.
>
> You can find the url rewriting rules in the shindig/php/.htaccess file:
> <IfModule mod_rewrite.c>
> RewriteEngine On
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule (.*) index.php [L]
> </IfModule>
>
> And the url => class mapping in index.php:
> $servletMap = array(
> Config::get('web_prefix') . '/gadgets/files' =>
> 'FilesServlet',
> Config::get('web_prefix') . '/gadgets/js' => 'JsServlet',
> Config::get('web_prefix') . '/gadgets/proxy' =>
> 'ProxyServlet',
> Config::get('web_prefix') . '/gadgets/makeRequest' =>
> 'ProxyServlet',
> Config::get('web_prefix') . '/gadgets/ifr' =>
> 'GadgetRenderingServlet',
> Config::get('web_prefix') . '/gadgets/metadata' =>
> 'JsonRpcServlet',
> Config::get('web_prefix') . '/social/rest' => 'RestServlet',
> Config::get('web_prefix') . '/public.crt' => 'CertServlet'
> );
>
> So if you'd hit /gadgets/ifr?url=<gadget url>, then that request gets
> redirected to /index.php, which then loads the GadgetRenderingServlet class
> (which is located in
> shindig/php/src/gadgets/http/GadgetRenderingServlet.php) and then executes
> it.
>
> It's a pretty standard way of doing 'pretty URL' mapping in PHP, so nothing
> special really :-)
>
> Hope that clears things up!
>
> -- Chris
>
> On Aug 3, 2008, at 7:40 AM, Reema Sardana wrote:
>
>> Hi,
>>
>> I just build the Shindig PHP Server. From the instructions and the
>> README at http://incubator.apache.org/shindig/#php, I see that I
>> should expect a directory called 'gadgets' under shindig/php/ but I do
>> not see 'gadgets' in
>>
>> http://svn.apache.org/repos/asf/incubator/shindig/trunk/php/
>>
>> Am I missing something?
>>
>> Thanks,
>> - Reema
>
>
Re: php/gadgets Missing
Posted by Chris Chabot <ch...@xs4all.nl>.
Hey Reema,
No your not missing anything, what happens is that through something
called 'mod_rewrite', all the URL's are redirected to /index.php,
which then maps the request URL to an class.
You can find the url rewriting rules in the shindig/php/.htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php [L]
</IfModule>
And the url => class mapping in index.php:
$servletMap = array(
Config::get('web_prefix') . '/gadgets/files' =>
'FilesServlet',
Config::get('web_prefix') . '/gadgets/js' =>
'JsServlet',
Config::get('web_prefix') . '/gadgets/proxy' =>
'ProxyServlet',
Config::get('web_prefix') . '/gadgets/makeRequest' =>
'ProxyServlet',
Config::get('web_prefix') . '/gadgets/ifr' =>
'GadgetRenderingServlet',
Config::get('web_prefix') . '/gadgets/metadata' =>
'JsonRpcServlet',
Config::get('web_prefix') . '/social/rest' =>
'RestServlet',
Config::get('web_prefix') . '/public.crt' =>
'CertServlet'
);
So if you'd hit /gadgets/ifr?url=<gadget url>, then that request gets
redirected to /index.php, which then loads the GadgetRenderingServlet
class (which is located in shindig/php/src/gadgets/http/
GadgetRenderingServlet.php) and then executes it.
It's a pretty standard way of doing 'pretty URL' mapping in PHP, so
nothing special really :-)
Hope that clears things up!
-- Chris
On Aug 3, 2008, at 7:40 AM, Reema Sardana wrote:
> Hi,
>
> I just build the Shindig PHP Server. From the instructions and the
> README at http://incubator.apache.org/shindig/#php, I see that I
> should expect a directory called 'gadgets' under shindig/php/ but I do
> not see 'gadgets' in
>
> http://svn.apache.org/repos/asf/incubator/shindig/trunk/php/
>
> Am I missing something?
>
> Thanks,
> - Reema