pimcore 中自动加载类

发布于 2024-11-02 11:19:22 字数 394 浏览 1 评论 0原文

我创建了一个新的 PHP 类,将其命名为 Application_Form_Login 并将其保存为 /website/lib 目录中的 Application_Form_Login.php。但每次我运行 pimcore 时它都会拒绝加载该文件。我在这里做错了什么?

我一直在查看 Zend autoloader 并尝试找出问题所在。

我注意到在 pimcore 引导中,所有相关目录都被添加到包含路径中。但他们似乎没有被检查。或者也许我的文件命名不正确,无法被拾取?

I've created a fresh PHP-class, named it Application_Form_Login and saved it as Application_Form_Login.php inside the /website/lib directory. But everytime I'm running pimcore it refuses to load that file. What am I doing wrong here?

I've been looking at the Zend autoloader and trying to find out the issue.

I've noticed that in pimcore bootstrapping all the relevant directories are added to the include path. But they don't seem to get checked. Or maybe my file isn't named correctly to be picked up?

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

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

发布评论

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

评论(1

人心善变 2024-11-09 11:19:22

您的文件名应该是 /website/lib/Application/Form/Login.php

从您刚刚引用的页面中:

Each "_" character in the CLASS NAME is converted to a DIRECTORY_SEPARATOR. The "_" character has no special meaning in the namespace. 

Your filename should be /website/lib/Application/Form/Login.php

From the page you just quoted:

Each "_" character in the CLASS NAME is converted to a DIRECTORY_SEPARATOR. The "_" character has no special meaning in the namespace. 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文