DB Class Reference

General Database calss. More...

Public Member Functions

 __construct ()
 Database class constructor.
 exportAppByName ($search, $page=1)
 Function for creating Application search view by app name.
 exportAppById ($appid)
 Function for creating application XML view.
 exportTestResults ($appid, $verid=0, $testid=0)
 Function for creating application test result XML view.
 exportCategory ($catid)
 Function for creating category list XML view.

Detailed Description

General Database calss.

This class provides general database functions it will extract data from wine appdb and bugzilla bases and request xml class function to create xml view

Author:
Malakhov Alexey

Definition at line 38 of file db.php.


Constructor & Destructor Documentation

__construct (  ) 

Database class constructor.

Database constructor will connects to databases and creates database links.

Also we will call XML class constructor

Geting global config values from ./cfg/config.inc

Connecting to appdb database

First, when connecting, the funct would first try to find a (persistent) link that's already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection.

Connect to wine bugzilla database

Init for XML class link and call for XMLExport constructor

Definition at line 56 of file db.php.


Member Function Documentation

exportAppById ( appid  ) 

Function for creating application XML view.

This function will create application XML view by app ID

Parameters:
appid application ID
Returns:
xml_view string containg full XML view

Convert app id into int type

Creates XML header

Get app database info by appid

See also:
getApp()

Close XML view header

Definition at line 174 of file db.php.

exportAppByName ( search,
page = 1 
)

Function for creating Application search view by app name.

This function will search for application name and return XML view for 10 search matches.

Also it returns pages count

Parameters:
search Search criteria (usually it is application name)
page Start page, default is 1 (first)
Returns:
xml_view string containg full XML view

Get only first 20 characters this will makes sql injection more harder ;)

Convert page variable into int type

query for search muches count to get page count

Creates xml header and add pages info

Free the resources associated with the result set

query for first 10 application records with specifyed start page

Getting aplication version

See also:
getVersion()

Creating AppInfo XML view

If no application found -- creates error header

Close XML view header

Free the resources associated with the result set

Definition at line 102 of file db.php.

exportCategory ( catid  ) 

Function for creating category list XML view.

This function will create application category XML view by catid

Parameters:
catid category ID
Returns:
xml_view string containg full XML view

Convert into int type

Creates XML header

Getting category info

See also:
getCategory()

query subcategory list by parent ID

get category view

Free the resources associated with the result set

query application data by category ID

get appinfo view

Close XML view header

Free the resources associated with the result set

Definition at line 236 of file db.php.

exportTestResults ( appid,
verid = 0,
testid = 0 
)

Function for creating application test result XML view.

This function will create application test result view by appid, verid or testid

Parameters:
appid application ID
verid application version ID, default 0
testid application test ID, default 0
Returns:
xml_view string containg full XML view

Convert into int type

Convert into int type

Convert into int type

Creates XML header

Get app database info by appid

See also:
getApp()

Close XML view header

Definition at line 201 of file db.php.


The documentation for this class was generated from the following file:

Generated on Tue Jan 12 15:28:46 2010 for Wine AppDB xmlexport by  doxygen 1.6.1