joaodavidmateus
joaodavidmateus

Reputation: 93

Restler 3 - Setup configuration

I'm using XAMPP that has PHP 5.3.1, with restler structure in htdocs folder

In my htdocs folder, I have the index.php

<?php
require_once 'vendor/restler.php';
use Luracast\Restler\Restler;

$r = new Restler();
$r->addAPIClass('Say'); // repeat for more
$r->handle(); //serve the response

and say.php

<?php
class Say {

    /*
    * @url GET /
    */
    function hello($to='world') {
        return "Hello $to!";
    }

    function hi($to) {
        return  "Hi $to!";
    }
}

In the browser, I put

localhost/index.php/Say

or

localhost/index.php/Say/hello

it gives me the following message

Fatal error: Call to undefined function Luracast\Restler\stream_resolve_include_path() in /Applications/XAMPP/xamppfiles/htdocs/Luracast/Restler/AutoLoader.php on line 143

What am I doing wrong?

Upvotes: 1

Views: 808

Answers (3)

nickl-
nickl-

Reputation: 8731

Restler 3 is PHP 5.3 and the function stream_resolve_include_path will be defined with versions 5.3.2 and later.

Upvotes: 0

joaodavidmateus
joaodavidmateus

Reputation: 93

The problem was with the PHP version. Changed from XAMPP to AMPSS that supports PHP 5.4 and its working now

Upvotes: 1

Inge
Inge

Reputation: 447

don't know if it helps but have you tried to write Say in lowercase?

localhost/index.php/say

Your code looks good to me...

Cu Inge

Upvotes: 0

Related Questions