php - GuzzleHttp\Stream\create() undefined function when called by composer cmd -
i'm trying create composer post-install-cmd send simple post request. i'm using simple block elsewhere in application submit same request development server:
$esmapping = file_get_contents('path/to/mapping.json'); /** @var guzzlehttp\message\response $esresponse */ $esresponse = (new guzzle())->post($esmappingurl, ["body" => $esmapping]);
this exact code works in symfony2 console command, when try send request in composer command, fails following:
php fatal error: call undefined function guzzlehttp\stream\create() in /srv/www/htdocs/instagram-extractor/vendor/guzzlehttp/guzzle/src/message/messagefactory.php on line 179 fatal error: call undefined function guzzlehttp\stream\create() in /srv/www/htdocs/instagram-extractor/vendor/guzzlehttp/guzzle/src/message/messagefactory.php on line 179
i tried creating stream beforehand using $stream = stream::factory('string data');, failed same error (undefined stream\create()), different class calling method.
i haven't found single clue regarding issue, appreciated!
thanks!
edit: suspected might autoloader issue, tried changing psr-0 psr-4 no success.
figured out composer isn't autoloading stream functions file. dirty hack works around it:
require 'vendor/guzzlehttp/streams/src/functions.php';
i still wonder if there's better solution this?
Comments
Post a Comment