docs
docs copied to clipboard
Using Yii3 as a micro framework
What steps will reproduce the problem?
I setup a boilerplace to build a minimal version of Yii3 for a project. See the composer.json
{
"minimum-stability": "dev",
"require": {
"php": ">=7.2.0",
"yiisoft/yii-web": "^3.0@dev",
"yiisoft/di": "^3.0@dev",
"yiisoft/log": "^3.0@dev",
"yiisoft/cache": "^3.0@dev"
}
}
What is the expected result?
I should be able to install dependencies.
What do you get instead?
I receive the following message:
Problem 1
- Installation request for yiisoft/yii-web ^3.0@dev -> satisfiable by yiisoft/yii-web[3.0.x-dev].
- yiisoft/yii-web 3.0.x-dev requires psr/http-factory-implementation 1.0 -> no matching package found.
Additional info
Q | A |
---|---|
Version | 3.0 |
PHP version | 7.3.9 |
Operating system | macOS Catalina |
Yes, you need PSR HTTP factory. I recommend using nyholm/psr7.
Sorry made this PR in a rush and more of documentation. I think it’s not clear in the installation and can lead to confusion, especially for first time users.
I think it's interesting enough use case to be part of the guide.
Ok, any guidance on how to write this up? I think I'm going to take the same approach from the 2x version of writing a micro framework... but highlighting the psr dependency.
Oh, you want to do it? Great! Then https://www.yiiframework.com/doc/guide/2.0/en/tutorial-yii-as-micro-framework is a good start. Document should be placed into tutorial/yii-as-micro-framework.md