Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CakePHP Error: Class 'String' not found in Acl

My Acl admin is corrupt and I have no idea why, since I haven't changed anything from when it used to work.

When I go to /acl, I get the following error:

Error: Class 'String' not found File: /app/Plugin/Acl/Controller/Component/AclReflectorComponent.php
Line: 17

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

I checked what's in $ctrlName and the value is Acl/Acl.

I'm completely lost here, what should I do?

like image 971
flaggalagga Avatar asked Dec 07 '15 17:12

flaggalagga


1 Answers

In order to make CakePHP compatible with PHP7, the String class has been deprecated as of CakePHP 2.7 in favour of the CakeText class.

You have to download an up to date version of your Acl Plugin.

If you can't find one, changing all occurrences of String with CakeText should fix the problem.

like image 138
Inigo Flores Avatar answered Oct 21 '22 01:10

Inigo Flores