CakePHP 错误:在 Acl 中找不到类“字符串”


CakePHP Error: Class 'String' not found in Acl

我的 Acl 管理员已损坏,我不知道为什么,因为我没有从以前工作时更改任何内容。

当我转到/acl时,出现以下错误:

错误:找不到类"字符串" 文件:/app/Plugin/Acl/Controller/Component/AclReflectorComponent.php
行: 17

public function getPluginName($ctrlName = null)
{
    $arr = String::tokenize($ctrlName, '/');   <-----  Line: 17
    if (count($arr) == 2) {
        return $arr[0];
    } else {
        return false;
    }
}

我检查了$ctrlName中的内容,值为 Acl/Acl .

完全迷失在这里,我该怎么办?

为了使 CakePHP 与 PHP7 兼容,从 CakePHP 2.7 开始,String 类已被弃用,取而代之的是 CakeText 类。

您必须下载最新版本的 Acl 插件。

如果找不到,使用 CakeText 更改所有出现的String应该可以解决问题。