Re: Are the PEAR usernotes exported like the PHPDOC usernotes?
| From: | Richard Quadling | Date: | Thu, 24 Mar 2011 21:30:38 +0000 |
| Subject: | Re: Are the PEAR usernotes exported like the PHPDOC usernotes? | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-31043@lists.php.net to get a copy of this message | ||
On 24 March 2011 21:10, Christian Weiske <cweiske@cweiske.de> wrote:
> Hello Richard,
>
>
>> I recently completed the Windows CHM with User Notes format for PHD in
>> the PHP package and would like to do something similar for PEAR.
> I'd love to see that for PEAR, too. Currently we do not export the
> notes in a file, but could implement that.
>
>> The PHD format takes the all.bz2 and incorporates the usernotes
>> directly into the HTML files prior to compressing them into the CHM
>> file.
>>
>> This is done a separate Windows machine (due to the CHM compiler only
>> being available for Windows).
> We do run the chm compiler on our linux machine :=)
>
>
>
> --
> Regards/Mit freundlichen Grüßen
> Christian Weiske
>
> -=≡ Geeking around in the name of science since 1982 ≡=-
>
I don't know.
If you do, then PHPDOC would probably be interested. Currently the CHM
builds work (on my machine), but they aren't getting from the windows
machine to the master site for mirroring.
I've got some code for ManualNotes.class.php ...
// {{{ public function exportUserNotes
/**
* Export all user notes.
*
* This function replicates the primary function of
http://svn.php.net/viewvc/web/php-master/trunk/fetch/user-notes.php?sortby=file&view=log
*
* The exporting of the PEARDOC user notes will primarily be used
to build an ExtendedCHM format CHM file, similar to PHP's.
*
* @access public
*/
function exportUserNotes()
{
$sql = "SELECT DISTINCT
node_id,page_url,user_name,note_text,UNIX_TIMESTAMP(note_time) AS
ts,";
$sql .= "10 AS rate";
$sql .= " FROM {$this->notesTableName}";
//Only select notes that have been approved
$sql .= " WHERE note_approved = 'yes'";
$sql .= " ORDER BY page_url,rate DESC,ts DESC";
$res = $this->dbc->query($sql);
if (PEAR::isError($res)) {
return $res;
}
// Print out a row for all notes, obfuscating the
// email addresses as needed
while (!is_null($row = $res->fetchRow(DB_FETCHMODE_ASSOC))) {
$user = $row['user_name'];
if ($user != "pear-general@lists.php.net" && $user !=
"user@example.com") {
if (preg_match("!(.+)@(.+)\.(.+)!", $user)) {
$user = str_replace(array('@', '.'), array(' at ',
' dot '), $user);
}
} else {
$user = '';
}
echo
"$row[note_id]|$row[page_url]|$row[rate]|$row[ts]|$user|",
base64_encode(gzcompress($row[note],3)), "\n";
}
}
// }}}
This is attempting to emulate the output of the PHPDOC user notes code.
I think this code could simply output the bz2 file as there is no need
to break the notes out for the mirrors (as PEAR is not mirrored I
think).
Richard.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY