Overview   Package   Tree   Index 
HistView Api Doc
PREV  NEXT Frames  No Frame 
SUMMARY:  FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Api
Class histview

- hvconfig
-

class histview
extends hvconfig

Processing a history file and prepare it for HTML output

Authors:
Izzy (devel@izzysoft.de)
Version:
$Revision: 65 $ $Date: 2009-10-13 01:04:40 +0200 (Di, 13. Okt 2009) $
Copyright:
(c) 2003-2009 by Itzchak Rehberg and IzzySoft

Constructor Summary
void histview(string $infile, [string $basename])
Create an instance and read the input file into the internal array

Method Summary
boolean add_mark(string $name, string $symbol, string $icon, [string $cssclass])
Add another mark to the set
private string getdlurl(string $type)
Check whether there is a file to download - and create URL if any
string out()
Generate the output page content
private boolean pline(string $line)
Process a single line from the input file
boolean process()
Process the input file
void set_basedir(string $type, string $dir)
Override base URLs for archives.
void set_cssclass([string $cplus], [string $cminus], [string $cchange], [string $cbug])
Override CSS classes for change details
boolean set_icon([string $plus], [string $minus], [string $change], [string $bug], [string $tar], [string $deb], [string $rpm])
Override default icon settings icons can either be a character/string or a complete IMG tag
boolean set_mark([string $plus], [string $minus], [string $change], [string $bug], [string $ver])
Override default identifier mark settings Identifier marks are the characters used to identify the changes, such as a "+" for a new feature or a "!" for a bug
void set_max_relnum(integer $relnum)
Set the maximum release number To take our example from set_basedir again (dummy-0.
void set_relname(string $relname)
Set the release extension for *.
void set_separator(string $separator)
Set the URL parameter separator By default, HistView uses the ";" as separator (as recommended by W3C).
void use_dlclass([boolean $use])
Set download class usage By default, HistView is set not to use the provided download class.

Constructor Detail

histview()

void histview(string $infile, [string $basename])

Create an instance and read the input file into the internal array

Parameters:
infile - input file name
basename - basename for files (e.g. "histview" for histview-0.1.3-izzy1.noarch.rpm). If not set, it falls back to the filename of $infile w/o path and extension.

Method Detail

add_mark()

boolean add_mark(string $name, string $symbol, string $icon, [string $cssclass])

Add another mark to the set

Parameters:
name - unique name for the mark
symbol - one character like '!' for a bug
icon - complete image tag or string to display instead of the symbol
cssclass - CSS class to apply (default:"changed")
Returns:
success

getdlurl()

private string getdlurl(string $type)

Check whether there is a file to download - and create URL if any

Parameters:
type - Type (one of tar, deb, rpm)
Returns:
href complete href string if found, empty string else

out()

string out()

Generate the output page content

Returns:
HTML formatted history

pline()

private boolean pline(string $line)

Process a single line from the input file

Parameters:
line - the input line to parse
Returns:
success

process()

boolean process()

Process the input file

Returns:
success

set_basedir()

void set_basedir(string $type, string $dir)

Override base URLs for archives. With $type='base' set the string to cut of to leave the download URL. Example: Your files are somewhere below /var/www/files/download, and your servers document root is /var/www, so you would specify "/var/www" here. If your files reside outside the servers document root, say below /var/ftp/download, you should create a directory alias called "/ftp/" pointing to /var/ftp, and specify "/var" here.

Parameters:
type - tar, deb, rpm or base
dir - the directory for this type

set_cssclass()

void set_cssclass([string $cplus], [string $cminus], [string $cchange], [string $cbug])

Override CSS classes for change details

Parameters:
cplus - CSS class for "+" (default:"feature")
cminus - CSS class for "-" (default:"removed")
cchange - CSS class for "*" (default:"changed")
cbug - CSS class for "!" (default:"bugfix")

set_icon()

boolean set_icon([string $plus], [string $minus], [string $change], [string $bug], [string $tar], [string $deb], [string $rpm])

Override default icon settings icons can either be a character/string or a complete IMG tag

Parameters:
plus - FeatureAdd Icon
minus - Removed stuff Icon
change - Changed stuff Icon
bug - BugFix Icon
tar - Tarball Icon
deb - Debian Icon
rpm - RPM Icon
Returns:
success

set_mark()

boolean set_mark([string $plus], [string $minus], [string $change], [string $bug], [string $ver])

Override default identifier mark settings Identifier marks are the characters used to identify the changes, such as a "+" for a new feature or a "!" for a bug

Parameters:
plus - FeatureAdd mark
minus - Removed stuff mark
change - Changed stuff mark
bug - BugFix mark
ver - Version mark
Returns:
success

set_max_relnum()

void set_max_relnum(integer $relnum)

Set the maximum release number To take our example from set_basedir again (dummy-0.1.2-johnny3.noarch.rpm), the relnum of that package is "3" (the number immediately following the release extension). To find the latest package, histview would "replace" this part by $i, counting down from max_relnum to 0 until it finds a file.

Parameters:
relnum - max release number to check for

set_relname()

void set_relname(string $relname)

Set the release extension for *.deb/*.rpm For the fictive package dummy-0.1.2-johnny3.noarch.rpm this would be "johnny"

Parameters:
relname - extension to use

set_separator()

void set_separator(string $separator)

Set the URL parameter separator By default, HistView uses the ";" as separator (as recommended by W3C). If your setup does not support this, and you cannot change the setup: Change the separator to "&"

Parameters:
separator - One character to separate parameters in URLs

use_dlclass()

void use_dlclass([boolean $use])

Set download class usage By default, HistView is set not to use the provided download class. Using it, the links are pointing to the calling script, and the parameters "file" (the filename) and "dir" (the directory type, e.g. "deb") are added. That means you can hide the directories from your users, and even add some download counter script or whatever.
If you want that, simply turn it on here.

Parameters:
use - Whether to use the download class (TRUE, Default) or not (FALSE)

 Overview   Package   Tree   Index 
HistView Api Doc
PREV  NEXT Frames  No Frame 
SUMMARY:  FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Submit a bug

This document was generated by phpdocgen 0.17-rc3.
Copyright © 2002-03 Stéphane GALLAND (under the GNU General Public License)