Testing needed - patch for pearweb to enable REST generation on the fly
| From: | Greg Beaver | Date: | Thu, 28 Apr 2005 04:59:10 +0000 |
| Subject: | Testing needed - patch for pearweb to enable REST generation on the fly | ||
| Groups: | php.pear.dev php.pear.core | ||
| Request: | Send a blank email to pear-dev+get-37441@lists.php.net to get a copy of this message | ||
Hi all,
I've committed the necessary code for generating REST files from
existing releases/packages/categories/maintainers, and attached is a
patch that will enable dynamic generation/removal of REST files as a
normal part of the website maintenance. It adds a miniscule amount of
post-processing to the modification of data distributed by pearweb, but
provides a tremendous benefit the rest of the time, as users with PEAR
1.4.0 will not tax the server nearly as much. At most, a single
download will occur for each user/file combination, unless the file is
modified. After that, only header checks will be performed. I suspect
this will alleviate a part of the burden on pearweb, and will speed up
the client-side as well.
In any case, for those of you with a pearweb checkout, to apply the
patch and use it, you have to upgrade to the latest CVS of pear-core,
then apply the patch to pearweb (duh) and create a channel.xml similar
to this one:
<?xml version="1.0" encoding="ISO-8859-1"?>
<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>pear.php.net</name>
<suggestedalias>pear</suggestedalias>
<summary>PHP Extension and Application Repository</summary>
<servers>
<primary>
<xmlrpc>
<function version="1.0">logintest</function>
<function version="1.0">package.listLatestReleases</function>
<function version="1.0">package.listAll</function>
<function version="1.0">package.info</function>
<function version="1.0">package.getDownloadURL</function>
<function version="1.1">package.getDownloadURL</function>
<function version="1.0">package.getDepDownloadURL</function>
<function version="1.1">package.getDepDownloadURL</function>
<function version="1.0">package.search</function>
<function version="1.0">channel.listAll</function>
</xmlrpc>
<rest>
<baseurl type="REST1.0">http://pear.php.net/rest/</baseurl>
</rest>
</primary>
<mirror host="localhost">
<rest>
<baseurl type="REST1.0">http://localhost/rest/</baseurl>
</rest>
</mirror>
</servers>
</channel>
Where the host name of your mirror is the servername for your local
pearweb checkout. After this, cd to pearweb/ and run:
$ php generateREST.php
This will create all of the necessary REST files. Finally, run
$ pear channel-update /path/to/your/modified/channel.xml
$ pear config-set preferred_mirror localhost
where localhost is the servername for your local pearweb checkout.
Finally, run any PEAR commands, and see if you can get it to break.
Better yet, try adding a user, category, package, or uploading a release
and deleting any of these. Try adding/removing maintainers from a
package. As you do this, check the contents of pearweb/rest/. The
directories are the first letter of what they represent, so we have
c=categories, p=packages, r=releases, m=maintainers. the file names are
pretty straightforward. Each package/category/whatever has its own
directory named after the thing it represents, and the directory
contains information on the package/release/category/maintainer.
Have fun, there are several days to play around with this, I am away on
business (possibly with good internet, we'll see) until Sunday.
Greg