Установите Security-acl внутри Symfony 4 - PullRequest
0 голосов
/ 26 сентября 2019

Попытка заставить эту команду работать, пока я получаю сообщение об ошибке:

php bin/console init:acl

Symfony init: отсутствует команда acl

Я обнаружил, что эта проблема стека отвечает: Symfony init: отсутствует команда acl

Проблема в том, что при попытке

composer require symfony/security-acl

я получаю

[InvalidArgumentException] Не удалось найти пакет symfony / security-acl в версии, соответствующей 4.3. *

, что, как мне кажется, нормально, поскольку поддержка acl была удалена из Symfony 4 и даже 3.Но, тем не менее, представляется возможным использовать его в соответствии с Symfony SonataAdminBundle.

Я не знаю, как это исправить, спасибо за вашу помощь

РЕДАКТИРОВАТЬ: ACL bundle install

$ composer require symfony/acl-bundle
Using version ^1.0 for symfony/acl-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.3.*"
Nothing to install or update
Generating autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Executing script cache:clear [OK]
Executing script assets:install public [OK]

EDIT2:

Печать

chris@LAPTOP-JDR0HFFT MINGW64 ~/Desktop/projets/cav-php (acl_test)
$ git checkout -- .

chris@LAPTOP-JDR0HFFT MINGW64 ~/Desktop/projets/cav-php (acl_test)
$ git status
On branch acl_test
nothing to commit, working tree clean


chris@LAPTOP-JDR0HFFT MINGW64 ~/Desktop/projets/cav-php (acl_test)
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.3.*"
Package operations: 0 installs, 0 updates, 1 removal
**- Removing symfony/acl-bundle (v1.0.1)**
Writing lock file
Generating autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Executing script cache:clear [OK]
Executing script assets:install public [OK]


chris@LAPTOP-JDR0HFFT MINGW64 ~/Desktop/projets/cav-php (acl_test)
$ php bin/console cache:clear

 // Clearing the cache for the dev environment with debug true


 [OK] Cache for the "dev" environment (debug=true) was successfully cleared.



chris@LAPTOP-JDR0HFFT MINGW64 ~/Desktop/projets/cav-php (acl_test)
$ composer require symfony/acl-bundle
Using version ^1.0 for symfony/acl-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.3.*"
Package operations: 1 install, 0 updates, 0 removals
**- Installing symfony/acl-bundle (v1.0.1): Loading from cache**
Writing lock file
Generating autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Symfony operations: 1 recipe (a8cc43db8a7843044a16dd2afc8ce860)
- Configuring symfony/acl-bundle (>=v1.0.1): From auto-generated recipe
Executing script cache:clear [OK]
Executing script assets:install public [OK]

Some files may have been created or updated to configure your new packages.
Please review, edit and commit them: these files are yours.


chris@LAPTOP-JDR0HFFT MINGW64 ~/Desktop/projets/cav-php (acl_test)
$ php bin/console cache:clear

// Clearing the cache for the dev environment with debug true


[OK] Cache for the "dev" environment (debug=true) was successfully cleared.



chris@LAPTOP-JDR0HFFT MINGW64 ~/Desktop/projets/cav-php (acl_test)
$ php bin/console init:acl


 **There are no commands defined in the "init" namespace.**

Ответы [ 2 ]

2 голосов
/ 26 сентября 2019

Документация Sonata не всегда полностью обновлена ​​из-за того, что она поддерживается относительно небольшим числом людей.

Вы по-прежнему сможете использовать https://github.com/symfony/acl-bundle в соответствии с https://symfony.com/doc/current/security/acl.html

composer require symfony/acl-bundle

Подробности использования здесь: https://github.com/symfony/acl-bundle/blob/master/src/Resources/doc/index.rst

0 голосов
/ 26 сентября 2019

Хорошо, похоже, команда не

php bin/console init:acl

, а

php bin/console acl:init

Что не указано в документе :(

...