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

pecl update-channels failed to update phpdocs channel #151

Open
zhangyoufu opened this issue Jan 10, 2025 · 0 comments · May be fixed by #152
Open

pecl update-channels failed to update phpdocs channel #151

zhangyoufu opened this issue Jan 10, 2025 · 0 comments · May be fixed by #152

Comments

@zhangyoufu
Copy link

zhangyoufu commented Jan 10, 2025

# pecl update-channels
Updating channel "doc.php.net"
Error: Unable to create XML parser
Invalid channel.xml file
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date

The root cause seems to be pecl not parsing HTTP chunked encoding response properly.

GET https://doc.php.net/channels.xml returns the following HTTP response:

HTTP/1.1 200 OK
Server: myracloud
Date: Thu, 09 Jan 2025 13:03:45 GMT
Content-Type: application/xml
Transfer-Encoding: chunked
Connection: close
Last-Modified: Wed, 07 Feb 2024 15:54:33 GMT
ETag: "276-610ccb602ffaf-gzip"
Accept-Ranges: bytes

276
<?xml version="1.0" encoding="UTF-8"?>
<channel version="1.0" xmlns="http://pear.php.net/channel-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/channel-1.0 http://pear.php.net/dtd/channel-1.0.xsd">
 <name>doc.php.net</name>
 <summary>PHP Documentation team</summary>
 <suggestedalias>phpdocs</suggestedalias>
 <servers>
  <primary>
   <rest>
    <baseurl type="REST1.0">http://doc.php.net/rest/</baseurl>
    <baseurl type="REST1.1">http://doc.php.net/rest/</baseurl>
    <baseurl type="REST1.3">http://doc.php.net/rest/</baseurl>
   </rest>
  </primary>
 </servers>
</channel>

0

If I modify the response to fixed-length body, pecl works properly.

HTTP/1.1 200 OK
Server: myracloud
Date: Thu, 09 Jan 2025 13:03:45 GMT
Content-Type: application/xml
Content-Length: 630
Connection: close
Last-Modified: Wed, 07 Feb 2024 15:54:33 GMT
ETag: "276-610ccb602ffaf-gzip"
Accept-Ranges: bytes

<?xml version="1.0" encoding="UTF-8"?>
<channel version="1.0" xmlns="http://pear.php.net/channel-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/channel-1.0 http://pear.php.net/dtd/channel-1.0.xsd">
 <name>doc.php.net</name>
 <summary>PHP Documentation team</summary>
 <suggestedalias>phpdocs</suggestedalias>
 <servers>
  <primary>
   <rest>
    <baseurl type="REST1.0">http://doc.php.net/rest/</baseurl>
    <baseurl type="REST1.1">http://doc.php.net/rest/</baseurl>
    <baseurl type="REST1.3">http://doc.php.net/rest/</baseurl>
   </rest>
  </primary>
 </servers>
</channel>
# pecl update-channels
Updating channel "doc.php.net"
Update of Channel "doc.php.net" succeeded
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date

# pecl version
PEAR Version: 1.10.15
PHP Version: 8.3.15
Zend Engine Version: 4.3.15
Running on: Linux 362aa5001767 6.1.0-21-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64
zhangyoufu added a commit to zhangyoufu/pear-core that referenced this issue Jan 10, 2025
Fixes pear#151

Update `PEAR/REST.php` and `PEAR/Downloader.php` to handle HTTP chunked encoding responses properly.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/pear/pear-core/issues/151?shareId=XXXX-XXXX-XXXX-XXXX).
@zhangyoufu zhangyoufu linked a pull request Jan 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant