Skip to content

Commit eaf9adf

Browse files
committed
fix ExtensionInstaller run on first install
1 parent 4da9ab2 commit eaf9adf

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

program/include/rcmail_oauth.php

+23-4
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,29 @@ public function __construct($options = [])
200200
}
201201

202202
// prepare a http client with the correct options
203-
$this->http_client = $this->rcmail->get_http_client((array) $options['http_options'] + [
204-
'timeout' => $this->options['timeout'],
205-
'verify' => $this->options['verify_peer'],
206-
]);
203+
if (class_exists(HttpClient::class)) { // class is not autoloaded in extension installer composer plugin on the first composer install
204+
/*
205+
* In rcube.php line 277:
206+
*
207+
* [Error] Class 'GuzzleHttp\Client' not found
208+
209+
* Exception trace:
210+
* at program\lib\Roundcube\rcube.php:277
211+
* rcube->get_http_client() at program\include\rcmail_oauth.php:205
212+
* rcmail_oauth->__construct() at program\include\rcmail_oauth.php:104
213+
* rcmail_oauth::get_instance() at program\include\rcmail.php:150
214+
* rcmail->startup() at program\include\rcmail.php:88
215+
* rcmail::get_instance() at program\include\clisetup.php:30
216+
* include_once() at vendor\roundcube\plugin-installer\src\Roundcube\Composer\ExtensionInstaller.php:49
217+
* Roundcube\Composer\ExtensionInstaller->install() at composer.phar/src/Composer/Installer/InstallationManager.php:463
218+
* Composer\Installer\InstallationManager->install() at composer.phar/src/Composer/Installer/InstallationManager.php:378
219+
*/
220+
221+
$this->http_client = $this->rcmail->get_http_client((array) $options['http_options'] + [
222+
'timeout' => $this->options['timeout'],
223+
'verify' => $this->options['verify_peer'],
224+
]);
225+
}
207226
}
208227

209228
/**

0 commit comments

Comments
 (0)