Closed esallum-iluminare closed 3 years ago
You need to use 4.x version with CakePHP 4.
There is version 4.0.0-beta
of cakephp/localized
.
We should release that stable version IMO :)
I'm delighted the way I was helped. Thanks @dereuromark
Is there any way to install localized without removing the following dependencies?:
$ composer require cakephp/localized
Using version ^4.0 for cakephp/localized
./composer.json has been updated
Running composer update cakephp/localized
Loading composer repositories with package information
Updating dependencies
Lock file operations: 8 installs, 0 updates, 5 removals
**- Removing cakephp/core (4.2.7)
- Removing cakephp/database (4.2.7)
- Removing cakephp/datasource (4.2.7)
- Removing cakephp/utility (4.2.7)
- Removing cakephp/validation (4.2.7)**
- Locking cakephp/cakephp (4.2.7)
- Locking cakephp/localized (4.0.0)
- Locking composer/ca-bundle (1.2.10)
- Locking laminas/laminas-diactoros (2.6.0)
- Locking laminas/laminas-httphandlerrunner (1.4.0)
- Locking laminas/laminas-zendframework-bridge (1.3.0)
- Locking league/container (3.3.5)
- Locking psr/http-client (1.0.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 8 installs, 0 updates, 5 removals
**- Removing cakephp/validation (4.2.7)
- Removing cakephp/utility (4.2.7)
- Removing cakephp/datasource (4.2.7)
- Removing cakephp/database (4.2.7)
- Removing cakephp/core (4.2.7)**
- Installing psr/http-client (1.0.1): Extracting archive
- Installing league/container (3.3.5): Extracting archive
- Installing laminas/laminas-zendframework-bridge (1.3.0): Extracting archive
- Installing laminas/laminas-diactoros (2.6.0): Extracting archive
- Installing laminas/laminas-httphandlerrunner (1.4.0): Extracting archive
- Installing composer/ca-bundle (1.2.10): Extracting archive
- Installing cakephp/cakephp (4.2.7): Extracting archive
- Installing cakephp/localized (4.0.0): Extracting archive
2 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files
65 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Those removed packages are replaced with Installing cakephp/cakephp (4.2.7)
.
Your app will continue to work because all classes from cakephp/database
and cakephp/validation
are included cakephp/cakephp
.
@garas Unfortunately it's giving the following error in my api:
The \"_cakecore\" cache configuration does not exist. in C:\xampp\htdocs\conventionsector\vendor\cakephp\cakephp\src\Cache\Cache.php
It now tries to use caching because Cache
class is now installed and exists.
You can configure cache with Cache::setConfig('_cake_core_', [...]);
or just disable it with Cache::disable()
.
cakephp/localized
probably could depend on cakephp/i18n
+ cakephp/http
only and would avoid your situation.
To avoid cakephp/http
dependency, usage of Cake\Http\Exception\NotImplementedException
could be replaced with some non-http exception as it is also wrong exception type in this case. But as 4.0 is now released it could be breaking change.
I tried to install cakephp/localized using the following commands:
composer require cakephp/localized
composer.phar require --update-with-dependencies "cakephp/localized"
And gives the following error:
If I manually enter cakephp/localized no in composer.json file and give composer.update command, it conflicts with cakephp/database:
The following dependencies are in my composer.json file:
How can I fix this error?