acl
acl copied to clipboard
Cannot install using Composer with CakePHP4
CakePHP: 4.2.3 PHP: 8.0.1 Composer: 2.0.9 OS: Windows 10
Hello, I'm attempting to include the Acl plugin.
However, when I run
composer require cakephp/acl
it selects Acl version 0.6.0, which requires CakePHP ^3.8.2, but that does not include CakePHP 4+
So I manually selected Acl version 0.7.0
composer require "cakephp/acl:^0.7.0"
Which leads to the error:
[InvalidArgumentException] Package cakephp/acl at version 0.7.0 has a PHP requirement incompatible w ith your PHP version, PHP extensions and Composer version
Is there a different way I should be adding the plugin?
The ACL plugin has not been updated for PHP8. Any chance you are interested in helping with that?
Ah, I see. Tbh I'm not well versed in CakePHP or the ACL plugin. I may give it a shot after I get a little more experience in a week or 2, unless someone beats me to it.
Is updating this to use PHP 8 in the works or is this project dead?
Is updating this to use PHP 8 in the works or is this project dead?
There is no active work to update this to PHP8. As a community run project it can only really die when people stop contributing :) If you'd like to help improve the PHP8 compatibility I'm happy to do reviews, merge changes and tag releases but I don't have much time to devote to this project beyond that.
I will talk it over with my team. We are currently down to 3 or 4 projects still using acls. We look to see if it would be best to move to what our other projects are using or update this plugin.
@scs2771 I think it would not be too difficult to upgrade it; however, I realized that I didn't need to as we use PHP 7.4, not PHP 8. Additionally, our other sites are using TinyAuth or CakeDC Users plugin instead of Acl.
Are there any known issues with PHP 8? I run this plugin on php 8 without any issues so far. Am I missing something?
Any news regarding this?
I'm happy to attempt this.
The main PHP-8 compatibility issue is
[Deprecated (8192)]: ctype_digit(): Argument of type App\Model\Entity\User will be interpreted as string in the future [in /app/vendor/cakephp/acl/src/Model/Table/AclNodesTable.php, line 60]
which is in src/Model/Table/AclNodesTable.php caused by
} elseif (is_int($ref) || ctype_digit($ref)) {
I've run the testsuite and there are no tests that cover the ctype_digit condition. So I'm sure casting $ref to string will be appropriate.
PR created for this https://github.com/cakephp/acl/pull/173
Shouldn't this be closed by now since #173 has already been merged?