我在使用新的 Restler3 RC4 时遇到了问题:我在 resource.json 中的 API 列表是空的:
{
"apiVersion": "1",
"swaggerVersion": "1.1",
"basePath": "xxxxxx/API/index.php",
"apis":
[
]
}
但是通过取消注释 vendor/restler.php 文件看起来像这样:
require_once 'Luracast/Restler/AutoLoader.php';
return call_user_func(function ()
{
$loader = Luracast\Restler\AutoLoader::instance();
spl_autoload_register($loader);
return $loader;
});
它会起作用的。但是这样 twig-template 的东西等等就不起作用了(看看这里:Restler3 RC4: oAuth doesn't work)。那么现在的问题在哪里呢?当然,这是关于自动加载的,对吧?我讨厌自动加载!-.-
谢谢大家,扬
更新1 根据https://github.com/Luracast/Restler/issues/207#issuecomment-25678729我更新到最新的稳定版本,现在我的 resource.json 打印以下内容(第一个“严格标准”出现 193 次) :
<b>Strict Standards</b>: Only variables should be passed by reference in <b>xxxx/API/restler/vendor/Luracast/Restler/Routes.php</b> on line <b>228</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at xxxx/API/restler/vendor/Luracast/Restler/Routes.php:228) in <b>xxxx/API/restler/vendor/Luracast/Restler/Filter/RateLimit.php</b> on line <b>119</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at xxxx/API/restler/vendor/Luracast/Restler/Routes.php:228) in <b>xxxx/API/restler/vendor/Luracast/Restler/Filter/RateLimit.php</b> on line <b>137</b><br />
{
"apiVersion": "1",
"swaggerVersion": "1.1",
"basePath": "xxx/API/index.php",
"apis": [
{
"path": "/resources/consumer.{format}",
"description": ""
},
{
"path": "/resources/request.{format}",
"description": ""
},
{
"path": "/resources/shorturl.{format}",
"description": ""
},
{
"path": "/resources/comment.{format}",
"description": ""
},
{
"path": "/resources/favorites.{format}",
"description": ""
},
{
"path": "/resources/options.{format}",
"description": ""
},
{
"path": "/resources/plugins.{format}",
"description": ""
},
{
"path": "/resources/themes.{format}",
"description": ""
},
{
"path": "/resources/updater.{format}",
"description": ""
},
{
"path": "/resources/preferences.{format}",
"description": ""
}
]
}
如您所见,我得到了我的api!:) 但是我怎样才能修复警告?