Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

changes you made and I made :) #2

Closed
Artistan opened this Issue May 20, 2011 · 6 comments

Comments

Projects
None yet
3 participants

looks like this code went from a format of @url GET /foo/:var to @url GET /foo/$var
also, with the root element.
$this->root = ($dir == '.' ? '' : trim($dir,'/') . '/');
this works well for me.
I also applied the changes made by jk
thanks.

Contributor

jk commented Jun 20, 2011

I do the same thing in a slightly other way:

<?php
define('PREFIX_DIRECTORY', dirname($_SERVER['SCRIPT_NAME']).DIRECTORY_SEPARATOR);

$server = new RestServer('debug');
$server->root = PREFIX_DIRECTORY;
?>

If you prefer not to use the root class field you can prefix every addClass call with the constant.

<?php
$server->addClass('MyRestExposedClass', PREFIX_DIRECTORY.'mycontroller');
?>

Artistan commented Jul 8, 2011

Glad to see the update.
Working on a extended authorization system now.

On Jun 20, 2011, at 9:19 AM, jkreply@reply.github.com wrote:

I does the same thing in a slightly other way:

<?php
define('PREFIX_DIRECTORY', dirname($_SERVER['SCRIPT_NAME']).DIRECTORY_SEPARATOR);

$server = new RestServer('debug');
$server->root = PREFIX_DIRECTORY;
?>

If you prefer not to use the root class field you can prefix every addClass call with the constant.

<?php
$server->addClass('MyRestExposedClass', PREFIX_DIRECTORY.'mycontroller');
?>

Reply to this email directly or view it on GitHub:
#2 (comment)

Contributor

jk commented Jul 8, 2011

I think I'm doing something similar at the moment. I'm in the process (it's not published yet) of adding OAuth2 support now. But I'll rename my RestServer fork to rest-o-auth to prevent any naming confusions. Did you already publish something?

Artistan commented Jul 8, 2011

No, working on internal authentication base on company users database.
Oauth would be excellent if I can get them to migrate towards external authentication and keep tha authorizations internal.

Let me know if you need a tester.

On Jul 8, 2011, at 3:54 AM, jkreply@reply.github.com wrote:

I think I'm doing something similar at the moment. I'm in the process (it's not published yet) of adding OAuth2 support now. But I'll rename my RestServer fork to rest-o-auth to prevent any naming confusions. Did you already publish something?

Reply to this email directly or view it on GitHub:
#2 (comment)

Owner

jacwright commented Jul 25, 2011

I've merged jk's changes. There's also a non-github fork at https://github.com/Luracast/Restler. Would consolidating projects make sense? It would be beneficial in terms of sharing code and documentation, but I am obviously not the best lead for this project, being a slacker and all.

Contributor

jk commented Jul 26, 2011

Thanks for pointing that out. I already implemented XML output, color highlighting (via geSHi) and .format extensions. The authentication scheme looks intresting - I definitly prefer the way via PHPs method scopes. Perhaps I implement something really similar to his solution. Don't know how to merge these two, but sharing the knowledge would be a start.

@jacwright jacwright closed this Feb 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment