Closed eduh closed 5 years ago
Try importing the Defaults class as well
require_once 'vendor/restler.php';
use Luracast\Restler\Restler;
use Luracast\Restler\Defaults;
$r = new Restler();
$r->setSupportedFormats('JsonFormat');
$r->addAPIClass('say');
$r->handle('');
Defaults::$smartAutoRouting = false;
We have not tried restler 2 on php 7.1 please try and let us know if you hit any issue, we can write a fix!
This seems to work and the Defaults::$smartAutoRouting should be set before the init of Restler.
require_once 'vendor/restler.php';
use Luracast\Restler\Restler;
use Luracast\Restler\Defaults;
Defaults::$smartAutoRouting = false;
$r = new Restler();
$r->setSupportedFormats('JsonFormat');
$r->addAPIClass('say');
$r->handle('');
But now it throws some warnings
<b>Notice</b>: Undefined index: properties in <b>......Luracast/Restler/Routes.php</b> on line <b>469</b><br />
<br />
<b>Notice</b>: Undefined index: properties in <b>......Luracast/Restler/Routes.php</b> on line <b>469</b><br />
<br />
<b>Notice</b>: Undefined offset: 2 in <b>......Luracast/Restler/Restler.php</b> on line <b>948</b><br />
<br />
<b>Notice</b>: Undefined offset: 3 in <b>......Luracast/Restler/Restler.php</b> on line <b>948</b><br />
It looks like this is caused by some PHPDOC content. It contained an old piece of a non-existing parameter ( @param string $did_not_exist) . Is there a way to disable the validation of PHPdoc content?
The only way is to clean up the phpdoc comments
I am migrating from restler2 to version 3. I try to disable the $smartAutoRouting but it looks like I struggle with the location of
Defaults::$smartAutoRouting = false;
In index.php this throws an error Class 'Defaults' not found in .....
When I alter index.php the error disappears but it looks like smartautorouting is still on
One other question: I see Restler2.0 is running on php 7.1 for basic functionality but are there compatible issues known?