FOSSology
4.4.0
Open Source License Compliance by Open Source Software
|
This file contains common functions for the license_file and license_ref tables. More...
Go to the source code of this file.
Functions | |
GetFileLicenses ($agent, $pfile_pk, $uploadtree_pk, $uploadtree_tablename='uploadtree', $duplicate="") | |
get all the licenses for a single file or uploadtree More... | |
GetFileLicenses_string ($agent_pk, $pfile_pk, $uploadtree_pk, $uploadtree_tablename='uploadtree') | |
Same as GetFileLicenses() but returns license list as a single string. More... | |
GetFilesWithLicense ($agent_pk, $rf_shortname, $uploadtree_pk, $PkgsOnly=false, $offset=0, $limit="ALL", $order="", $tag_pk=null, $uploadtree_tablename="uploadtree") | |
Get files with a given license (shortname). More... | |
Level1WithLicense ($agent_pk, $rf_shortname, $uploadtree_pk, $PkgsOnly=false, $uploadtree_tablename="uploadtree") | |
Given an uploadtree_pk, find all the non-artifact, immediate children (uploadtree_pk's) that have license $rf_shortname. More... | |
FileListLinks ($upload_fk, $uploadtree_pk, $napk, $pfile_pk, $Recurse=True, &$UniqueTagArray=array(), $uploadtree_tablename="uploadtree", $wantTags=true) | |
Get list of links: [View][Info][Download] More... | |
This file contains common functions for the license_file and license_ref tables.
Definition in file common-license-file.php.
FileListLinks | ( | $upload_fk, | |
$uploadtree_pk, | |||
$napk, | |||
$pfile_pk, | |||
$Recurse = True , |
|||
& | $UniqueTagArray = array() , |
||
$uploadtree_tablename = "uploadtree" , |
|||
$wantTags = true |
|||
) |
Get list of links: [View][Info][Download]
int | $upload_fk | Upload id |
int | $uploadtree_pk | Uploadtree id |
int | $napk | Nomos agent pk |
int | $pfile_pk | |
bool | $Recurse | true if links should propapagate recursion. Currently, this means that the displayed tags will be displayed for directory contents. |
array | &$UniqueTagArray | Cumulative array of unique tags |
string | $uploadtree_tablename | |
bool | $wantTags | If true add [Tag] ... For example: Array ( [0] => Array ( [tag_pk] => 5 [tag_name] => GPL false positive ) ) |
Definition at line 273 of file common-license-file.php.
GetFileLicenses | ( | $agent, | |
$pfile_pk, | |||
$uploadtree_pk, | |||
$uploadtree_tablename = 'uploadtree' , |
|||
$duplicate = "" |
|||
) |
get all the licenses for a single file or uploadtree
int | $agent_pk | Agent id |
int | $pfile_pk | Pfile id, (if empty, $uploadtree_pk must be given) |
int | $uploadtree_pk | (used only if $pfile_pk is empty) |
string | $uploadtree_tablename | Upload tree table to use |
bool | $duplicate | Get duplicated licenses or not, if NULL: No, or Yes |
Definition at line 30 of file common-license-file.php.
GetFileLicenses_string | ( | $agent_pk, | |
$pfile_pk, | |||
$uploadtree_pk, | |||
$uploadtree_tablename = 'uploadtree' |
|||
) |
Same as GetFileLicenses() but returns license list as a single string.
int | $agent_pk | Agent id |
int | $pfile_pk | Pfile id, (if empty, $uploadtree_pk must be given) |
int | $uploadtree_pk | (used only if $pfile_pk is empty) |
string | $uploadtree_tablename |
Definition at line 98 of file common-license-file.php.
GetFilesWithLicense | ( | $agent_pk, | |
$rf_shortname, | |||
$uploadtree_pk, | |||
$PkgsOnly = false , |
|||
$offset = 0 , |
|||
$limit = "ALL" , |
|||
$order = "" , |
|||
$tag_pk = null , |
|||
$uploadtree_tablename = "uploadtree" |
|||
) |
Get files with a given license (shortname).
int | $agent_pk | Agent id |
string | $rf_shortname | Short name of one license, like GPL, APSL, MIT, ... |
int | $uploadtree_pk | Sets scope of request |
bool | $PkgsOnly | If true, only list packages, default is false (all files are listed). For now, $PkgsOnly is not yet implemented. |
int | $offset | Select offset, default is 0 |
string | $limit | Select limit (num rows returned), default is no limit |
string | $order | SQL order by clause, default is blank e.g. "order by ufile_name asc" |
int | $tag_pk | Optional tag_pk. Restrict results to files that have this tag. |
string | $uploadtree_tablename |
Definition at line 124 of file common-license-file.php.
Level1WithLicense | ( | $agent_pk, | |
$rf_shortname, | |||
$uploadtree_pk, | |||
$PkgsOnly = false , |
|||
$uploadtree_tablename = "uploadtree" |
|||
) |
Given an uploadtree_pk, find all the non-artifact, immediate children (uploadtree_pk's) that have license $rf_shortname.
By "immediate" I mean the earliest direct non-artifact.
For example:
A > B, C (A has children B and C)
If C is an artifact, descend that tree till you find the first non-artifact and consider that non-artifact an immediate child.
int | $agent_pk | Agent id |
string | $rf_shortname | Short name of one license, like GPL, APSL, MIT, ... |
int | $uploadtree_pk | Sets scope of request |
bool | $PkgsOnly | If true, only list packages, default is false (all files are listed). $PkgsOnly is not yet implemented. |
string | $uploadtree_tablename |
Definition at line 215 of file common-license-file.php.