我设法使用作曲家安装Parsedown
"require": {
...
"erusev/parsedown": "^1.6"
},
并将类路径添加到自动加载部分
"autoload": {
"classmap" : [
"controllers", "middleware", "models", "plugins", "vendor/erusev/parsedown"
]
}
但是当我尝试执行这一行时......
$Parsedown = new Parsedown();
...我最终遇到了这个错误:
找不到类“UserFrosting\Parsedown”
运行php composer.phar dump-autoload没有帮助。
我在这里想念什么?为什么在 UserFrosting - UserFrosting \Parsedown 下需要 Parsedown?
这是完整的composer.json:
{
"name": "userfrosting/UserFrosting",
"type": "project",
"description": "A secure, modern user management system for PHP.",
"keywords": ["php user management", "usercake", "bootstrap"],
"homepage": "https://github.com/userfrosting/UserFrosting",
"license" : "MIT",
"authors" : [
{
"name": "Alexander Weissman",
"homepage": "https://alexanderweissman.com"
}
],
"require": {
"birke/rememberme" : "1.0.4",
"illuminate/database" : "5.0.33",
"league/csv": "8.1.*",
"nikic/php-parser" : "~1",
"php" : ">=5.4.0",
"phpmailer/phpmailer" : "5.2.10",
"twig/twig" : "~1.0",
"slim/slim" : "2.*",
"slim/views" : "0.1.3",
"userfrosting/fortress" : "1.*",
"wikimedia/composer-merge-plugin": "~1",
"components/highlightjs": "9.8.0",
"aws/aws-sdk-php": "3.*",
"erusev/parsedown": "^1.6"
},
"extra": {
"merge-plugin": {
"include": [
"plugins/*/composer.json"
],
"recurse": true,
"replace": false,
"merge-dev": true,
"merge-extra": false
}
},
"autoload": {
"classmap" : [
"controllers", "middleware", "models", "plugins", "vendor/erusev/parsedown"
]
}
}