When we created “New API” (for example, “Status”) via admin panel of apigility it is created new module inside “module” directory of our project. There is “public function getAutoloaderConfig()…” inside new module “Status” inside Module.php.
If you didn’t has the psr-4 config for “Status” module in composer.json, you can update your module class with remove the getAutoloaderConfig() method, then update composer.json under autoload -> psr4
PSR-4 describes autoloading classes from file paths. Which autoloader should be used or where the configuration comes from is not a part of the specification.
Composer is one option, another can be the getAutoloaderConfig method in the module class.
@froschdesign hi, well, for autoloading, we can either use the Composer autoloading feature, or the Laminas/Loader/Autoloader module with the getAutoloaderConfig.
BUT, as far as i know, based on the documentation, we can either use Composer autoloading feature (using the use_laminas_loader = false option) OR the Laminas/Loader/Autoloader feature (using the use_laminas_loader = true option).
It doesn’t seem to have the capability to use both options (true and false) in the same application.
If we choose to use the Composer Autoloader feature, then we will have to remove the getAutoloaderConfig method in the module class AND move the module class to the src/ directory. I don’t know if it is doable with the API Tools Admin UI. Will API Tools Admin recreate another module class in the module root if there’s none there even if the module is autoloaded ?