我使用Laravel,将db行加载到Eloquent对象中.其中一列是longtext,一个JSON编码的数组> 200万个字符长.我得到的原始错误是json_decode在此列的值上失败.
我在修补中测试过.简化的测试代码:
$item = Item::find(1);
echo $item->long_text_field;
var_dump(json_decode($item->long_text_field));
echo strlen($item->long_text_field);
Run Code Online (Sandbox Code Playgroud)
在我的本地vagrant实例上,它显示正确的值.
...long json array in text, same as the value in the actual DB entry...
...var_dump of json array...
2334040
Run Code Online (Sandbox Code Playgroud)
但是在我的远程开发服务器上我得到了
...long json array truncated in the middle...
NULL
1048576
Run Code Online (Sandbox Code Playgroud)
显然json_decode失败了,因为字符串被截断了.
它截断了这样的一块
"Eff Date":"1\”
Run Code Online (Sandbox Code Playgroud)
应该是哪个
"Eff Date":"1\/30\/14 16:13”
Run Code Online (Sandbox Code Playgroud)
从长远来看,这里有很多逃脱的斜线,在这一点上我看不到任何奇怪的角色.有没有人知道为什么这个文本会在一台服务器而不是另一台服务器上截断?
我正在用他们的 V2 API 替换我们的 LinkedIn V1 API 集成,特别是这里描述的公司页面端点:
我有一个已批准的应用程序和一个具有所有这些范围的令牌: r_ads r_ads_reporting r_basicprofile r_organization_social rw_organization_admin w_member_social w_organization_social w_share
上面列出的所有前几个 v2 端点都可以正常工作(获取公司简介、更新),但是一旦我添加了它们的特定 timeInterval 参数,我就会收到此 403 错误:
Unpermitted fields present in PARAMETER: Data Processing Exception while processing fields [/timeIntervals.timeGranularityType, /timeIntervals.timeRange.end, /timeIntervals.timeRange.start]
Run Code Online (Sandbox Code Playgroud)
403 意味着拒绝访问,但我的令牌肯定包括他们提到的公司页面 API 所需的特定范围。我在这里缺少什么?
具体示例:Headers: Authorization: Bearer XXXXX X-Restli-Protocol-Version: 2.0.0
端点:https : //api.linkedin.com/v2/organizationalEntityShareStatistics? q = organizationalEntity & organizationalEntity = urn%3Ali%3Aorganization%3AXXXXX & timeIntervals.timeGranularityType = DAY & timeIntervals.timeRange.start = 1548892800000.time1Range.start = 1548892800000 &time1Range800000
如果我删除所有 timeInterval 参数它工作正常,但我希望获得我们每月社交报告的历史数据。