Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

WIP: Upgrade to Guzzle 5 #69

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

webbj74
Copy link
Contributor

@webbj74 webbj74 commented May 8, 2015

This is a work in progress, mostly concentrated on CloudApiClient. I've tested a handful of the CloudApiClient "read-only" API methods against a live site and those are all behaving as expected. I have not tested any task-initiating API methods. I've tried to keep things as backward compatible as possible.

To do:

  • test task-initiating CloudApiClient methods
  • need to update Acquia\Network\AcquiaNetworkClient
  • need to update Acquia\Search\AcquiaSearchClient
  • phpunit tests need to be rewritten for Guzzle 5
  • sub-project composer.jsons needs to updated

This is the same version of Guzzle used in [Drupal 8.0.0-beta10](http://cgit.drupalcode.org/drupal/tree/core/composer.json?id=8.0.0-beta10#n23).

    $ composer require "guzzlehttp/guzzle:~5.0"
    ./composer.json has been updated
    Loading composer repositories with package information
    Initializing PEAR repository http://pear.php.net
    Updating dependencies (including require-dev)
      - Installing react/promise (v2.2.0)
        Loading from cache

      - Installing guzzlehttp/streams (3.0.0)
        Loading from cache

      - Installing guzzlehttp/ringphp (1.0.7)
        Loading from cache

      - Installing guzzlehttp/guzzle (5.2.0)
        Loading from cache

    Writing lock file
    Generating autoload files
PHP 5.4 is the minimum requirement for the following:

- guzzle 5.2.0
- ringphp 1.0.7
- streams 3.0.0
- phploc 2.1.1
- promise v2.2.0

    $ find vendor -name composer.json -exec grep -o ".\bphp\b.:.*" {} \; | sort -u
    "php": ">=5.2.3"
    "php": ">=5.3",
    "php": ">=5.3.0"
    "php": ">=5.3.0",
    "php": ">=5.3.2"
    "php": ">=5.3.2",
    "php": ">=5.3.3"
    "php": ">=5.3.3",
    "php": ">=5.4",
    "php": ">=5.4.0"
    "php": ">=5.4.0",

    $ find vendor -name composer.json -exec grep -H ".\bphp\b.:.*5\.4" {} \; | sort -u
    vendor/guzzlehttp/guzzle/composer.json:        "php": ">=5.4.0",
    vendor/guzzlehttp/ringphp/composer.json:        "php": ">=5.4.0",
    vendor/guzzlehttp/streams/composer.json:        "php": ">=5.4.0"
    vendor/phploc/phploc/composer.json:        "php": ">=5.4",
    vendor/react/promise/composer.json:        "php": ">=5.4.0"

This commit also removes the php 5.3 test environment from Travis CI.
…\Response as a constructor arg for acquia#54.

This is a backward-compatible modification to Acquia\Rest\Collection and Acquia\Rest\Element so that the constructor may be used interchangeably with Guzzle 3.x and higher. Since guzzle isn't strictly required for the acquia/acquia-sdk-php-rest sub-package, I've added the old and present versions of Guzzle as composer suggestions, and removed the requirement on Guzzle 3.

The constructor for Acquia\Rest\Collection is no longer strongly typed, but will throw an InvalidArgumentException if an unusual object is passed to it.
@cpliakas
Copy link
Contributor

cpliakas commented May 8, 2015

@webbj74 You may just be my favorite person in the world today. Thanks for taking a first pass at this, excellent work.

@webbj74
Copy link
Contributor Author

webbj74 commented May 8, 2015

In testing I discovered that the CloudApiClient methods addSshKey, addSvnUser, addDatabase, moveDomain, and downloadDatabaseBackup are broken in commit bfb6830. I'll have an update to these soon.

I also discovered that deleteDatabase sets a parameter default which is no longer valid (per CL-7612). The parameter is still allowed, but throws a HTTP 400 unless ?backup=0

Also installDistroByName uses an install type ('distro_name') which was removed a while ago (CL-6842)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants