16 $Usage =
"Usage: " . basename($argv[0]) .
"
17 -u upload id :: required - upload id
18 -t uploadtree id :: required - uploadtree id
19 -c sysconfdir :: optional - Specify the directory for the system configuration
20 --type type :: optional - all/statement/url/email, default: all
21 --user username :: user name
22 --password password :: password
23 --container :: include container or not, 1: yes, 0: no (default)
24 -x copyright :: to match all that does not contain my copyright, (default): show all files
25 -X copyright :: to match my copyright, (default): show all files
30 $typeCopyright = array(
"statement",
"email",
"url");
32 $longopts = array(
"user:",
"password:",
"type:",
"container:");
33 $options = getopt(
"c:u:t:hx:X:", $longopts);
34 if (($options ===
false) || empty($options) || ! is_array($options)) {
35 $text = _(
"Invalid option or missing argument.");
47 foreach ($options as $option => $value) {
67 if (empty($value) || in_array($value, $typeCopyright)) {
68 $cpLister->setType($value);
70 print
"Invalid argument '$value' for type.\n";
76 $cpLister->setContainerInclusion($value);
79 $cpLister->setExcludingCopyright($value);
82 $cpLister->setIncludingCopyright($value);
85 print
"unknown option $option\n";
91 if (is_numeric($item) && !is_numeric($upload)) {
96 if (!is_numeric($upload)) {
97 print
"Upload ID is empty or invalid.\n";
101 if (!empty($item) && !is_numeric($item)) {
102 print
"Uploadtree ID is empty or invalid.\n";
107 require_once(
"$MODDIR/lib/php/common-cli.php");
112 if (empty($return_value)) {
113 $text = _(
"The user '$user' has no permission to read the information of upload $upload\n");
119 $cpLister->getCopyrightList($item, $upload);
read_permission($upload, $user)
Check if the user has the permission to read the copyright/license/etc information of this upload.
account_check(&$user, &$passwd, &$group="")
check if this account is correct
cli_Init()
Initialize the fossology environment for CLI use. This routine loads the plugins so they can be use b...
GetUploadID($uploadtreeid)
Get upload id through uploadtreeid.