常量联系人:错误消息-未定义的偏移量:cc_class.php中的1


Constant Contact: Error message - Undefined offset: 1 in cc_class.php

我使用的PHP类来自https://github.com/constantcontact/Constant-Contact-PHP-Sample-Contact-Forms将新联系人添加到常量联系人列表中,但最近我收到了PHP错误消息:

A PHP Error was encountered 
Severity: Notice 
Message: Undefined offset: 1 
Filename: cc_class.php 
Line Number: 248
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 1
Filename: cc_class.php
Line Number: 252

这些线条看起来像:

(248)

$xml = simplexml_load_string($return);

(252)

}

以及与这两条线完全相关的功能:

public  function subscriberExists($email = '') {
   $call = $this->apiPath.'/contacts?email='.$email;
   $return = $this->doServerCall($call);
   $xml = simplexml_load_string($return);
   $id = $xml->entry->id;
   if($id){ return $id; }
   else { return false; }
}

但它无论如何都会将数据传递给Constan Contact。

你知道那些错误信息是怎么回事吗?

感谢

来自GitHub 类

当尝试访问尚未定义的数组的索引。此中的代码库该应用程序相当陈旧,还没有像PHP那样更新升级。

我们建议不要使用此repo,而是使用更新的PHPSDK是面向对象的,可通过composer获得,并保持日期你绝对可以在你的环境中静音这些通知,但这种回购是不赞成的,所以这个问题不会在项目