Open BoShurik opened 4 years ago
We don't need package-lock.json
and yarn.lock
anymore since foxy was replaced with asset-packagist in demo and app.
It's alright to have it.
Well, that foxy needs some polishing .. cannot make work composer update
, cannot downgrade PHP below 8.0 :-|
Using phar composer 2.2.5 (latest).
......
- Locking yiisoft/yii-http (1.0.0)
- Locking yiisoft/yii-middleware (dev-master 38ad72a)
- Locking yiisoft/yii-runner (1.0.0)
- Locking yiisoft/yii-runner-console (1.0.0)
- Locking yiisoft/yii-runner-http (1.0.0)
- Locking yiisoft/yii-swagger (1.1.0)
- Locking yiisoft/yii-view (4.0.2)
- Locking yosymfony/resource-watcher (v2.0.1)
- Locking zircote/swagger-php (4.2.4)
Writing lock file
Installing dependencies from lock file (including require-dev)
Fatal error: Uncaught TypeError: Composer\Package\Locker::__construct(): Argument #3 ($installationManager) must be of type Composer\Installer\InstallationManager, Composer\Repository\RepositoryManager given, called in D:\_projects\yii3\yii-demo\vendor\foxy\foxy\Util\LockerUtil.php on line 41 and defined in phar://D:/_projects/composer-2.2.5.phar/src/Composer/Package/Locker.php:63
Stack trace:
#0 D:\_projects\yii3\yii-demo\vendor\foxy\foxy\Util\LockerUtil.php(41): Composer\Package\Locker->__construct(Object(Composer\IO\ConsoleIO), Object(Composer\Json\JsonFile), Object(Composer\Repository\RepositoryManager), Object(Composer\Installer\InstallationManager), '{\n "name": "...')
#1 D:\_projects\yii3\yii-demo\vendor\foxy\foxy\Fallback\ComposerFallback.php(101): Foxy\Util\LockerUtil::getLocker(Object(Composer\IO\ConsoleIO), Object(Composer\Repository\RepositoryManager), Object(Composer\Installer\InstallationManager), './composer.json')
#2 D:\_projects\yii3\yii-demo\vendor\foxy\foxy\Foxy.php(179): Foxy\Fallback\ComposerFallback->save()
#3 [internal function]: Foxy\Foxy->init(Object(Composer\Installer\InstallerEvent))
#4 phar://D:/_projects/composer-2.2.5.phar/src/Composer/EventDispatcher/EventDispatcher.php(192): call_user_func(Array, Object(Composer\Installer\InstallerEvent))
#5 phar://D:/_projects/composer-2.2.5.phar/src/Composer/EventDispatcher/EventDispatcher.php(152): Composer\EventDispatcher\EventDispatcher->doDispatch(Object(Composer\Installer\InstallerEvent))
#6 phar://D:/_projects/composer-2.2.5.phar/src/Composer/Installer.php(714): Composer\EventDispatcher\EventDispatcher->dispatchInstallerEvent('pre-operations-...', true, true, Object(Composer\DependencyResolver\LocalRepoTransaction))
#7 phar://D:/_projects/composer-2.2.5.phar/src/Composer/Installer.php(583): Composer\Installer->doInstall(Object(Composer\Repository\InstalledFilesystemRepository), true)
#8 phar://D:/_projects/composer-2.2.5.phar/src/Composer/Installer.php(279): Composer\Installer->doUpdate(Object(Composer\Repository\InstalledFilesystemRepository), true)
#9 phar://D:/_projects/composer-2.2.5.phar/src/Composer/Command/InstallCommand.php(139): Composer\Installer->run()
#10 phar://D:/_projects/composer-2.2.5.phar/vendor/symfony/console/Command/Command.php(245): Composer\Command\InstallCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 phar://D:/_projects/composer-2.2.5.phar/vendor/symfony/console/Application.php(835): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 phar://D:/_projects/composer-2.2.5.phar/vendor/symfony/console/Application.php(185): Symfony\Component\Console\Application->doRunCommand(Object(Composer\Command\InstallCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 phar://D:/_projects/composer-2.2.5.phar/src/Composer/Console/Application.php(336): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 phar://D:/_projects/composer-2.2.5.phar/vendor/symfony/console/Application.php(117): Composer\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 phar://D:/_projects/composer-2.2.5.phar/src/Composer/Console/Application.php(131): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 phar://D:/_projects/composer-2.2.5.phar/bin/composer(83): Composer\Console\Application->run()
#17 D:\_projects\composer-2.2.5.phar(29): require('phar://D:/_proj...')
#18 {main}
thrown in phar://D:/_projects/composer-2.2.5.phar/src/Composer/Package/Locker.php on line 63
@lubosdz maybe foxy/foxy
don't support composer 2.2?
Try composer 2.1.
So it worked finally with composer 2.0.14 (probably 2.0.X branch) - with warnings not supported version of composer, PHP
.
Configured CLI PHP path to 8.0.13.
Installing 125 installs, 87 updates, 25 removals.
Crash yii-console has unpushed changes ..
.
Deleted again whole vendor
directory and ran composer install
.
Installing 222 installs, 0 updates, 0 removals.
Now it worked.
Another exception - required PHP >= 8.0.2 for HTTP requests.
OK, switched WAMP to 8.0.13.
Next exception .env
invalid path.
OK - created .env
file from env.example
. IMO .env
file should not be required, but assume default DEVEL settings if not found.
Next exception Class "Cycle\Database\Config\SQLiteDriverConfig" not found
in yii-demo\config\params.php
in line 153:
I gave up, file is missing in repo, cannot make running yii3 demo :-(
foxy/foxy
does not support PHP 8.1 and that limits maximum used PHP version for ALL packages. Therefore third party packages should be reduced to absolute minimum and/or somehow confirmed by maintainers that they will be able to maintain if necessary for framework purpose. I am aware that it is idealistic, but don't know any better how to ensure that thousands of projects depending framework will not be jeopartized by a single package. It may not be easy to switch to alternative package for many projects. This issue applies mainly to a single open source maintainers, probably not 3rd party framework packages.how will it differ from symfony and laravel
, what advantages will it have
or why should I invest my time to studying Yii3 and not use laravel/symfony with existing huge community and documentation
. Yii3 core developers should also consult with less experienced developers on their opinion to understand whether Yii3 will be easy to learn. To me it seems overengineered with high learning curve - so answering those questions may be the interest of many others.Thanks for feedback, @lubosdz.
I've re-tested starting from scratch:
git clone git@github.com:yiisoft/demo.git
cd demo
composer install
./yii serve
Then opened http://localhost:8080/ and got a working demo.
Things to be improved:
@samdark Thank you for feedback. Yes, trusted plugins should be directly committed to composer file and unnecessary packages removed. I re-tested demo site once again today on another computer - following exact steps you wrote above. And yes - it worked now - but partially. No missing Cycle config file anymore. The difference I see:
./yii serve
. I use common WAMP server, no virtual hosts. Seems homeUrl
is not calculated correctly for WAMP (or any local server on port 80). Site loaded fine when I accessed via http://localhost:8080/
, but not when accessed via standard URL http://localhost/yii3/demo/public/
. I may try to debug & supply PR if I have more time, unless won't be fixed till then.
Yes, that's known thing. Currently there's no support for subdirectories out of the box and it should be added via https://github.com/yiisoft/yii-middleware/blob/master/src/SubFolder.php to the main middleware settings. That was done to avoid unneeded entry point calculations in case there's no sub-directory involved (which is majority of cases).
This is not a library and most of the changes relates to specific package versions/commits so commit
composer.lock
,package-lock.json
andyarn.lock
would be ok