All Projects → platformsh → platformsh-client-php

platformsh / platformsh-client-php

Licence: MIT license
Platform.sh API client for PHP

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to platformsh-client-php

sevenbridges-python
SevenBridges Python Api bindings
Stars: ✭ 41 (+70.83%)
Mutual labels:  api-client
mercury-parserpy
python api wrapper for https://mercury.postlight.com/web-parser/
Stars: ✭ 16 (-33.33%)
Mutual labels:  api-client
SketchwareAPI
Sketchware API Multiplatform Library
Stars: ✭ 26 (+8.33%)
Mutual labels:  api-client
deepl-api-connector
Connector library for deepl.com rest translation api
Stars: ✭ 12 (-50%)
Mutual labels:  api-client
ninja automator
Acquire data with honour and wisdom — using the way of the ninja.
Stars: ✭ 21 (-12.5%)
Mutual labels:  api-client
pylistenbrainz
A simple ListenBrainz client library for Python
Stars: ✭ 17 (-29.17%)
Mutual labels:  api-client
airtabler
R interface to the Airtable API
Stars: ✭ 84 (+250%)
Mutual labels:  api-client
ksoftapi.py
Official API Wrapper for KSoft.Si API
Stars: ✭ 31 (+29.17%)
Mutual labels:  api-client
pycloud
A Python implementation of the pCloud API
Stars: ✭ 54 (+125%)
Mutual labels:  api-client
InstaLite
Instagram api not official easy-to-use class, minimal number of features
Stars: ✭ 72 (+200%)
Mutual labels:  api-client
jusibe
📲 JavaScript client for Jusibe.com SMS API service. http://jusibe.com
Stars: ✭ 24 (+0%)
Mutual labels:  api-client
transip-api
Python implementation for the TransIP API
Stars: ✭ 23 (-4.17%)
Mutual labels:  api-client
google-photos-api-client-go
Google photos api client in go
Stars: ✭ 35 (+45.83%)
Mutual labels:  api-client
psd2
API client for banks supporting PSD2 APIs with OAuth2 authentication.
Stars: ✭ 26 (+8.33%)
Mutual labels:  api-client
private-packagist-api-client
Private Packagist API Client
Stars: ✭ 28 (+16.67%)
Mutual labels:  api-client
notion-sdk-py
Official Notion SDK rewritten in Python (sync + async)
Stars: ✭ 753 (+3037.5%)
Mutual labels:  api-client
notion-sdk-net
A Notion SDK for .Net
Stars: ✭ 71 (+195.83%)
Mutual labels:  api-client
docker
R Package For Accessing Docker via Docker APIs
Stars: ✭ 23 (-4.17%)
Mutual labels:  api-client
ebics-java-client
Java open source EBICS client - Support for French, German and Swiss banks
Stars: ✭ 30 (+25%)
Mutual labels:  api-client
HTTPCalloutFramework
HTTP Callout Framework - A light weight callout framework for apex HTTP callouts in Salesforce
Stars: ✭ 43 (+79.17%)
Mutual labels:  api-client

Platform.sh API client

This is a PHP library for accessing the Platform.sh API.

We recommend you use the Platform.sh CLI (which uses this library) for most purposes.

Build Status

Versions

  • The 2.x branch (major version 2) requires PHP 7.2.5 and above.
  • The 1.x branch (any version < 2) supports PHP 5.5.9 and above, and uses Guzzle 5. Old PHP versions are supported by the Platform.sh CLI, which is why this branch is still maintained.

Build Status

Install

composer require platformsh/client

Usage

Example:

use Platformsh\Client\PlatformClient;

// Initialize the client.
$client = new PlatformClient();

// Set the API token to use.
//
// N.B. you must keep your API token(s) safe!
$client->getConnector()->setApiToken($myToken, 'exchange');

// Get the user's first project.
$projects = $client->getProjects();
$project = reset($projects);
if ($project) {
    // Get the default (production) environment.
    $environment = $project->getEnvironment($project->default_branch);

    // Create a new branch.
    $activity = $environment->branch('Sprint 1', 'sprint-1');

    // Wait for the activity to complete.
    $activity->wait();

    // Get the new branch.
    $sprint1 = $project->getEnvironment('sprint-1');
}

Creating a project:

use \Platformsh\Client\Model\Subscription\SubscriptionOptions;

$subscription = $client->createSubscription(SubscriptionOptions::fromArray([
    'project_region' => 'uk-1.platform.sh',
    'project_title' => 'My project',
    'plan' => 'development',
    'default_branch' => 'main',
]));

echo "Created subscription $subscription->id, waiting for it to activate...\n";

$subscription->wait();

$project = $subscription->getProject();

echo "The project is now active: $project->id\n";
echo "Git URI: " . $project->getGitUrl() . "\n";
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].