Open ondics opened 1 year ago
What happens if you remove Bootstrap5 extension from composer.json?
Without Bootstrap5 this is the new composer.json
require:
section:
"require": {
"php": ">=7.4.0",
"yiisoft/yii2": "~2.0.45",
"yiisoft/yii2-symfonymailer": "~2.0.3",
"yiisoft/yii2-apidoc": "~2.1.0"
},
But these errors remain:
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires yiisoft/yii2-symfonymailer ~2.0.3 -> satisfiable by yiisoft/yii2-symfonymailer[2.0.3, 2.0.4].
- yiisoft/yii2-apidoc[2.1.0, ..., 2.1.6] require phpdocumentor/reflection-docblock ^2.0.4 -> satisfiable by phpdocumentor/reflection-docblock[2.0.4, 2.0.5].
- Conclusion: don't install phpdocumentor/reflection-docblock 2.0.5 (conflict analysis result)
- Root composer.json requires yiisoft/yii2-apidoc ~2.1.0 -> satisfiable by yiisoft/yii2-apidoc[2.1.0, ..., 2.1.6].
If I remove the require-dev
section and the symfonymailer to
"require": {
"php": ">=7.4.0",
"yiisoft/yii2": "~2.0.45",
"yiisoft/yii2-apidoc": "~2.1.0"
},
then it works. But I need the yii2-symfonymailer
!
Next error: ./yii help api
results in:
# ./yii help api
Exception 'yii\di\NotInstantiableException' with message 'Failed to instantiate component or class "yii\gii\Module".'
in /app/yii2-app-basic/vendor/yiisoft/yii2/di/Container.php:509
Caused by: Exception 'ReflectionException' with message 'Class "yii\gii\Module" does not exist'
in /app/yii2-app-basic/vendor/yiisoft/yii2/di/Container.php:507
Stack trace:
#0 /app/yii2-app-basic/vendor/yiisoft/yii2/di/Container.php(507): ReflectionClass->__construct('yii\\gii\\Module')
#1 /app/yii2-app-basic/vendor/yiisoft/yii2/di/Container.php(385): yii\di\Container->getDependencies('yii\\gii\\Module')
#2 /app/yii2-app-basic/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('yii\\gii\\Module', Array, Array)
#3 /app/yii2-app-basic/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('yii\\gii\\Module', Array, Array)
#4 /app/yii2-app-basic/vendor/yiisoft/yii2/base/Module.php(445): yii\BaseYii::createObject(Array, Array)
#5 /app/yii2-app-basic/vendor/yiisoft/yii2/base/Application.php(313): yii\base\Module->getModule('gii')
#6 /app/yii2-app-basic/vendor/yiisoft/yii2/base/Application.php(271): yii\base\Application->bootstrap()
#7 /app/yii2-app-basic/vendor/yiisoft/yii2/console/Application.php(124): yii\base\Application->init()
#8 /app/yii2-app-basic/vendor/yiisoft/yii2/base/BaseObject.php(109): yii\console\Application->init()
#9 /app/yii2-app-basic/vendor/yiisoft/yii2/base/Application.php(204): yii\base\BaseObject->__construct(Array)
#10 /app/yii2-app-basic/vendor/yiisoft/yii2/console/Application.php(89): yii\base\Application->__construct(Array)
#11 /app/yii2-app-basic/yii(19): yii\console\Application->__construct(Array)
#12 {main}
then it works. But I need the
yii2-symfonymailer
!
What happens if you change version of mailer from ~2.0.3
to ~3.0.0
?
Exception 'yii\di\NotInstantiableException' with message 'Failed to instantiate component or class "yii\gii\Module".'
Can you check if Gii module is defined in the console config?
then it works. But I need the
yii2-symfonymailer
!What happens if you change version of mailer from
~2.0.3
to~3.0.0
?
/app/yii2-app-basic# composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires yiisoft/yii2-symfonymailer ~3.0.0 -> satisfiable by yiisoft/yii2-symfonymailer[3.0.0].
- yiisoft/yii2-apidoc[2.1.0, ..., 2.1.6] require phpdocumentor/reflection-docblock ^2.0.4 -> satisfiable by phpdocumentor/reflection-docblock[2.0.4, 2.0.5].
- Conclusion: don't install phpdocumentor/reflection-docblock 2.0.5 (conflict analysis result)
- Root composer.json requires yiisoft/yii2-apidoc ~2.1.0 -> satisfiable by yiisoft/yii2-apidoc[2.1.0, ..., 2.1.6].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Exception 'yii\di\NotInstantiableException' with message 'Failed to instantiate component or class "yii\gii\Module".'
Can you check if Gii module is defined in the console config?
I'm using https://github.com/yiisoft/yii2-app-basic out of the box - Nothing modified in configs.
Do I have to modify config settings?
I'm using https://github.com/yiisoft/yii2-app-basic out of the box - Nothing modified in configs.
I thought this was problem only in docker which is not set in my machine. I will install it from Basic and check it out. Sorry for what you are facing. It should just work
Hi,
Please remove vendor
directory and composer.lock
Change apidoc version to 3.0.6
i.e. "yiisoft/yii2-apidoc": "~3.0.6"
Run composer install
when completed then run ./vendor/bin/apidoc help
Then let me know if you get everything successful!
Thx, seems to work.
I didn't know that I've to run ./vendor/bin/apidoc help
.
I assumed apidoc can be called using ./yii
command line executor. Maybe this should be clarified in the README.md
I didn't know that I've to run
./vendor/bin/apidoc help
.
apidoc installs a command-line tool for doing the tasks
I will leave this open until doc is updated
The issue comes with bootstrap5. Removed it from the requires section, apidoc can be installed.
This package has the dependency to yiisoft/yii2-bootstrap
but if anyone need to install bootstrap5, then won't be able to install due to yii2-apidoc dependency.
What steps will reproduce the problem?
In my Docker container (
php:8.2-bullseye
) I useyii2-app-basic
:Then add
https://github.com/yiisoft/yii2-app-basic
torequire
section:Then start composer to resolve dependencies:
What's expected?
This should work now:
What do you get instead?
Is there something missing in the installations section of
yii2-apidoc
?