No problems! Worked perfectly. But I wanted to change the namespace from App\Service\Api\Say to App\Api\Say and then move the physical PHP class accordingly. However, when I do that, the class is suddenly invisible. Like, the autoloader can't find it. This is my restler.php file:
<?php
use Luracast\Restler\Defaults;
use Luracast\Restler\Format\HtmlFormat;
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 {
//otherwise use the restler auto loader
require_once __DIR__.'/src/Luracast/Restler/AutoLoader.php';
return call_user_func(function () {
$loader = Luracast\Restler\AutoLoader::instance();
spl_autoload_register($loader);
return $loader;
});
}
Defaults::$cacheDirectory = __DIR__ . '/cache';
HtmlFormat::$viewPath = __DIR__ . '/views';
Been at this for an hour and just out of ideas. Any thoughts?
I tested Restler using the documented gateway, but using a namespaced class:
File on disk in
./src/Service/Api/Say.php
:No problems! Worked perfectly. But I wanted to change the namespace from
App\Service\Api\Say
toApp\Api\Say
and then move the physical PHP class accordingly. However, when I do that, the class is suddenly invisible. Like, the autoloader can't find it. This is myrestler.php
file:Been at this for an hour and just out of ideas. Any thoughts?