Skip to content

Commit

Permalink
Preparing src for release 6.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fiboknacky committed Jul 1, 2015
1 parent 390a4b0 commit bb6e7f9
Show file tree
Hide file tree
Showing 249 changed files with 238,947 additions and 809 deletions.
9 changes: 9 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### 6.1.0

AdWords:
- Added support and examples for v201506.
- Added support for the new includeZeroImpressions HTTP header for reporting.

Common:
- Removed all logic handling support for PHP 5.2 as this library [no longer supports PHP 5.2](http://googleadsdeveloper.blogspot.com/2014/07/deprecating-php-52-support-for-ads-php.html).

### 6.0.0

AdWords:
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ This project hosts the PHP client library for the various SOAP-based Ads APIs
### Requirements

PHP
- [PHP 5.2.x - 5.4.x](http://php.net)
- [PHP 5.2 support will be deprecated](http://googleadsdeveloper.blogspot.com/2014/07/deprecating-php-52-support-for-ads-php.html) on January 1st, 2015.
- [PHP 5.3 and higher](http://php.net/supported-versions.php)
- Required PHP extensions:
- [SoapClient](http://us3.php.net/manual/en/book.soap.php) (--enable-soap)
- [OpenSSL](http://php.net/manual/en/book.openssl.php) (--with-ssl)
Expand Down
12 changes: 0 additions & 12 deletions build_lib/Wsdl2PhpTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,18 @@ class Wsdl2PhpTask extends Task {
/**
* The URL passed in the buildfile for the WSDL.
* @var string the URL of the WSDL
* @access private
*/
private $url = NULL;

/**
* The SOAP client classname of the API.
* @var string the SoapClient class extension to extend
* @access private
*/
private $soapClientClassName = NULL;

/**
* The SOAP client class path of the API.
* @var string the path of the SoapClient class extension to extend
* @access private
*/
private $soapClientClassPath = NULL;

Expand All @@ -57,22 +54,19 @@ class Wsdl2PhpTask extends Task {
* from the current directory from which the task is called, or an
* absolute path.
* @var string the output directory of the task
* @access private
*/
private $outputDir = NULL;

/**
* The classmap of 'Wsdl Type => PHP Class' for the WSDL.
* @var array the classmap for the WSDL type to PHP class
* @access private
*/
private $classmap = NULL;

/**
* A classmap of 'Wsdl Type => PHP Class' for the WSDL, to be used
* to avoid class name conflicts when namespaces are not enabled.
* @var array the classmap for the WSDL type to PHP class
* @access private
*/
private $conflictClassmap = NULL;

Expand All @@ -81,43 +75,37 @@ class Wsdl2PhpTask extends Task {
* uniqueness. This option will be ignored when namespaces are enabled.
* @var array the WSDL types that shouldn't have their class names checked for
* uniqueness.
* @access private
*/
private $skipClassNameCheckTypes = NULL;

/**
* The name of the service being worked on.
* @var string the name of the service being worked on
* @access private
*/
private $serviceName = NULL;

/**
* The version of the service being worked on
* @var string the version of the service being worked
* @access private
*/
private $version = NULL;

/**
* The package name to be included in the file header.
* @var string the package name to be included in the file header
* @access private
*/
private $package = NULL;

/**
* The proxy URL to use when downloading WSDLs.
* @var string the proxy URL to use when downloading WSDLs
* @access private
*/
private $proxy = NULL;

/**
* Whether or not to enable namespaces in the generated class names.
* @var boolean whether or not to enable namespaces in the generated
* class names
* @access private
*/
private $enableNamespaces = FALSE;

Expand Down
18 changes: 1 addition & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "googleads/googleads-php-lib",
"description": "Google Ads APIs Client Library for PHP (AdWords, Adx, and DFP)",
"require": {
"php": ">=5.2.0"
"php": ">=5.3.0"
},
"type": "library",
"homepage": "https://github.com/googleads/googleads-php-lib",
Expand All @@ -15,25 +15,9 @@
]
},
"authors": [
{
"name": "Paul Matthews",
"role": "Developer"
},
{
"name": "Adam Rogal",
"role": "Developer"
},
{
"name": "Mat Scales",
"role": "Developer"
},
{
"name": "Vincent Tsao",
"role": "Developer"
},
{
"name": "Ray Tsang",
"role": "Developer"
}
]
}
4 changes: 2 additions & 2 deletions examples/AdWords/Auth/GetRefreshToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
* @return array the user's OAuth 2 credentials
*/
function GetOAuth2Credential($user) {
$redirectUri = NULL;
$offline = TRUE;
$redirectUri = null;
$offline = true;
// Get the authorization URL for the OAuth2 token.
// No redirect URL is being used since this is an installed application. A web
// application would pass in a redirect URL back to the application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function GetAccountHierarchyExample(AdWordsUser $user) {
}
// Create map from customerID to account, and find root account.
$accounts = array();
$rootAccount = NULL;
$rootAccount = null;
foreach ($graph->entries as $account) {
$accounts[$account->customerId] = $account;
if (!array_key_exists($account->customerId, $parentLinks)) {
Expand All @@ -78,7 +78,7 @@ function GetAccountHierarchyExample(AdWordsUser $user) {
}
// Display account tree.
print "(Customer Id, Account Name)\n";
DisplayAccountTree($rootAccount, NULL, $accounts, $childLinks, 0);
DisplayAccountTree($rootAccount, null, $accounts, $childLinks, 0);
} else {
print "No serviced accounts were found.\n";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
// which the manager has access. See the location extensions guide at
// https://developers.google.com/adwords/api/docs/guides/feed-services-locations
// for details.
define('BUSINESS_ACCOUNT_IDENTIFIER', NULL);
define('BUSINESS_ACCOUNT_IDENTIFIER', null);

// The placeholder type for location extensions.
// See the Placeholder reference page for a list of all the placeholder types
Expand Down Expand Up @@ -132,7 +132,7 @@ function AddGoogleMyBusinessLocationExtensions(
// not be available for usage in a CustomerFeed until the sync between the
// AdWords and GMB accounts completes. The loop below will retry adding
// the CustomerFeed up to ten times with an exponential back-off policy.
$addedCustomerFeed = NULL;
$addedCustomerFeed = null;
$numberOfAttempts = 0;
do {
$numberOfAttempts++;
Expand All @@ -151,7 +151,7 @@ function AddGoogleMyBusinessLocationExtensions(
sleep($sleepSeconds);
}
} while ($numberOfAttempts < MAX_CUSTOMER_FEED_ADD_ATTEMPTS
&& $addedCustomerFeed == NULL);
&& $addedCustomerFeed == null);

if($addedCustomerFeed == null) {
throw new Exception('Could not create the CustomerFeed after '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
// Include the initialization file
require_once dirname(dirname(__FILE__)) . '/init.php';

// Enter budgetId required by the code example, or leave as NULL to create one.
$budgetId = NULL;
// Enter budgetId required by the code example, or leave as null to create one.
$budgetId = null;

/**
* Runs the example.
Expand All @@ -42,7 +42,7 @@
* to create a new one
*/
function UseSharedBiddingStrategyExample(AdWordsUser $user,
$sharedBudgetId = NULL) {
$sharedBudgetId = null) {
$biddingStrategy = CreateBiddingStrategy($user);

if (!$sharedBudgetId) {
Expand Down
4 changes: 2 additions & 2 deletions examples/AdWords/v201409/BasicOperations/AddAdGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ function AddAdGroupsExample(AdWordsUser $user, $campaignId) {
// Restricting to serve ads that match your ad group placements.
// This is equivalent to choosing "Target and bid" in the UI.
$targetingSetting->details[] =
new TargetingSettingDetail('PLACEMENT', FALSE);
new TargetingSettingDetail('PLACEMENT', false);
// Using your ad group verticals only for bidding. This is equivalent
// to choosing "Bid only" in the UI.
$targetingSetting->details[] =
new TargetingSettingDetail('VERTICAL', TRUE);
new TargetingSettingDetail('VERTICAL', true);
$adGroup->settings[] = $targetingSetting;

// Create operation.
Expand Down
8 changes: 4 additions & 4 deletions examples/AdWords/v201409/BasicOperations/AddCampaigns.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ function AddCampaignsExample(AdWordsUser $user) {

// You can optionally provide a bidding scheme in place of the type.
$biddingScheme = new ManualCpcBiddingScheme();
$biddingScheme->enhancedCpcEnabled = FALSE;
$biddingScheme->enhancedCpcEnabled = false;
$biddingStrategyConfiguration->biddingScheme = $biddingScheme;

$campaign->biddingStrategyConfiguration = $biddingStrategyConfiguration;

// Set network targeting (optional).
$networkSetting = new NetworkSetting();
$networkSetting->targetGoogleSearch = TRUE;
$networkSetting->targetSearchNetwork = TRUE;
$networkSetting->targetContentNetwork = TRUE;
$networkSetting->targetGoogleSearch = true;
$networkSetting->targetSearchNetwork = true;
$networkSetting->targetContentNetwork = true;
$campaign->networkSetting = $networkSetting;

// Set additional settings (optional).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ function AddKeywordsInBulkExample(AdWordsUser $user, $adGroupId) {
// Create a selector for retrieving the job status and later its results.
$selector = new BulkMutateJobSelector();
$selector->jobIds[] = $job->id;
$selector->includeStats = TRUE;
$selector->includeHistory = TRUE;
$selector->includeStats = true;
$selector->includeHistory = true;

$numRetries = 0;
$maxRetries = 100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function ValidateTextAdExample(AdWordsUser $user, $adGroupId) {
// Get the service, which loads the required classes. Passing true for the
// parameter $validateOnly will ensure that ads aren't created.
$adGroupAdValidationService =
$user->GetService('AdGroupAdService', ADWORDS_VERSION, NULL, NULL, TRUE);
$user->GetService('AdGroupAdService', ADWORDS_VERSION, null, null, true);

// Create invalid text ad.
$textAd = new TextAd();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function HandlePartialFailuresExample(AdWordsUser $user, $adGroupId) {
// Get the service, which loads the required classes. Passing true for the
// parameter $partialFailure enables partial failure behavior.
$adGroupCriterionService = $user->GetService('AdGroupCriterionService',
ADWORDS_VERSION, NULL, NULL, NULL, TRUE);
ADWORDS_VERSION, null, null, null, true);

// Create keywords.
$keywords = array();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function HandlePolicyViolationErrorExample(AdWordsUser $user, $adGroupId) {

// Get validateOnly version of the AdGroupAdService.
$adGroupAdValidationService =
$user->GetService('AdGroupAdService', ADWORDS_VERSION, NULL, NULL, TRUE);
$user->GetService('AdGroupAdService', ADWORDS_VERSION, null, null, true);

// Create text ad that violates an exemptable policy. This ad will only
// trigger an error in the production environment.
Expand Down
2 changes: 1 addition & 1 deletion examples/AdWords/v201409/Express/AddPromotion.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function AddPromotionExample(AdWordsUser $user, $businessId) {
$marsTourPromotion->status = 'PAUSED';
$marsTourPromotion->destinationUrl = 'http://www.example.com';
$marsTourPromotion->budget = $budget;
$marsTourPromotion->callTrackingEnabled = TRUE;
$marsTourPromotion->callTrackingEnabled = true;

// Criteria
$criteria = array();
Expand Down
2 changes: 1 addition & 1 deletion examples/AdWords/v201409/Express/GetBudgetSuggestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function GetBudgetSuggestionExample(AdWordsUser $user) {
toString($budgetSuggestion->cpc),
$budgetSuggestion->impressions);

if ($budgetSuggestion->budgetQuantiles !== NULL
if ($budgetSuggestion->budgetQuantiles !== null
&& sizeof($budgetSuggestion->budgetQuantiles) > 0) {
print(" Budget quantiles:\n");
foreach ($budgetSuggestion->budgetQuantiles as $i => $budgetQuantile) {
Expand Down
2 changes: 1 addition & 1 deletion examples/AdWords/v201409/Express/GetExpressBusinesses.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function GetExpressBusinessesExample(AdWordsUser $user) {
// Display results.
if (isset($page->entries)) {
foreach ($page->entries as $business) {
$address = $business->address !== NULL ?
$address = $business->address !== null ?
$business->address :
new Address();
$geoPoint = $business->geoPoint;
Expand Down
2 changes: 1 addition & 1 deletion examples/AdWords/v201409/Migration/UpgradeAdUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function UpgradeAdUrlExample(AdWordsUser $user, $adGroupId, $adId) {
// Get the service, which loads the required classes.
$adGroupAdService = $user->GetService('AdGroupAdService', ADWORDS_VERSION);

$adGroupAd = NULL;
$adGroupAd = null;

// Retrieving the ad first.
$selector = new Selector();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function EstimateKeywordTrafficExample(AdWordsUser $user) {
foreach ($negativeKeywords as $negativeKeyword) {
$keywordEstimateRequest = new KeywordEstimateRequest();
$keywordEstimateRequest->keyword = $negativeKeyword;
$keywordEstimateRequest->isNegative = TRUE;
$keywordEstimateRequest->isNegative = true;
$keywordEstimateRequests[] = $keywordEstimateRequest;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function AddConversionTrackerExample(AdWordsUser $user) {
$conversionTracker->status = 'ENABLED';
$conversionTracker->category = 'DEFAULT';
$conversionTracker->viewthroughLookbackWindow = 15;
$conversionTracker->isProductAdsChargeable = TRUE;
$conversionTracker->isProductAdsChargeable = true;
$conversionTracker->productAdsChargeableConversionWindow = 15;
$conversionTracker->markupLanguage = 'HTML';
$conversionTracker->textFormat = 'HIDDEN';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function DownloadCriteriaReportExample(AdWordsUser $user, $filePath) {
$reportDefinition->downloadFormat = 'CSV';

// Exclude criteria that haven't recieved any impressions over the date range.
$reportDefinition->includeZeroImpressions = FALSE;
$reportDefinition->includeZeroImpressions = false;

// Set additional options.
$options = array('version' => ADWORDS_VERSION);
Expand Down
14 changes: 7 additions & 7 deletions examples/AdWords/v201502/AccountManagement/GetAccountChanges.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* @copyright 2014, Google Inc. All Rights Reserved.
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License,
* Version 2.0
* @author Eric Koleda
* @author Thanet Knack Praneenararat
*/

// Include the initialization file
Expand Down Expand Up @@ -82,12 +82,12 @@ function GetAccountChangesExample(AdWordsUser $user) {
if ($campaignChangeData->campaignChangeStatus != 'NEW') {
printf("\tAdded ad extensions: %s\n",
ArrayToString($campaignChangeData->addedAdExtensions));
printf("\tDeleted ad extensions: %s\n",
ArrayToString($campaignChangeData->deletedAdExtensions));
printf("\tRemoved ad extensions: %s\n",
ArrayToString($campaignChangeData->removedAdExtensions));
printf("\tAdded campaign criteria: %s\n",
ArrayToString($campaignChangeData->addedCampaignCriteria));
printf("\tDeleted campaign criteria: %s\n",
ArrayToString($campaignChangeData->deletedCampaignCriteria));
printf("\tRemoved campaign criteria: %s\n",
ArrayToString($campaignChangeData->removedCampaignCriteria));
if (isset($campaignChangeData->changedAdGroups)) {
foreach($campaignChangeData->changedAdGroups as
$adGroupChangeData) {
Expand All @@ -99,8 +99,8 @@ function GetAccountChangesExample(AdWordsUser $user) {
ArrayToString($adGroupChangeData->changedAds));
printf("\t\tChanged criteria: %s\n",
ArrayToString($adGroupChangeData->changedCriteria));
printf("\t\tDeleted criteria: %s\n",
ArrayToString($adGroupChangeData->deletedCriteria));
printf("\t\tRemoved criteria: %s\n",
ArrayToString($adGroupChangeData->removedCriteria));
}
}
}
Expand Down
Loading

0 comments on commit bb6e7f9

Please sign in to comment.