大家好!
我正在使用Webman框架进行我的项目开发,但我在设置依赖注入方面遇到了一些问题。我希望能够得到一些指导或者示例,以便更好地利用Webman框架的依赖注入功能。
我已经查阅了相关文档,但我仍然感到有些困惑。如果有人能够提供一些实际的例子,或者分享一下他们在项目中成功使用依赖注入的经验,我将不胜感激。
同时,我也想分享一下我的 composer.json 文件,以便更好地理解我的项目结构和依赖项。以下是我的 composer.json 内容:
{
"name": "workerman/webman",
"type": "project",
"keywords": [
"high performance",
"http service"
],
"homepage": "http://www.workerman.net",
"license": "MIT",
"description": "High performance HTTP Service Framework.",
"authors": [
{
"name": "walkor",
"email": "walkor@workerman.net",
"homepage": "http://www.workerman.net",
"role": "Developer"
}
],
"support": {
"email": "walkor@workerman.net",
"issues": "https://github.com/walkor/webman/issues",
"forum": "http://wenda.workerman.net/",
"wiki": "http://workerman.net/doc/webman",
"source": "https://github.com/walkor/webman"
},
"require": {
"php": ">=7.2",
"workerman/webman-framework": "1.3.14",
"workerman/gateway-worker": "^3.0",
"workerman/crontab": "^1.0",
"webman/redis-queue": "^1.0",
"monolog/monolog": "^2.0",
"vlucas/phpdotenv": ">=4.1,<6.0",
"symfony/translation": "^5.3",
"illuminate/validation": "^8.29",
"illuminate/console": "^8.61",
"illuminate/events": "^8.29",
"illuminate/database": "^8.29",
"illuminate/contracts": "^8.39",
"illuminate/auth": "^8.40",
"illuminate/pagination": "^8.52",
"robmorgan/phinx": "^0.12.5",
"php-di/php-di": "^6.3",
"doctrine/cache": "^1.10",
"doctrine/annotations": "^1.12",
"sentry/sdk": "3.2.0",
"php-http/curl-client": "^2.2",
"respect/validation": "^2.2",
"ramsey/uuid": "^4.2",
"your-app-rocks/eloquent-uuid": "^2.5",
"league/csv": "^9.7",
"phpmailer/phpmailer": "^6.5",
"phpoffice/phpspreadsheet": "^1.19",
"aws/aws-sdk-php": "^3.209",
"antecedent/patchwork": "^2.1",
"onelogin/php-saml": "1.0.0",
"silber/bouncer": "1.0.0",
"fakerphp/faker": "^1.23"
},
"suggest": {
"ext-event": "For better performance. "
},
"autoload": {
"psr-4": {
"app\\": "app/",
"support\\": "support"
},
"autoload-dev": {
"psr-4": {
"Test\\": "./test/"
}
},
"files": [
"./support/helpers.php"
]
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"mockery/mockery": "^1.5"
},
"config": {
"gitlab-token": {
"git.company.mg": "xxxx"
}
}
}
非常感谢您的帮助!
直接按照官方的配置使用就行了
方便的话,可以打赏个红包!嘻嘻!
我记得这是个外国人,用英文的,你看他的这个帖子里的语言,带点机翻的感觉,不过你的代码他应该能看明白
这个真没看出来,那我改成英文的