草庐IT

PERFORM_API_CALL

全部标签

php - fatal error : Call to a member function getAttributes() on array

我一直在做这个google身份验证教程,以更好地了解如何使用googlesigninapi,但我最近收到了这个错误:Fatalerror:CalltoamemberfunctiongetAttributes()onarray.每当我尝试:$this->client->verifyIdToken()->getAttributes();在getPayload()函数中。我不知道为什么会这样。我的配置是Windows10,我正在使用WAMP服务器来运行这个应用程序。任何帮助将不胜感激。client=$googleClient;$this->client->setClientId('234sf

php - API Platform v1.1.1 & Symfony 3.2.8 composer 冲突

我有SymfonyDemoApplication启动并运行,现在我正在尝试installAPIPlatformasastandalonebundle.我使用的是PHP7.0.10和最新的composer,但我之前的测试使用的是PHP5.6.20。当我尝试将APIPlatformCore添加为依赖项时,我收到以下错误消息:$composerrequireapi-platform/coreUsingversion^1.1forapi-platform/core./composer.jsonhasbeenupdatedLoadingcomposerrepositorieswithpackag

php - SimpleHTMLDom : Call to a member function find() on array

所以我想在大型html页面中循环遍历特定的TD。我正在使用simplehtmldom来实现这一目标。问题是如果不把每一步都放在foreach中,我就无法让它工作。这是我的phpinclude('../inc/simple_html_dom.php');$html=file_get_html("http://www.bjork-family.com/f43-london-stories");//IjustputthedomofpagebodyintoTEST$test=$html->find('#page-body');foreach($test->find('img')as$eleme

php - Woocommerce 订单休息 API : Add a coupon code

我访问过TheofficialWooCommerceRestAPIdocumentation"CreateanOrder"section.我正在尝试通过API创建订单,但是当我想使用应用优惠券创建订单时,我不知道如何制作。当我通过RESTAPI创建订单时,如何传递优惠券代码作为折扣?在相关的官方文档中,我没有找到任何传递优惠券代码或折扣的请求参数。请建议在WooCommerce中通过restAPI创建订单时如何传递优惠券代码。 最佳答案 您应该需要在数据数组中添加'coupon_lines',例如:'coupon_lines'=>[

php - 登录后的 Paypal API 重定向到空白屏幕

我已经整合了LaravelPaypalIntegration并按照所有步骤集成expresscheckout。当我运行该应用程序时,它会显示以下2个屏幕:登录后,我只能看到这个页面,什么都没有。任何人猜测可能是什么问题?注意:这是沙箱 最佳答案 Thislinkmaybeofsomehelptoyou.确保您的沙盒帐户适用于美国,而不是印度或其他国家。另一件要尝试的事情是确保您的“模式”在config/config.php中设置为live.return['mode'=>'live',//Canonlybe'sandbox'Or'li

php - 拉维尔 5.4 : JWT API with multi-auth on two tables one works the other not

我正在使用...Laravel5.4tymon/jwt-auth:1.0.0-rc.2我有两个身份验证API的应用程序,一个是customers另一个是drivers每个人都有自己的table。现在让我简单描述一下JWT软件包安装和我对其进行的更新。我按照JWT中的描述安装了包准确记录。现在谈到quickstart在这里我更新了两个Models一个是User第二个Driver.来到这里ConfigureAuthguard我再次使用了两个guards的配置让我展示一下我的auth.php的快照.'defaults'=>['guard'=>'api','passwords'=>'users

php - Api 平台 : Eager Loading a Subresource

大家好,我刚开始使用Api-Platform,我被这个问题困了几个小时。我有一个Symfony4项目和两个实体:Bill&Abo比尔:/***@ORM\Entity(repositoryClass="App\Repository\BillRepository")*@ApiResource*/classBill{/***@ORM\Id*@ORM\GeneratedValue*@ORM\Column(type="integer")*/private$id;/***@var\DateTime**@ORM\Column(name="date",type="date",nullable=fals

PHP 7.2.7 : Attempted to call an undefined method named "setEncryptionName" of class "ZipArchive"

我正在尝试使用PHP7.2.7创建一个加密的、受密码保护的ZIP文件。但是,我收到以下错误消息:Attemptedtocallanundefinedmethodnamed"setEncryptionName"ofclass"ZipArchive".http://php.net/manual/en/ziparchive.setencryptionname.php如果我删除$zip->setEncryptionName()那么一切都会100%,除了ZIP文件没有密码保护。我在Google和论坛上进行了搜索,但找不到遇到过类似问题的人,可能是因为PHP版本和功能仍然太新。

PHP:将 POST 请求 curl 到外部 Oauth2 API

我将尝试勾画我们的情况:我们有一个需要连接到Oath2API的Wordpress网站我还没有使用API和PHP的经验我们使用的是PHP-Oath2库,可以在这里找到:https://github.com/adoy/PHP-OAuth2/tree/master/src/OAuth2我们陷入困境的库中的方法是executeRequest。这个方法可以在https://github.com/adoy/PHP-OAuth2/blob/master/src/OAuth2/Client.php的第404行(哦,讽刺)上找到。现在,就像我说的,我在PHP方面的经验很少,所以我的调试方式只是在脚本中的

php - Laravel - 如何递归地将 API 资源转换为数组?

我正在使用LaravelAPIResource并希望将我的实例的所有部分转换为数组。在我的PreorderResource.php中:/***Transformtheresourceintoanarray.**@param\Illuminate\Http\Request*@returnarray*/publicfunctiontoArray($request){return['id'=>$this->id,'exception'=>$this->exception,'failed_at'=>$this->failed_at,'driver'=>newDriverResource($th