英文:
I can not understand the definition of App:: in php
问题
我是一名系统管理员,想要修复我们网站上使用CMS制作的一个回调脚本。
经过多个小时的研究,我清楚地确定问题出在以下这段代码上:
$invoiceId = (int) App::getFromRequest("invoiceid");
$postData = [];
$postData["VPSTxId"] = App::getFromRequest("threeDSSessionData");
if (App::getFromRequest("cres")) {
$postData["CRes"] = App::getFromRequest("cres");
} else {
if (App::getFromRequest("PaRes")) {
$postData["PARes"] = App::getFromRequest("PaRes");
$postData["MD"] = App::getFromRequest("MD");
} else {
callback3DSecureRedirect($invoiceId, false);
}
}
更具体地说,我认为这段代码中的以下部分未按预期工作:
App::getFromRequest
有人能解释一下PHP中的 App:: 是什么,它是如何定义的吗?
我了解 "getFromRequest" 是这个 App:: 的名称。
我在CMS代码中搜索了 App::getFromRequest,发现许多脚本都在使用它,但我找不到它的定义在哪里。
提前感谢您!
英文:
I'm a sysadmin and want to fix one callback script on our website made with CMS.
After many hours of research I clearly identified that the problem is in this code:
$invoiceId = (int) App::getFromRequest("invoiceid");
$postData = [];
$postData["VPSTxId"] = App::getFromRequest("threeDSSessionData");
if (App::getFromRequest("cres")) {
$postData["CRes"] = App::getFromRequest("cres");
} else {
if (App::getFromRequest("PaRes")) {
$postData["PARes"] = App::getFromRequest("PaRes");
$postData["MD"] = App::getFromRequest("MD");
} else {
callback3DSecureRedirect($invoiceId, false);
}
}
More specifically, I think this piece of code is not working as expected:
App::getFromRequest
Can someone explain to me what is App:: in PHP and how is defined?
I understand that "getFromRequest" is the name of this App::
I made the search about App::getFromRequest inside the CMS codes, and I found that many scripts use this, but I can not find where is its definition.
Thank you in advance!
答案1
得分: 1
App
很可能是一个自定义类。以下是PHP文档中编写类的示例:
<?php
class SimpleClass
{
// 属性声明
public $var = '默认值';
// 方法声明
public function displayVar() {
echo $this->var;
}
}
?>
在您的情况下,您应该寻找类似以下的代码:
<?php
class App
{
// 其他一些函数...
// 您需要查看的函数
public function getFromRequest() {
// 实现该函数的更多代码...
}
}
?>
英文:
App
is most likely a custom class. Here is PHP's documentation example of how to write a class:
<?php
class SimpleClass
{
// property declaration
public $var = 'a default value';
// method declaration
public function displayVar() {
echo $this->var;
}
}
?>
In your case, you should probably be looking for code that looks like this instead:
<?php
class App
{
// Some other functions...
// The function you need to look at
public function getFromRequest() {
// some more code implementing the function...
}
}
?>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论