This repository has been archived by the owner on Feb 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge with changes submitted to the ZF1 svn repository
- Loading branch information
1 parent
75d2bc7
commit eff55a7
Showing
13 changed files
with
1,184 additions
and
731 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,137 @@ | ||
<?php | ||
/** | ||
* @see Zend_Gdata | ||
*/ | ||
require_once 'Zend/Gdata.php'; | ||
|
||
/** | ||
* @see Zend_Gdata_Analytics_AccountEntry | ||
*/ | ||
require_once 'Zend/Gdata/Analytics/AccountEntry.php'; | ||
|
||
/** | ||
* @see Zend_Gdata_Analytics_AccountFeed | ||
*/ | ||
require_once 'Zend/Gdata/Analytics/AccountFeed.php'; | ||
|
||
/** | ||
* @see Zend_Gdata_Analytics_DataEntry | ||
*/ | ||
require_once 'Zend/Gdata/Analytics/DataEntry.php'; | ||
|
||
/** | ||
* @see Zend_Gdata_Analytics_DataFeed | ||
*/ | ||
require_once 'Zend/Gdata/Analytics/DataFeed.php'; | ||
|
||
/** | ||
* @see Zend_Gdata_Analytics_DataQuery | ||
*/ | ||
require_once 'Zend/Gdata/Analytics/DataQuery.php'; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_Gdata | ||
* @subpackage Analytics | ||
*/ | ||
class Zend_Gdata_Analytics extends Zend_Gdata | ||
{ | ||
|
||
const AUTH_SERVICE_NAME = 'analytics'; | ||
const ANALYTICS_FEED_URI = 'https://www.google.com/analytics/feeds'; | ||
const ANALYTICS_ACCOUNT_FEED_URI = 'https://www.google.com/analytics/feeds/accounts'; | ||
|
||
public static $namespaces = array( | ||
array('ga', 'http://schemas.google.com/analytics/2009', 1, 0) | ||
); | ||
|
||
/** | ||
* Create Zend_Gdata_Analytics object | ||
* | ||
* @param Zend_Http_Client $client (optional) The HTTP client to use when | ||
* when communicating with the Google Apps servers. | ||
* @param string $applicationId The identity of the app in the form of Company-AppName-Version | ||
*/ | ||
public function __construct($client = null, $applicationId = 'MyCompany-MyApp-1.0') | ||
{ | ||
$this->registerPackage('Zend_Gdata_Analytics'); | ||
$this->registerPackage('Zend_Gdata_Analytics_Extension'); | ||
parent::__construct($client, $applicationId); | ||
$this->_httpClient->setParameterPost('service', self::AUTH_SERVICE_NAME); | ||
} | ||
|
||
/** | ||
* Retrieve account feed object | ||
* | ||
* @return Zend_Gdata_Analytics_AccountFeed | ||
*/ | ||
public function getAccountFeed() | ||
{ | ||
$uri = self::ANALYTICS_ACCOUNT_FEED_URI . '/default?prettyprint=true'; | ||
return parent::getFeed($uri, 'Zend_Gdata_Analytics_AccountFeed'); | ||
} | ||
|
||
/** | ||
* Retrieve data feed object | ||
* | ||
* @param mixed $location | ||
* @return Zend_Gdata_Analytics_DataFeed | ||
*/ | ||
public function getDataFeed($location) | ||
{ | ||
if ($location == null) { | ||
$uri = self::ANALYTICS_FEED_URI; | ||
} elseif ($location instanceof Zend_Gdata_Query) { | ||
$uri = $location->getQueryUrl(); | ||
} else { | ||
$uri = $location; | ||
} | ||
return parent::getFeed($uri, 'Zend_Gdata_Analytics_DataFeed'); | ||
} | ||
|
||
/** | ||
* Returns a new DataQuery object. | ||
* | ||
* @return Zend_Gdata_Analytics_DataQuery | ||
*/ | ||
public function newDataQuery($profileId=null) | ||
{ | ||
return new Zend_Gdata_Analytics_DataQuery($profileId); | ||
} | ||
} | ||
<?php | ||
/** | ||
* Zend Framework | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the new BSD license that is bundled | ||
* with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://framework.zend.com/license/new-bsd | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to license@zend.com so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Gdata | ||
* @subpackage Analytics | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @version $Id$ | ||
*/ | ||
|
||
/** | ||
* @see Zend_Gdata | ||
*/ | ||
require_once 'Zend/Gdata.php'; | ||
|
||
/** | ||
* @see Zend_Gdata_Analytics_AccountEntry | ||
*/ | ||
require_once 'Zend/Gdata/Analytics/AccountEntry.php'; | ||
|
||
/** | ||
* @see Zend_Gdata_Analytics_AccountFeed | ||
*/ | ||
require_once 'Zend/Gdata/Analytics/AccountFeed.php'; | ||
|
||
/** | ||
* @see Zend_Gdata_Analytics_DataEntry | ||
*/ | ||
require_once 'Zend/Gdata/Analytics/DataEntry.php'; | ||
|
||
/** | ||
* @see Zend_Gdata_Analytics_DataFeed | ||
*/ | ||
require_once 'Zend/Gdata/Analytics/DataFeed.php'; | ||
|
||
/** | ||
* @see Zend_Gdata_Analytics_DataQuery | ||
*/ | ||
require_once 'Zend/Gdata/Analytics/DataQuery.php'; | ||
|
||
/** | ||
* @see Zend_Gdata_Analytics_AccountQuery | ||
*/ | ||
require_once 'Zend/Gdata/Analytics/AccountQuery.php'; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_Gdata | ||
* @subpackage Analytics | ||
*/ | ||
class Zend_Gdata_Analytics extends Zend_Gdata | ||
{ | ||
|
||
const AUTH_SERVICE_NAME = 'analytics'; | ||
const ANALYTICS_FEED_URI = 'https://www.googleapis.com/analytics/v2.4/data'; | ||
const ANALYTICS_ACCOUNT_FEED_URI = 'https://www.googleapis.com/analytics/v2.4/management/accounts'; | ||
|
||
public static $namespaces = array( | ||
array('analytics', 'http://schemas.google.com/analytics/2009', 1, 0), | ||
array('ga', 'http://schemas.google.com/ga/2009', 1, 0) | ||
); | ||
|
||
/** | ||
* Create Gdata object | ||
* | ||
* @param Zend_Http_Client $client | ||
* @param string $applicationId The identity of the app in the form of | ||
* Company-AppName-Version | ||
*/ | ||
public function __construct($client = null, $applicationId = 'MyCompany-MyApp-1.0') | ||
{ | ||
$this->registerPackage('Zend_Gdata_Analytics'); | ||
$this->registerPackage('Zend_Gdata_Analytics_Extension'); | ||
parent::__construct($client, $applicationId); | ||
$this->_httpClient->setParameterPost('service', self::AUTH_SERVICE_NAME); | ||
} | ||
|
||
/** | ||
* Retrieve account feed object | ||
* | ||
* @param string|Zend_Uri_Uri $uri | ||
* @return Zend_Gdata_Analytics_AccountFeed | ||
*/ | ||
public function getAccountFeed($uri = self::ANALYTICS_ACCOUNT_FEED_URI) | ||
{ | ||
if ($uri instanceof Query) { | ||
$uri = $uri->getQueryUrl(); | ||
} | ||
return parent::getFeed($uri, 'Zend_Gdata_Analytics_AccountFeed'); | ||
} | ||
|
||
/** | ||
* Retrieve data feed object | ||
* | ||
* @param string|Zend_Uri_Uri $uri | ||
* @return Zend_Gdata_Analytics_DataFeed | ||
*/ | ||
public function getDataFeed($uri = self::ANALYTICS_FEED_URI) | ||
{ | ||
if ($uri instanceof Query) { | ||
$uri = $uri->getQueryUrl(); | ||
} | ||
return parent::getFeed($uri, 'Zend_Gdata_Analytics_DataFeed'); | ||
} | ||
|
||
/** | ||
* Returns a new DataQuery object. | ||
* | ||
* @return Zend_Gdata_Analytics_DataQuery | ||
*/ | ||
public function newDataQuery() | ||
{ | ||
return new Zend_Gdata_Analytics_DataQuery(); | ||
} | ||
|
||
/** | ||
* Returns a new AccountQuery object. | ||
* | ||
* @return Zend_Gdata_Analytics_AccountQuery | ||
*/ | ||
public function newAccountQuery() | ||
{ | ||
return new Zend_Gdata_Analytics_AccountQuery(); | ||
} | ||
} |
Oops, something went wrong.