Login   Register  
PHP Classes
elePHPant
Icontem

Suggestions

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      REST Server  >  All threads  >  Suggestions  >  (Un) Subscribe thread alerts  
Subject:Suggestions
Summary:.htaccess example and <?php
Messages:2
Author:Jamie Tatum
Date:2009-03-20 02:24:43
Update:2009-03-21 02:34:16
 

  1. Suggestions   Reply   Report abuse  
Picture of Jamie Tatum
Jamie Tatum
2009-03-20 02:24:43
Neat class. I notice that in the listed example, "Throw A Bottle," the REST interface has URLs like /REST/user/[login] and so forth. This implies the use of .htaccess. The included example has query style URLs. I know the class description indicates .htaccess is not needed, but perhaps the file could include examples of the .htaccess setup?

Also, I had to modify most of the files to change from <? to <?php. <? is not a valid escape sequence on my web server. <?php is more universal, I believe.

  2. Re: Suggestions   Reply   Report abuse  
Picture of Diogo Souza da Silva
Diogo Souza da Silva
2009-03-21 02:34:16 - In reply to message 1 from Jamie Tatum
Thank you for your feedback!

Just added an example, with lot more features explained and the htaccess (just add the "."). Also included the <?php in the scripts it was missing.

Just a note about the .htaccess configuration: It will actually send the request URL to a $_GET var, depends on your application directory level(too deep) it may not work well.

Best case is first level (root), as http://website.com/my/url , the RestServer will get the "my/url". If its in second directory, as Throw a Bottle, like http://website.com/REST/my/url , RestServer will get "REST/my/url" as RequestURI.

In this .htaccess the URL ("my/url") is going in the $_GET["q"] var, so to RestServer treat this if not in root, use new RestServer($_GET["q"]).

Hope I did not make it a mess and harder to understand.