SugarCRM 无法包含钩子

发布于 2024-10-07 11:43:19 字数 723 浏览 0 评论 0原文

我尝试为 SugarCRM 中的 Cases 模块创建一个逻辑钩子。我将logic_hooks.php 文件放入custom/modules/Cases 目录中,但它从未包含在内。

我在 include/utils/LogicHook.php 文件中进行了一些调试,问题出在 call_custom_logic 函数中:

...

//声明钩子数组变量,它将在包含文件中定义。

$hook_array = null;

if(!empty($module_dir)){

// 这将加载要处理的钩子数组

if(file_exists("custom/modules/$module_dir/logic_hooks.php")){

 $GLOBALS['log']->debug('包括 '.$module_dir 的模块特定挂钩文件);

 包括(“自定义/模块/$module_dir/logic_hooks.php”);

...

空文件夹测试成功,但是file_exists 总是返回 false (如果我注释这一行,则 include 函数也会抛出错误)。

我想知道这是如何工作的,就好像我读得很好一样,file_exists 函数只需要绝对路径,但它似乎适用于所有其他 SugarCRM 用户,所以我想我的配置中有问题。

感谢任何帮助,因为我真的不知道问题出在哪里!

I tried to create a logic hook for the Cases module in SugarCRM. I put my logic_hooks.php file into the custom/modules/Cases directory but it's never included.

I put some debug in the include/utils/LogicHook.php file and the problem is in the call_custom_logic function:

...

// declare the hook array variable, it will be defined in the included file.

$hook_array = null;

if(!empty($module_dir)){

// This will load an array of the hooks to process

if(file_exists("custom/modules/$module_dir/logic_hooks.php")){

 $GLOBALS['log']->debug('Including module specific hook file for '.$module_dir);

 include("custom/modules/$module_dir/logic_hooks.php");

...

The empty folder test succeeds but the file_exists always returns false (and if I comment this line, the include function throws an error too).

I wonder how this could work as if I read good the file_exists function takes only absolute path but it seems to work for every other SugarCRM user so I guess I have a problem in my configuration somewhere.

Any help is apreciated cause I really don't know where is the problem!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

苦笑流年记忆 2024-10-14 11:43:19

不,file_exists() 可以采用绝对路径和相对路径。验证您的文件名称是否准确 logic_hooks.php 并且运行您的网络服务器的用户可以读取该文件。

No, file_exists() can take both absolute and relative path. Verify that you have the file named exactly logic_hooks.php and it is readable to the user that is running your webserver.

会发光的星星闪亮亮i 2024-10-14 11:43:19

如果你的糖工作正常,他会自动设置路径,这就是为什么你可以这样调用文件。

无论如何,如上所述检查文件是否命名良好并且权限是否正确

If your sugar is working, he sets path automaticly, that's why you can call files like that.

Anyway as above stated check if file is named good and permissions are right

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文