Module: appdb
Branch: master
Commit: 71291dd030367bc6b4364c14686a723e805d3a13
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=71291dd030367bc6b4364c14…
Author: Alexander Nicolaysen Sørnes <alexsornes(a)gmail.com>
Date: Sun Jan 12 15:29:32 2014 +0100
testData: Mark some functions as static
---
include/testData.php | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/testData.php b/include/testData.php
index a3413db..b30709f 100644
--- a/include/testData.php
+++ b/include/testData.php
@@ -754,7 +754,7 @@ class testData{
0 - Rating
1 - Wine version
The $sDate parameter can be used to calculate the rating at a given point in time */
- public function getRatingInfoForVersionId($iVersionId, $sDate = 'NOW()')
+ public static function getRatingInfoForVersionId($iVersionId, $sDate = 'NOW()')
{
$sQuery = "SELECT testedRating,testedDate,testedRelease,versions.id as versionId
FROM testResults, ?.versions WHERE
@@ -828,7 +828,7 @@ class testData{
}
/* retrieve the latest test result for a given version id */
- function getNewestTestIdFromVersionId($iVersionId, $sState = 'accepted')
+ public static function getNewestTestIdFromVersionId($iVersionId, $sState = 'accepted')
{
$sQuery = "SELECT testingId FROM testResults, ?.versions WHERE
versions.value = testResults.testedRelease
@@ -1083,7 +1083,7 @@ class testData{
echo "</select>\n";
}
- function getTestResultsForUser($iUserId, $iVersionId)
+ public static function getTestResultsForUser($iUserId, $iVersionId)
{
$oVersion = new version($iVersionId);
$hResult = query_parameters("SELECT * FROM testResults WHERE
@@ -1107,7 +1107,7 @@ class testData{
}
/* List test data submitted by a given user. Ignore test results for queued applications/versions */
- function listSubmittedBy($iUserId, $bQueued = true)
+ public static function listSubmittedBy($iUserId, $bQueued = true)
{
$hResult = query_parameters("SELECT testResults.versionId, testResults.testedDate, testResults.testedRelease, testResults.testedRating, testResults.submitTime, testResults.testingId, appFamily.appName, appVersion.versionName from testResults, appFamily, appVersion WHERE testResults.versionId = appVersion.versionId AND appVersion.appId = appFamily.appId AND testResults.submitterId = '?' AND testResults.state = '?' ORDER BY testResults.testingId", $iUserId, $bQueued ? 'queued' : 'accepted');
@@ -1157,7 +1157,7 @@ class testData{
}
// return the number of test data entries for a particular version id
- function get_testdata_count_for_versionid($iVersionId)
+ public static function get_testdata_count_for_versionid($iVersionId)
{
$sQuery = "SELECT count(*) as cnt
FROM testResults
@@ -1186,7 +1186,7 @@ class testData{
return $oFilter;
}
- function objectGetEntriesCount($sState, $oFilters = null)
+ public static function objectGetEntriesCount($sState, $oFilters = null)
{
$sExtraTables = '';
$aOptions = $oFilters ? $oFilters->getOptions() : array('onlyWithoutMaintainers' => 'false', 'onlyMyMaintainedEntries' => 'false');
@@ -1274,7 +1274,7 @@ class testData{
return 'testingId';
}
- function objectGetEntries($sState, $iRows = 0, $iStart = 0, $sOrderBy = "testingId", $bAscending = true, $oFilters = null)
+ public static function objectGetEntries($sState, $iRows = 0, $iStart = 0, $sOrderBy = "testingId", $bAscending = true, $oFilters = null)
{
$sExtraTables = '';
$aOptions = $oFilters ? $oFilters->getOptions() : array('onlyWithoutMaintainers' => 'false', 'onlyMyMaintainedEntries' => 'false');
@@ -1560,7 +1560,7 @@ class testData{
return mysqltimestamp_to_unixtimestamp($this->sSubmitTime);
}
- function objectGetItemsPerPage($sState = 'accepted')
+ public static function objectGetItemsPerPage($sState = 'accepted')
{
$aItemsPerPage = array(25, 50, 100, 200);
$iDefaultPerPage = 25;
Module: appdb
Branch: master
Commit: 36fb1d97de5cdd02dcdfda5708f2f949373e03e6
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=36fb1d97de5cdd02dcdfda57…
Author: Alexander Nicolaysen Sørnes <alexsornes(a)gmail.com>
Date: Sun Jan 12 15:28:31 2014 +0100
screenshot: Mark some functions as static
---
include/screenshot.php | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/include/screenshot.php b/include/screenshot.php
index dc49935..adb0658 100644
--- a/include/screenshot.php
+++ b/include/screenshot.php
@@ -464,7 +464,7 @@ class screenshot
mail_appdb($sEmail, $sSubject ,$sMsg);
}
- function get_zoomicon_overlay()
+ public static function get_zoomicon_overlay()
{
/* if the user is using mozilla or firefox show the zoom icon over images */
/* otherwise because IE doesn't support transparent PNGs or proper css we have to */
@@ -485,7 +485,7 @@ class screenshot
*
* $bFormatting == false turns off all extranious formatting applied to the returned image html
*/
- function get_random_screenshot_img($iAppId = null, $iVersionId = null,
+ public static function get_random_screenshot_img($iAppId = null, $iVersionId = null,
$bFormatting = true)
{
// initialize variables to avoid notices when appending to them
@@ -554,7 +554,14 @@ class screenshot
return $sImg;
}
- function get_screenshots($iAppId = null, $iVersionId = null, $bQueued = "false")
+ /**
+ * Get all screenshots for an application or a specific version
+ * @param type $iAppId
+ * @param type $iVersionId
+ * @param type $bQueued
+ * @return boolean
+ */
+ public static function get_screenshots($iAppId = null, $iVersionId = null, $bQueued = "false")
{
/*
* We want all screenshots for this app.
@@ -703,13 +710,13 @@ class screenshot
return $oFilter;
}
- function objectGetEntries($sState, $iRows = 0, $iStart = 0, $sOrderBy = '', $bAscending = true, $oFilters = null)
+ public static function objectGetEntries($sState, $iRows = 0, $iStart = 0, $sOrderBy = '', $bAscending = true, $oFilters = null)
{
return appData::objectGetEntries($sState, $iRows, $iStart, $sOrderBy, $bAscending,
'screenshot', $oFilters);
}
- function objectGetEntriesCount($sState, $oFilters = null)
+ public static function objectGetEntriesCount($sState, $oFilters = null)
{
return appData::objectGetEntriesCount($sState, 'screenshot', $oFilters);
}
Module: appdb
Branch: master
Commit: 2a4c512dc1758f850e0d46688098474dcd15c506
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=2a4c512dc1758f850e0d4668…
Author: Alexander Nicolaysen Sørnes <alexsornes(a)gmail.com>
Date: Sun Jan 12 15:24:13 2014 +0100
maintainer: Mark some functions as static
---
include/maintainer.php | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/include/maintainer.php b/include/maintainer.php
index 00ff90d..910aaca 100644
--- a/include/maintainer.php
+++ b/include/maintainer.php
@@ -470,7 +470,7 @@ class maintainer
return $sRecipients;
}
- function ObjectGetEntries($sState, $iRows = 0, $iStart = 0, $sOrderBy = '', $bAscending = true)
+ public static function ObjectGetEntries($sState, $iRows = 0, $iStart = 0, $sOrderBy = '', $bAscending = true)
{
/* Not implemented */
if($sState == 'rejected')
@@ -529,7 +529,7 @@ class maintainer
}
// returns the number of applications/versions a particular user maintains
- function getMaintainerCountForUserId($iUserId, $bSuperMaintainer)
+ public static function getMaintainerCountForUserId($iUserId, $bSuperMaintainer)
{
$sQuery = "SELECT count(*) as cnt from appMaintainers WHERE userid = '?' AND superMaintainer = '?'".
" AND state ='?'";
@@ -541,7 +541,7 @@ class maintainer
}
// returns the number of applications/versions a particular user maintains
- function getMaintainerCountForUser($oUser, $bSuperMaintainer)
+ public static function getMaintainerCountForUser($oUser, $bSuperMaintainer)
{
return self::getMaintainerCountForUserId($oUser->iUserId, $bSuperMaintainer);
}
@@ -549,7 +549,7 @@ class maintainer
/**
* get the applications and versions that this user maintains
*/
- function getAppsMaintained($oUser)
+ public static function getAppsMaintained($oUser)
{
/* retrieve the list of application and order them by application name */
$hResult = query_parameters("SELECT appMaintainers.appId, versionId, superMaintainer, appName FROM ".
@@ -570,7 +570,7 @@ class maintainer
return $aAppsMaintained;
}
- function objectGetEntriesCount($sState)
+ public static function objectGetEntriesCount($sState)
{
/* Not implemented */
if($sState == 'rejected')
@@ -593,13 +593,13 @@ class maintainer
}
/* see how many unique maintainers we actually have */
- function getNumberOfMaintainers()
+ public static function getNumberOfMaintainers()
{
$hResult = query_parameters("SELECT DISTINCT userId FROM appMaintainers WHERE state='accepted';");
return query_num_rows($hResult);
}
- function isUserMaintainer($oUser, $iVersionId = null)
+ public static function isUserMaintainer($oUser, $iVersionId = null)
{
/* if we are a super maintainer, we are a maintainer of this version as well */
$oVersion = new Version($iVersionId);
@@ -622,7 +622,7 @@ class maintainer
return query_num_rows($hResult);
}
- function isUserSuperMaintainer($oUser, $iAppId = null)
+ public static function isUserSuperMaintainer($oUser, $iAppId = null)
{
if($iAppId)
{
@@ -665,7 +665,7 @@ class maintainer
/* if given an appid or a version id return a handle for a query that has */
/* the user ids that are maintainers for this particular appid or version id */
- function getMaintainersForAppIdVersionId($iAppId = null, $iVersionId = null)
+ public static function getMaintainersForAppIdVersionId($iAppId = null, $iVersionId = null)
{
$hResult = null;
@@ -703,7 +703,7 @@ class maintainer
/*
* get the userIds of super maintainers for this appId
*/
- function getSuperMaintainersUserIdsFromAppId($iAppId)
+ public static function getSuperMaintainersUserIdsFromAppId($iAppId)
{
$sQuery = "SELECT userId FROM ".
"appMaintainers WHERE appId = '?' " .