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. |
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
Definition at line 38 of file db.php.
__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
exportAppById | ( | $ | appid | ) |
Function for creating application XML view.
This function will create application XML view by app ID
appid | application ID |
Convert app id into int type
Creates XML header
Get app database info by appid
Close XML view header
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
search | Search criteria (usually it is application name) | |
page | Start page, default is 1 (first) |
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
Creating AppInfo XML view
If no application found -- creates error header
Close XML view header
Free the resources associated with the result set
exportCategory | ( | $ | catid | ) |
Function for creating category list XML view.
This function will create application category XML view by catid
catid | category ID |
Convert into int type
Creates XML header
Getting category info
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
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
appid | application ID | |
verid | application version ID, default 0 | |
testid | application test ID, default 0 |
Convert into int type
Convert into int type
Convert into int type
Creates XML header
Get app database info by appid
Close XML view header