Luracast / Restler

Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and/or RESTful API
http://luracast.com/products/restler/
GNU Lesser General Public License v2.1
1.36k stars 315 forks source link

restler.php missing code after installing v5 with composer #683

Open sebastianpospisil opened 2 years ago

sebastianpospisil commented 2 years ago

Hello @Arul- ,

the last few days, I tried using your awesome Restler Tool to display some self-made requests. I followed the instructions from GitHub while installing. For a long time, either a white screen only or an empty explorer was shown. Today I found that with the latest release there was some code missing in the restler.php file:

...if (is_readable(__DIR__ . '/vendor/autoload.php')) { //if composer auto loader is found use it require __DIR__ . '/vendor/autoload.php'; class_alias('Luracast\\Restler\\Restler', 'Restler'); } else {...

After I added these commands back in, it turned out working for me:

...if (is_readable(__DIR__ . '/vendor/autoload.php')) { //if composer auto loader is found use it + $loader = require __DIR__ . '/vendor/autoload.php'; + $loader->setUseIncludePath(true); - // require __DIR__ . '/vendor/autoload.php'; class_alias('Luracast\\Restler\\Restler', 'Restler'); } else {...

Was this an error on my end, or had the compiler a hiccup? Thanks for checking.

Greetings and keep coding

Sebastian