{"id":25677112,"url":"https://github.com/typhonius/acquia-php-sdk-v2","last_synced_at":"2025-04-04T09:09:39.494Z","repository":{"id":26516594,"uuid":"108519374","full_name":"typhonius/acquia-php-sdk-v2","owner":"typhonius","description":"A PHP SDK for Acquia Cloud API v2 https://cloud.acquia.com/api-docs/#","archived":false,"fork":false,"pushed_at":"2025-03-31T21:16:57.000Z","size":2243,"stargazers_count":23,"open_issues_count":5,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-01T22:14:50.720Z","etag":null,"topics":["acquia","acquia-api","api","cloud-api","php","php-sdk","sdk"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/typhonius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"typhonius"}},"created_at":"2017-10-27T08:20:54.000Z","updated_at":"2025-03-03T20:38:00.000Z","dependencies_parsed_at":"2024-03-25T21:33:34.164Z","dependency_job_id":"661f9616-1a6a-4c25-ad83-3dab9f458b40","html_url":"https://github.com/typhonius/acquia-php-sdk-v2","commit_stats":{"total_commits":405,"total_committers":19,"mean_commits":21.31578947368421,"dds":0.5308641975308642,"last_synced_commit":"3b12aaa26476e59f2ac43458c8647b6a59f15dcc"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typhonius%2Facquia-php-sdk-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typhonius%2Facquia-php-sdk-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typhonius%2Facquia-php-sdk-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typhonius%2Facquia-php-sdk-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typhonius","download_url":"https://codeload.github.com/typhonius/acquia-php-sdk-v2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246719642,"owners_count":20822783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acquia","acquia-api","api","cloud-api","php","php-sdk","sdk"],"created_at":"2025-02-24T14:51:42.326Z","updated_at":"2025-04-04T09:09:39.476Z","avatar_url":"https://github.com/typhonius.png","language":"PHP","funding_links":["https://github.com/sponsors/typhonius"],"categories":[],"sub_categories":[],"readme":"\nAcquia PHP SDK for CloudAPI v2\n=\n\n[![Build Status](https://github.com/typhonius/acquia-php-sdk-v2/actions/workflows/php.yml/badge.svg)](https://github.com/typhonius/acquia-php-sdk-v2/actions/workflows/php.yml)\n[![Total Downloads](https://poser.pugx.org/typhonius/acquia-php-sdk-v2/downloads.png)](https://packagist.org/packages/typhonius/acquia-php-sdk-v2)\n[![Coverage Status](https://codecov.io/gh/typhonius/acquia-php-sdk-v2/branch/master/graph/badge.svg)](https://codecov.io/gh/typhonius/acquia-php-sdk-v2)\n[![Quality Status](https://scrutinizer-ci.com/g/typhonius/acquia-php-sdk-v2/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/typhonius/acquia-php-sdk-v2/)\n[![Mutation testing badge](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Ftyphonius%2Facquia-php-sdk-v2%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/typhonius/acquia-php-sdk-v2/master)\n\n[![License](https://poser.pugx.org/typhonius/acquia-php-sdk-v2/license.png)](https://www.versioneye.com/user/projects/5a18bd670fb24f2125873c86#tab-dependencies)\n[![Latest Stable Version](https://poser.pugx.org/typhonius/acquia-php-sdk-v2/v/stable.png)](https://packagist.org/packages/typhonius/acquia-php-sdk-v2)\n[![Latest Unstable Version](https://poser.pugx.org/typhonius/acquia-php-sdk-v2/v/unstable.png)](https://packagist.org/packages/typhonius/acquia-php-sdk-v2)\n\nThis library provides the capability to develop tooling which integrates with the [new version (2.0) of Cloud API](https://cloud.acquia.com/api-docs/).\n\nThe [original Acquia Cloud SDK](https://github.com/acquia/acquia-sdk-php) has been deprecated so build tools requiring modern PHP versions and packages should use this library.\n\n## Installation\n\nThe SDK can be installed with [Composer](http://getcomposer.org) by adding this\nlibrary as a dependency to your composer.json file.\n\n```json\n{\n    \"require\": {\n        \"typhonius/acquia-php-sdk-v2\": \"^2\"\n    }\n}\n```\n\n## Generating an API access token\n\nTo generate an API access token, login to [https://cloud.acquia.com](), then visit [https://cloud.acquia.com/#/profile/tokens](), and click ***Create Token***.\n\n* Provide a label for the access token, so it can be easily identified. Click ***Create Token***.\n* The token has been generated, copy the api key and api secret to a secure place. Make sure you record it now: you will not be able to retrieve this access token's secret again.\n\n\n## Usage\n\nBasic usage examples for the SDK.\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse AcquiaCloudApi\\Connector\\Client;\nuse AcquiaCloudApi\\Connector\\Connector;\nuse AcquiaCloudApi\\Endpoints\\Applications;\nuse AcquiaCloudApi\\Endpoints\\Environments;\nuse AcquiaCloudApi\\Endpoints\\Servers;\nuse AcquiaCloudApi\\Endpoints\\DatabaseBackups;\nuse AcquiaCloudApi\\Endpoints\\Variables;\nuse AcquiaCloudApi\\Endpoints\\Account;\n\n$key = 'd0697bfc-7f56-4942-9205-b5686bf5b3f5';\n$secret = 'D5UfO/4FfNBWn4+0cUwpLOoFzfP7Qqib4AoY+wYGsKE=';\n\n$config = [\n    'key' =\u003e $key,\n    'secret' =\u003e $secret,\n];\n\n$connector = new Connector($config);\n$client = Client::factory($connector);\n\n$application = new Applications($client);\n$environment = new Environments($client);\n$server      = new Servers($client);\n$backup      = new DatabaseBackups($client);\n$variable    = new Variables($client);\n$account     = new Account($client);\n\n// Get all applications.\n$applications = $application-\u003egetAll();\n\n// Get all environments of an application.\n$environments = $environment-\u003egetAll($applicationUuid);\n\n// Get all servers in an environment.\n$servers = $server-\u003egetAll($environmentUuid);\n\n// Create DB backup\n$backup-\u003ecreate($environmentUuid, $dbName);\n\n// Set an environment varible\n$variable-\u003ecreate($environmentUuid, 'test_variable', 'test_value');\n\n// Download Drush 9 aliases to a temp directory\n$client-\u003eaddQuery('version', '9');\n$result = $account-\u003egetDrushAliases();\n$drushArchive = tempnam(sys_get_temp_dir(), 'AcquiaDrushAliases') . '.tar.gz';\nfile_put_contents($drushArchive, $aliases, LOCK_EX);\n\n// Download database backup\n// file_put_contents loads the response into memory. This is okay for small things like Drush aliases, but not for database backups.\n// Use curl.options to stream data to disk and minimize memory usage.\n$client-\u003eaddOption('sink', $filepath);\n$client-\u003eaddOption('curl.options', ['CURLOPT_RETURNTRANSFER' =\u003e true, 'CURLOPT_FILE' =\u003e $filepath]);\n$backup-\u003edownload($environmentUuid, $dbName, $backupId);\n```\n\n## Documentation\n\nDocumentation of each of the classes and methods has been automatically generated by phpDocumentor and exists in the `gh-pages` branch. [This is available for browsing on GitHub](https://typhonius.github.io/acquia-php-sdk-v2/).\n\n## I just want to talk to the API without having to write code\n\nThe [Acquia Cli Robo application](https://github.com/typhonius/acquia_cli) creates a command line tool for communicating with the API using this SDK. Its purpose is to provide a simple mechanism for interacting with the API without having to write a line of code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyphonius%2Facquia-php-sdk-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyphonius%2Facquia-php-sdk-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyphonius%2Facquia-php-sdk-v2/lists"}