Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix curl debug bug #2305

Merged
merged 3 commits into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion system/HTTP/CURLRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ protected function setCURLOptions(array $curl_options = [], array $config = [])
if ($config['debug'])
{
$curl_options[CURLOPT_VERBOSE] = 1;
$curl_options[CURLOPT_STDERR] = is_string($config['debug']) ? fopen($config['debug'], 'a+') : fopen('php://output', 'w+');
$curl_options[CURLOPT_STDERR] = is_string($config['debug']) ? fopen($config['debug'], 'a+') : fopen('php://stderr', 'w');
}

// Decode Content
Expand Down
6 changes: 4 additions & 2 deletions user_guide_src/source/libraries/curlrequest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,10 @@ An example::
debug
=====

When ``debug`` is passed and set to ``true``, this will enable additional debugging to echo to STDOUT during the
script execution. This is done by passing CURLOPT_VERBOSE and echoing the output::
When ``debug`` is passed and set to ``true``, this will enable additional debugging to echo to STDERR during the
script execution. This is done by passing CURLOPT_VERBOSE and echoing the output. So, when you're running a build-in
michalsn marked this conversation as resolved.
Show resolved Hide resolved
server via ``spark serve`` you will see the output in the console. Otherwise, the output will be written to
the server's error log.

$response->request('GET', 'http://example.com', ['debug' => true]);

Expand Down