Questions tagged [restler]

A micro framework that can expose any PHP class and its methods as Pragmatic and/or RESTful API.

Restler is a simple multi-format Web API Server written in PHP. It is open sourced under LGPL license.

258 questions
0
votes
1 answer

How to manually change the returned HTTP code and the message

I like to have messages that are different than the standard returned by RestException class. For example HTTP code 400 with custom message: return array ('code'=>400, 'result'=>"Fail", 'reason'=>"Bad meta tag: $meta"); Is this possible with the…
Antoan Milkov
  • 2,152
  • 17
  • 30
0
votes
1 answer

How to define static properties for UploadFormat in Restler?

Where and how should I define allowedMimeTypes and other properties for UploadFormat with Restler This is related to Handling file uploads with Restler and item 2 in the answer section
DarkVader
  • 117
  • 1
  • 10
0
votes
0 answers

Restler authentication class and versioning

I'm experiencing problems with versioning and authentication class in Restler version 3.0.0rc4. In the index.php file the authentication class and a User class are added like this: Defaults::$useUrlBasedVersioning =…
Jo Versmissen
  • 61
  • 1
  • 5
0
votes
2 answers

How to log the POST request data before the validation?

Is there a way to log the received POST request data before the data validation stage implemented via Restler?
Antoan Milkov
  • 2,152
  • 17
  • 30
0
votes
4 answers

swagger-codegen install on mac

I am trying desperately to get swagger-codegen working on my Macbook Pro with OS X Mountain Lion. Upgraded Java to 1.7. java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08,…
jecz
  • 21
  • 1
  • 7
0
votes
1 answer

Why does the Restler3 'vendor' folder need to be on site root?

I downloaded Restler3 a few days ago and while tinkering with it, I decided it was a good idea to move the 'vendor' folder outside site root. At first everything seemed fine, but then I noticed that for example the /math/sum/* example didn't work…
0
votes
1 answer

Restler2 passing random amount of parameters

I have problem in Restler2 with passing parameters to function. In Restler3 you can pass parameters whatever you want like in this function function sum() { return array_sum(func_get_args()); } So for example url…
Gntvls
  • 230
  • 4
  • 16
0
votes
1 answer

Restler 3 Custom Routing

I have been searching for an example of creating manual/custom routes in Restler 3 to achieve a URL like this. http://domain.com/api/v1/solution/categories/{category-id}/folders/{folder-id}/articles/{article-id}.json I would like everything handled…
jecz
  • 21
  • 1
  • 7
0
votes
1 answer

Restler 3 RC4 and Amazon Web Services (AWS)

I was having trouble getting the autoload working with Restler 3 RC4 and Amazon Web Services (AWS). Arul provided a fix which worked beautifully. $loader = require_once…
jecz
  • 21
  • 1
  • 7
0
votes
1 answer

What's the right way to use custom exceptions in Restler?

Lets say insted of just output: { "error": { "code": 500, "message": "Some internal error" } } I would like to output: { "error": { "code": 500, "message": "Some internal error", "error_code" : 1050 } } Also is…
David Benko
  • 373
  • 1
  • 6
  • 15
0
votes
1 answer

how to pass array as parameter in restler 3.0

I am new to restler3.0. I am trying to run sample examples given in the public folder. I got strucked when trying to run the routing example. I am trying to call the api/method/{param1}, in this method one more param is there and that is in array…
janpal
  • 11
  • 2
0
votes
1 answer

Restler Won't recognize more than one class

I want to create a API to access information about library patrons and books in the MySQL database we useIt is based of the CRUD example with everything but GET removed So I have 4 files: db_pdo_mysql.php which holds the functions index.php calls…
Riley Childs
  • 189
  • 2
  • 3
  • 10
0
votes
1 answer

GET parameters not working with Restler framework

I'm having a hard time getting Restler to work properly with nginx. In the first place I couldn't even get Math.php/add to work (returned 404). But I managed this way (I've seen a lot of people struggle with this): root …
David Benko
  • 373
  • 1
  • 6
  • 15
0
votes
1 answer

How to get array of dates as POST parameter

it looks like it is not possible to have array of dates as a parameter, like: @param array $dates Dates array {@type date} {@from body} Is there any way to make Restler to validate input of array of dates, for example: { "dates": ["2013-01-01",…
Antoan Milkov
  • 2,152
  • 17
  • 30
0
votes
1 answer

Restler3 RC4: api-list stays empty

I've got a problem with new Restler3 RC4: My API list in resource.json is just empty: { "apiVersion": "1", "swaggerVersion": "1.1", "basePath": "xxxxxx/API/index.php", "apis": [ ] } But by uncommenting the…
user1289915