yiisoft / docs

Various Yii 3.0 related documentation
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
233 stars 70 forks source link

Using Yii3 as a micro framework #32

Open jasonmccallister opened 4 years ago

jasonmccallister commented 4 years ago

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
samdark commented 4 years ago

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

jasonmccallister commented 4 years ago

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.

samdark commented 4 years ago

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

jasonmccallister commented 4 years ago

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.

samdark commented 4 years ago

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