Kohana 3.1 自动加载不工作(在不同的机器上)

发布于 2025-01-06 16:49:19 字数 1254 浏览 0 评论 0原文

我面临着一个相当奇怪的问题。
在我的一个 Kohana 模块中,自动加载似乎仅在一个类上失败,而且仅在我的暂存盒上失败,但在我的开发盒上则不然。
此外,它还可以在同一段代码中很好地加载所有其他类。

所以我有一个类,在其中调用其他类:

class PayPal_AdaptivePayment extends PayPal {
    public function DoAdaptivePayment($params)
    {
        $receiverList = new PayPal_Container_ReceiverList();
        ....some more other code
        $result = new Paypal_Result_AdaptiveResult($response);
    }
}

PayPal_Container_ReceiverList() 和 Paypal_Result_AdaptiveResult() 类都位于我调用它们的类级别的文件夹中。

PayPal_Container_ReceiverList() lives in ./Container/receiverlist.php

Paypal_Result_AdaptiveResult() lives in ./Result/adaptiveversult.php

因此由于某种原因,它找不到 PayPal_Container_ReceiverList 类除非我特别将其包含在顶部 但它可以找到 Paypal_Result_AdaptiveResult() 类。

课堂上没有什么真正疯狂的事情是不起作用的:

class PayPal_Container_ReceiverList extends PayPal {

    public $receiver = array();


    public function __construct()
    {

    }
}

就是这样。

PayPal_Result_AdaptiveResult 类有点复杂,我认为将其粘贴在这里没有意义。

鉴于这在一个盒子上有效但在另一个盒子上不起作用这一事实可能会给我一个暗示,它可能与 php 而不是 kohana 有关,但我不确定。

在它工作的盒子上我有 php 5.3.8
在没有的地方,我有 php 5.3.2

有没有人在这里看到我没有看到的任何明显的东西?

非常感谢任何帮助!

T。

I'm facing a rather weird problem.
In one of my Kohana Modules Autoload seems to fail for just a single class, and also only on my staging box, but not on my development box.
Also, it loads all other classes just fine in the same piece of code.

So i have this class in which i call other classes:

class PayPal_AdaptivePayment extends PayPal {
    public function DoAdaptivePayment($params)
    {
        $receiverList = new PayPal_Container_ReceiverList();
        ....some more other code
        $result = new Paypal_Result_AdaptiveResult($response);
    }
}

Both Classes PayPal_Container_ReceiverList() and Paypal_Result_AdaptiveResult() are located in folders on the level of the class i'm calling them in.

PayPal_Container_ReceiverList() lives in ./Container/receiverlist.php

Paypal_Result_AdaptiveResult() lives in ./Result/adaptiveversult.php

sofor some reason, it can't find the PayPal_Container_ReceiverList class unless i include it specifically at the top
but it can find the Paypal_Result_AdaptiveResult() class.

There's nothing really crazy going on in the class that isn't working:

class PayPal_Container_ReceiverList extends PayPal {

    public $receiver = array();


    public function __construct()
    {

    }
}

that's it.

The PayPal_Result_AdaptiveResult class is a bit more complex, and i don't think it'd make sense pasting it here.

Giving the fact that this works on one box but not the other might give me an indication that it could have to do with php instead of kohana, but i'm not sure.

on the box it works i have php 5.3.8
on the one where it doesn't i have php 5.3.2

Does anyone see anything obivous here which i'm just not seeing?

any help is greatly appreciated!

T.

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

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

发布评论

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

评论(1

瞎闹 2025-01-13 16:49:19

其中一个文件名 (adaptiveversult.php) 有拼写错误。此外,所有文件夹和文件都应该小写。也许它正在运行的系统是Windows(不区分大小写)。基本上,这是类应该所在的路径:

paypal/container/receiverlist.php 中的 PayPal_Container_ReceiverList

paypal/result/adaptiveresult.php 中的 Paypal_Result_AdaptiveResult

There is a typo in one of the filenames (adaptiveversult.php). Also all the folders and files should be lowercase. Perhaps the system it's working on is Windows (which is case-insensitive). Basically this is the path where the classes should be:

PayPal_Container_ReceiverList in paypal/container/receiverlist.php

Paypal_Result_AdaptiveResult in paypal/result/adaptiveresult.php

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