gpt4 book ai didi

php - PHP 5.3.1 上的 Paypal 错误消息

转载 作者:太空宇宙 更新时间:2023-11-03 16:20:41 24 4
gpt4 key购买 nike

我将 PayPal 集成到一个用 PHP 编写并在 PHP 5.3.1(使用 Zend Engine 2.3.0)上运行的应用程序中。每次我需要 PayPal SDK 文件或使用任何方法时,它都会打印出大量错误和警告消息。我显然希望将错误消息报告保持在尽可能高的水平(至少对于我的代码而言)。

我的问题和这个类似(不是我写的)https://www.x.com/message/167121#167121

我担心可能出现的安全问题以及进入日志的明显烦人的消息数量。

您知道如何解决/解决这个问题吗?

谢谢:)

编辑:警告列表中的示例(还有更多):

举个例子(但还有更多):

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal.php on line 87

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal.php on line 115

Strict Standards: Declaration of PayPal::raiseError() should be compatible with that of PEAR::raiseError() in (...)/PayPal.php on line 198

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/Hack.php on line 78

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/SOAP/Value.php on line 90

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/SOAP/Value.php on line 93

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/SOAP/Base.php on line 221

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/SOAP/Base.php on line 514

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/SOAP/Base.php on line 616

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/SOAP/Base.php on line 617

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/SOAP/Base.php on line 760

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/SOAP/Base.php on line 897

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/SOAP/Base.php on line 1055

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/SOAP/Base.php on line 1083

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/SOAP/Base.php on line 1109

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/SOAP/Base.php on line 1151

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/SOAP/Base.php on line 1176

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/Type/XSDType.php on line 97

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/Type/XSDType.php on line 110

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/Type/XSDType.php on line 112

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/Profile/Handler/Array.php on line 53

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/Profile/API.php on line 256

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/Type/XSDSimpleType.php on line 69

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/Type/XSDSimpleType.php on line 71

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/Type/XSDSimpleType.php on line 98

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/Type/XSDSimpleType.php on line 111

Strict Standards: Assigning the return value of new by reference is deprecated in (...)/PayPal/Type/XSDSimpleType.php on line 113

最佳答案

我假设 PayPal Code 是您使用的 PEAR 包中的外部库,它与 5.3 Strict 不具有可比性。有很多代码存在该问题。

假设您不想更改该代码并将其提交回来 (;)),您可以做的事情不多。

说出想到的前两个:

在您的 Paypal 访问包装代码中,每次在调用之前和之后返回 E_STRICT。例如

<?php
class myPayPalWrapper {
public function doX() {
$x = error_reporting(E_ALL & ~E_STRICT); # or something
$this->externalPaypalClass->doX();
error_reporting($x);
}
}

看起来不太漂亮,需要大量代码。

如果您已经在您的项目中使用自定义错误处理程序,您可以扩展它以过滤掉该库的所有错误。例如

<?php
function myErrorHandler($iErrno, $sErrstr, $sErrfile, $iErrline) {
if(error_reporting() & $iErrno) {
if(strpos("libFolder/paypal", $sErrfile) !== false) {
return true;
}
}
return false;
}

希望对你有帮助

关于php - PHP 5.3.1 上的 Paypal 错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3345458/

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