Undocumented PHP Client API Library Change for Reporting in v10.0.0

20 views
Skip to first unread message

Mark Rogoyski

unread,
Jul 6, 2016, 5:57:55 PM7/6/16
to AdWords API Forum
In the AdWords PHP Client API Library, it seems like there was a major breaking change to reporting that isn't documented in the release notes.


The change I noticed is that ReportUtils no longer uses static functions. Now you must instantiate an object before calling DownloadReport.

For example, up until v9.1.0 you could do:
ReportUtils::DownloadReport($reportDefinition, $filePath, $user, $options);

In v10.0.0, you now need to do:
$reportUtils = new ReportUtils();
$reportUtils->DownloadReport($reportDefinition, $filePath, $user, $options);

I do not see this documented anywhere, and only discovered it after code broke after updating and looking at googleads-php-lib git commits to see what had changed. This change will break everyones' reporting code and should be documented.

For reference, here are some relevant git diffs of ReportUtils.php showing the changes:

-  /**
-   * The ReportUtils class is not meant to have any instances.
-   */
-  private function __construct() {}
+  public function __construct(AdsUtilityRegistry $adsUtilityRegistry = null) {

-  public static function DownloadReport($reportDefinition, $path = null,
+  public function DownloadReport($reportDefinition, $path = null,

Mark

Anthony Madrigal

unread,
Jul 6, 2016, 6:15:18 PM7/6/16
to AdWords API Forum
Hi Mark,

Thanks for bringing this to our attention! Could you please create a new issue from this link so that we can include this in the documentation?

Cheers,
Anthony
AdWords API Team

Mark Rogoyski

unread,
Jul 6, 2016, 6:24:21 PM7/6/16
to AdWords API Forum
Hi Anthony,

Mark
Reply all
Reply to author
Forward
0 new messages