gpt4 book ai didi

cakephp - AclExtras 警告错误

转载 作者:行者123 更新时间:2023-12-05 01:25:32 25 4
gpt4 key购买 nike

CakePHP 2 book / Acl Tutorial / Part 2 ,我正在执行命令:

./Console/cake AclExtras.AclExtras aco_sync

我收到一个警告错误:

Warning Error: Argument 1 passed to Component::startup() must be an instance of Controller, 
null given, called in
/opt/lampp/htdocs/acl/app/Plugin/AclExtras/Console/Command/AclExtrasShell.php
on line 80 and defined in [/opt/lampp/htdocs/acl/lib/Cake/Controller/Component.php, line 119]

acos 表在 model 字段中填充了 NULL,在 foreign_key 的所有字段中填充了 NULL

我该如何修复这个错误?

enter image description here

谢谢

最佳答案

在 AclExtras/Console/Command 中,请将启动函数更改为:

public function startup() {
parent::startup();
$controller = new Controller();
$collection = new ComponentCollection();
$this->Acl = new AclComponent($collection);
$this->Acl->startup($controller);
$this->Aco = $this->Acl->Aco;
}

关于cakephp - AclExtras 警告错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11597432/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com