docs icon indicating copy to clipboard operation
docs copied to clipboard

Using Yii3 as a micro framework

Open jasonmccallister opened this issue 5 years ago • 5 comments

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

jasonmccallister avatar Oct 28 '19 22:10 jasonmccallister

Yes, you need PSR HTTP factory. I recommend using nyholm/psr7.

samdark avatar Oct 29 '19 08:10 samdark

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.

jasonmccallister avatar Oct 29 '19 12:10 jasonmccallister

I think it's interesting enough use case to be part of the guide.

samdark avatar Oct 29 '19 12:10 samdark

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.

jasonmccallister avatar Oct 30 '19 00:10 jasonmccallister

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

samdark avatar Oct 30 '19 09:10 samdark