27 $Usage =
"Usage: " . basename($argv[0]) .
" 28 -u upload id :: required - upload id 29 -t uploadtree id :: required - uploadtree id 30 -c sysconfdir :: optional - Specify the directory for the system configuration 31 --type type :: optional - all/statement/url/email, default: all 32 --user username :: user name 33 --password password :: password 34 --container :: include container or not, 1: yes, 0: no (default) 35 -x copyright :: to match all that does not contain my copyright, (default): show all files 36 -X copyright :: to match my copyright, (default): show all files 41 $typeCopyright = array(
"statement",
"email",
"url");
43 $longopts = array(
"user:",
"password:",
"type:",
"container:");
44 $options = getopt(
"c:u:t:hx:X:", $longopts);
45 if (($options ===
false) || empty($options) || ! is_array($options)) {
46 $text = _(
"Invalid option or missing argument.");
58 foreach ($options as $option => $value) {
78 if (empty($value) || in_array($value, $typeCopyright)) {
79 $cpLister->setType($value);
81 print
"Invalid argument '$value' for type.\n";
87 $cpLister->setContainerInclusion($value);
90 $cpLister->setExcludingCopyright($value);
93 $cpLister->setIncludingCopyright($value);
96 print
"unknown option $option\n";
102 if (is_numeric($item) && !is_numeric($upload)) {
107 if (!is_numeric($upload)) {
108 print
"Upload ID is empty or invalid.\n";
112 if (!empty($item) && !is_numeric($item)) {
113 print
"Uploadtree ID is empty or invalid.\n";
118 require_once(
"$MODDIR/lib/php/common-cli.php");
123 if (empty($return_value)) {
124 $text = _(
"The user '$user' has no permission to read the information of upload $upload\n");
130 $cpLister->getCopyrightList($item, $upload);
account_check(&$user, &$passwd, &$group="")
check if this account is correct
GetUploadID($uploadtreeid)
Get upload id through uploadtreeid.
cli_Init()
Initialize the fossology environment for CLI use. This routine loads the plugins so they can be use b...
read_permission($upload, $user)
Check if the user has the permission to read the copyright/license/etc information of this upload...