在Symfony 4中安装Security-acl [英] Install Security-acl inside Symfony 4
问题描述
在遇到错误时尝试使此命令起作用:
Trying to make this command work while I'm getting the error :
php bin/console init:acl
Symfony init:acl命令丢失
Symfony init:acl command missing
我发现此堆栈问题回答: Symfony init:acl命令丢失
I found this stack issue answering: Symfony init:acl command missing
问题是,当我尝试
composer require symfony/security-acl
我要获得
[InvalidArgumentException]
在匹配4.3的版本中找不到软件包symfony / security-acl。*
[InvalidArgumentException] Could not find package symfony/security-acl in a version matching 4.3.*
我认为这似乎是正常的,因为acl支持已从Symfony 4甚至3中删除。
但是,根据Symfony SonataAdminBundle的说法,似乎仍然可以使用它。
Which seems to be normal as acl support were removed from Symfony 4 and even 3 I think. But still, it seems to be possible to use it according to the Symfony SonataAdminBundle.
我不知道如何解决此问题,感谢您的帮助
I don't know how to fix this, thanks for your help
编辑:ACL捆绑安装
$ 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.**
推荐答案
由于由相对较少的人维护,Sonata文档并不总是完全最新。
The Sonata documentation isn't always fully up to date due to being maintained by a relatively small number of people.
您仍然应该可以使用 https://github.com/symfony/acl-bundle根据 https://symfony.com/doc/current/security/acl。 html
You should still be able to use use https://github.com/symfony/acl-bundle according to https://symfony.com/doc/current/security/acl.html
作曲家需要symfony / acl-bundle
使用细节在这里: https://github.com/symfony/acl-bundle/blob/master/src/Resources/doc /index.rst
这篇关于在Symfony 4中安装Security-acl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!