Skip to content
This repository has been archived by the owner on Jul 8, 2019. It is now read-only.
Hank Brown edited this page Feb 5, 2017 · 5 revisions

Caveat surfer: Don't know what I am doing. This is an attempt to solve:

https://github.com/bitmovin/bitcodin-php/issues/4

I am also using mailjet, which requires "guzzlehttp/guzzle": "^6.2"

To get started, I forked the repo, then cloned it to my development PC.

I put it in a folder called packages (sibling of my project), and changed it's composer.json name:

  "name": "bitmovin",

Then in my project that depends on this, I add:

    "repositories": [
        {
            "type": "path",
            "url": "../../packages/bitmovin"
        }
    ]

...all of that is from the composer docs. Worked great. Now to update guzzle in composer ...

First attempt:

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing guzzlehttp/promises (v1.3.1)
    Downloading: 100%

  - Installing psr/http-message (1.0.1)
    Loading from cache

  - Installing guzzlehttp/psr7 (1.3.1)
    Loading from cache

  - Installing guzzlehttp/guzzle (6.2.2)
    Loading from cache

  - Installing symfony/yaml (v3.2.2)
    Downloading: 100%

  - Installing sebastian/version (1.0.6)
    Loading from cache

  - Installing sebastian/global-state (1.1.1)
    Loading from cache

  - Installing sebastian/recursion-context (1.0.2)
    Loading from cache

  - Installing sebastian/exporter (1.2.2)
    Loading from cache

  - Installing sebastian/environment (1.3.8)
    Loading from cache

  - Installing sebastian/diff (1.4.1)
    Loading from cache

  - Installing sebastian/comparator (1.2.4)
    Downloading: 100%

  - Installing doctrine/instantiator (1.0.5)
    Loading from cache

  - Installing phpunit/php-text-template (1.2.1)
    Loading from cache

  - Installing phpunit/phpunit-mock-objects (2.3.8)
    Loading from cache

  - Installing phpunit/php-timer (1.0.8)
    Loading from cache

  - Installing phpunit/php-file-iterator (1.4.2)
    Loading from cache

  - Installing phpunit/php-token-stream (1.4.9)
    Loading from cache

  - Installing phpunit/php-code-coverage (2.2.4)
    Loading from cache

  - Installing webmozart/assert (1.2.0)
    Loading from cache

  - Installing phpdocumentor/reflection-common (1.0)
    Loading from cache

  - Installing phpdocumentor/type-resolver (0.2.1)
    Loading from cache

  - Installing phpdocumentor/reflection-docblock (3.1.1)
    Loading from cache

  - Installing phpspec/prophecy (v1.6.2)
    Loading from cache

  - Installing phpunit/phpunit (4.8.34)
    Downloading: 100%

  - Installing symfony/stopwatch (v3.2.2)
    Downloading: 100%

  - Installing psr/log (1.0.2)
    Loading from cache

  - Installing symfony/debug (v3.2.2)
    Downloading: 100%

  - Installing symfony/polyfill-mbstring (v1.3.0)
    Loading from cache

  - Installing symfony/console (v3.2.2)
    Downloading: 100%

  - Installing symfony/filesystem (v3.2.2)
    Downloading: 100%

  - Installing symfony/config (v3.2.2)
    Downloading: 100%

  - Installing symfony/event-dispatcher (v2.8.16)
    Downloading: 100%

  - Installing guzzle/guzzle (v3.9.3)
    Downloading: 100%

  - Installing satooshi/php-coveralls (v0.7.1)
    Downloading: 100%

sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (>=2.2.1)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
symfony/console suggests installing symfony/process ()
symfony/event-dispatcher suggests installing symfony/dependency-injection ()
symfony/event-dispatcher suggests installing symfony/http-kernel ()
satooshi/php-coveralls suggests installing symfony/http-kernel (Allows Symfony integration)
Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.
Writing lock file
Generating autoload files

Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.

Abandoned. Ok. Well who is asking for it?

bitmovin/vendor/satooshi/php-coveralls/composer.json

Huh? Looks like a testing package. See if we can remove the dependency from bitmovin

