0
composer.json:苗条3中间件&PSR-4作曲家自动装载机:类未找到
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
的src /认证/ RequestMethodPathRule.php:
namespace App\Auth;
class RequestMethodPathRule implements \Slim\Middleware\HttpBasicAuthentication\RuleInterface
{
...
SRC /中间件.php
$app->add(new \Slim\Middleware\HttpBasicAuthentication([
"rules" => [new App\Auth\RequestMethodPathRule(
这导致
级“应用程序\身份验证\ RequestMethodPathRule找不到。
RequestMethodPathRule.php包括所有的代码在文件middleware.php工作正常英寸
更奇怪的是,随着500错误,浏览器显示RequestMethodPathRule.php的源代码!
编辑: 哦,我,我对类文件(<? instead of <?php)
一个shorttag所以PHP把它当作文本。习惯很难戒掉。
'config.json',你确定这是文件名吗? – Federkun
表示composer.json。我会编辑谢谢。 – sivann
等一下,你忘了'<?php'标签了吗? – Federkun