diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-06-13 18:41:23 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-06-13 18:41:23 +0200 |
commit | 92c55ab111f5d28626975310fc93f35b3ca00ab0 (patch) | |
tree | 14f0c6d98a429e49ed7b7b2b84983e8232aba7a7 /git-tools | |
parent | e4ccc5e6eac2bfebb8770a1a8f73f965ef0146fc (diff) | |
download | forums-92c55ab111f5d28626975310fc93f35b3ca00ab0.tar forums-92c55ab111f5d28626975310fc93f35b3ca00ab0.tar.gz forums-92c55ab111f5d28626975310fc93f35b3ca00ab0.tar.bz2 forums-92c55ab111f5d28626975310fc93f35b3ca00ab0.tar.xz forums-92c55ab111f5d28626975310fc93f35b3ca00ab0.zip |
[ticket/11603] Fix spacing and add some comments
PHPBB3-11603
Diffstat (limited to 'git-tools')
-rwxr-xr-x | git-tools/setup_github_network.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/git-tools/setup_github_network.php b/git-tools/setup_github_network.php index de3ea55d13..3f1f61b288 100755 --- a/git-tools/setup_github_network.php +++ b/git-tools/setup_github_network.php @@ -156,17 +156,19 @@ function api_request($query, $full_url = false) } curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_USERAGENT, 'phpBB/1.0'); - curl_setopt($c, CURLOPT_HEADER, true); + curl_setopt($c, CURLOPT_HEADER, true); $contents = curl_exec($c); curl_close($c); $sub_request_result = array(); + // Split possible headers from the body if ($contents && strpos($contents, "\r\n\r\n") > 0) { list($header, $contents) = explode("\r\n\r\n", $contents); foreach (explode("\n", $header) as $header_element) { - if (strpos($header_element, 'Link') === 0) + // Find Link Header which gives us a link to the next page + if (strpos($header_element, 'Link: ') === 0) { list($head, $header_content) = explode(': ', $header_element); foreach (explode(', ', $header_content) as $links) @@ -174,6 +176,7 @@ function api_request($query, $full_url = false) list($url, $rel) = explode('; ', $links); if ($rel == 'rel="next"') { + // Found a next link, follow it and merge the results $sub_request_result = api_request(substr($url, 1, -1), true); } } |