一个 reddit-php-sdk 方法不输出任何东西 [英] a reddit-php-sdk method not outputting anything

查看:47
本文介绍了一个 reddit-php-sdk 方法不输出任何东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习 reddit 代码并使用这个 https://github.com/jcleblanc/reddit-php-sdk

I'm trying to learn reddit code and using this https://github.com/jcleblanc/reddit-php-sdk

这个库中有一个方法 $reddit->getUser() 总是输出 null.不过,其他一切似乎都在起作用.

There's a method in this library $reddit->getUser() which outputs null always. Everything else seems to be working though.

include_once("jcleblanc-reddit-php-sdk-4a4cc32/reddit.php");
$reddit = new reddit("my-username", "my-password");
$userData = $reddit->getUser();
var_dump($userData);

输出 null.

$response = $reddit->getListing("all", 5);
var_dump($response);

输出符合预期.那么 $reddit->getUser() 会出什么问题?

outputs what's expected just fine. Then what could be going wrong with $reddit->getUser()?

推荐答案

这是 Jonathan LeBlanc,我创建了那个库.我现在正在运行测试,但似乎没有看到相同的问题.这是我在库中运行的代码:

this is Jonathan LeBlanc, I created that library. I'm running tests right now and I don't seem to be seeing the same issues. This is the code I'm running with the library:

<?php
require_once("reddit.php");

$reddit = new reddit("USERNAME", "PASSWORD");
var_dump($reddit->getUser());
?>

运行时,我看到我的用户数据对象正在通过.您是否仍然遇到此问题?

When running that, I am seeing my user data object coming through. Are you still experiencing this issue?

  • 乔恩

这篇关于一个 reddit-php-sdk 方法不输出任何东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