platformsh / platformsh-client-php

Platform.sh API client for PHP
https://platform.sh
MIT License
25 stars 27 forks source link

$env->getBackups() Fatal Error: ApiResourceBase not found #33

Closed mikemilano closed 5 years ago

mikemilano commented 5 years ago

I'm trying to get a list of backups but I am getting a fatal error when running getBackups() on the environment object.

To remove the chance the issue is somewhere else in my app, I reproduced the issue based on the example in the README.

The code below throws the following error:

Fatal error: Class 'Platformsh\Client\Model\ApiResourceBase' not found in /Users/mmilano/projects/myproject/vendor/platformsh/client/src/Model/Backup.php on line 18

<?php
use Platformsh\Client\PlatformClient;

// Initialize the client.
$client = new PlatformClient();
$client->getConnector()->setApiToken($myToken, 'exchange');
$projects = $client->getProjects();
if ($projects) {
    $firstProject = reset($projects);
    $master = $firstProject->getEnvironment('master');
    $backups = $master->getBackups(1);
}
mikemilano commented 5 years ago

Fix confirmed. I ran a composer update and was able to retrieve backups. Thx @pjcdawkins !