Follow these steps to fetch photos from your Google Photos account:
Create a method,
getGooglePhotos()
, in your controller that will connect to Google Photos and fetch all albums from Google Photos. This method needs to be placed in theMediaManagerController
file,src/Users/Controller/MediaManagerController.php
.Set up the API client to make use of the
Curl
request with the option to disablesslverifypeer
.$adapter = new \Zend\Http\Client\Adapter\Curl(); $adapter->setOptions(array( 'curloptions' => array( CURLOPT_SSL_VERIFYPEER => false, ) )); $httpClient = new \ZendGData\HttpClient(); $httpClient->setAdapter($adapter); $client = \ZendGData\ClientLogin::getHttpClient( self::GOOGLE_USER_ID, self::GOOGLE_PASSWORD, \ZendGData\Photos::AUTH_SERVICE_NAME, $httpClient);
Now create a new Google Photos client using the API client.
...