$ composer remove satooshi/php-coveralls
satooshi/php-coveralls could not be found in require but it is present in require-dev
Do you want to remove it from require-dev [yes]? yes
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing satooshi/php-coveralls (v0.7.1)
  - Removing guzzle/guzzle (v3.9.3)
  - Removing symfony/event-dispatcher (v2.8.16)
  - Removing symfony/config (v3.2.2)
  - Removing symfony/filesystem (v3.2.2)
  - Removing symfony/console (v3.2.2)
  - Removing symfony/polyfill-mbstring (v1.3.0)
  - Removing symfony/debug (v3.2.2)
  - Removing psr/log (1.0.2)
  - Removing symfony/stopwatch (v3.2.2)
Writing lock file
Generating autoload files

Whew. That seemed to be everything.

Now on the the issue. Replace "Message" with "Psr7" in ApiResource.php

OK that gets the bits movin again, I can continue testing.

I do not make a pull request because I see other areas that also may neeed update (phpStorm IDE is highlighting issues).

They look straightforward. But not having used guzzle before I don't have the confidence.

It is enough that I shared what it took to get me going this weekend. Hope it helps someone else.

diff --git a/lib/ApiResource.php b/lib/ApiResource.php
index 218c10b..c18db70 100644
--- a/lib/ApiResource.php
+++ b/lib/ApiResource.php
@@ -12,7 +12,7 @@ use bitcodin\exceptions\BitcodinException;
 use bitcodin\exceptions\BitcodinResourceNotFoundException;
 use GuzzleHttp\Client;
 use GuzzleHttp\Exception\BadResponseException;
-use GuzzleHttp\Message\Response;
+use GuzzleHttp\Psr7\Response;

 /**
  * Class ApiResource
@@ -87,7 +87,7 @@ abstract class ApiResource extends \stdClass
      * @param $url
      * @param $body
      * @param $expectedStatusCode
-     * @return \GuzzleHttp\Message\FutureResponse|\GuzzleHttp\Message\ResponseInterface|\GuzzleHttp\Ring\Future\FutureInterface|null
+     * @return \GuzzleHttp\Psr7\FutureResponse|\GuzzleHttp\Psr7\ResponseInterface|\GuzzleHttp\Ring\Future\FutureInterface|null
      * @throws exceptions\BitcodinException
      */
     protected static function _postRequest($url, $body, $expectedStatusCode)
@@ -108,7 +108,7 @@ abstract class ApiResource extends \stdClass
      * @param $url
      * @param $body
      * @param $expectedStatusCode
-     * @return \GuzzleHttp\Message\FutureResponse|\GuzzleHttp\Message\ResponseInterface|\GuzzleHttp\Ring\Future\FutureInterface|null
+     * @return \GuzzleHttp\Psr7\FutureResponse|\GuzzleHttp\Psr7\ResponseInterface|\GuzzleHttp\Ring\Future\FutureInterface|null
      * @throws BitcodinException
      * @throws BitcodinResourceNotFoundException
      */
@@ -130,7 +130,7 @@ abstract class ApiResource extends \stdClass
      * @param $url
      * @param $expectedStatusCode
      * @param $query
-     * @return \GuzzleHttp\Message\FutureResponse|\GuzzleHttp\Message\ResponseInterface|\GuzzleHttp\Ring\Future\FutureInterface|null
+     * @return \GuzzleHttp\Psr7\FutureResponse|\GuzzleHttp\Psr7\ResponseInterface|\GuzzleHttp\Ring\Future\FutureInterface|null
      * @throws BitcodinException
      */
     protected static function _getRequest($url, $expectedStatusCode, $query=array())
@@ -148,7 +148,7 @@ abstract class ApiResource extends \stdClass
     /**
      * @param $url
      * @param $expectedStatusCode
-     * @return \GuzzleHttp\Message\FutureResponse|\GuzzleHttp\Message\ResponseInterface|\GuzzleHttp\Ring\Future\FutureInterface|null
+     * @return \GuzzleHttp\Psr7\FutureResponse|\GuzzleHttp\Psr7\ResponseInterface|\GuzzleHttp\Ring\Future\FutureInterface|null
      * @throws BitcodinException
      */
     protected static function _deleteRequest($url, $expectedStatusCode)```

So I do all this shit, then I discover https://github.com/bitmovin/bitmovin-php

wtf? bit CODIN vs bit MOVIN ? I do not know.

Clone this wiki locally