FOSSology  4.4.0
Open Source License Compliance by Open Source Software
fossjobs.php File Reference

fossjobs list fossology agents that are configured in the ui or run the default configured in the ui. More...

Go to the source code of this file.

Functions

 list_agents ()
 list agents More...
 

Variables

global $Plugins
 
global $PERM_NAMES
 
global $SysConf
 
global $PG_CONN
 
 $usage
 
 $longopts = array("username:", "password:", "groupname:")
 
 $options = getopt("c:haA:P:uU:D:v", $longopts)
 
if(empty($options)) if(array_key_exists("h", $options)) $user = ""
 
 $passwd = ""
 
 $group = ""
 
 $groupId = Auth::getGroupId()
 
 $Verbose = 0
 
if(array_key_exists("v", $options)) $agent_list = list_agents()
 
if(empty($agent_list)) if(array_key_exists("a", $options)) $Skip = array("agent_unpack", "agent_adj2nest", "wget_agent")
 
if(array_key_exists("A", $options)) if(array_key_exists("u", $options)) $uploadDao = $GLOBALS['container']->get('dao.upload')
 

Detailed Description

fossjobs list fossology agents that are configured in the ui or run the default configured in the ui.

Parameters
(optional)string -h standard help switch
(optional)string -v verbose debugging
(optional)string -a lists agents
(optional)string -A specify agents
(optional)string -u list available uploads
(optional)string –username specify user name
(optional)string –groupname specify group name
(optional)string –password specify password
(optional)string -c Specify the directory for the system configuration
(optional)string -D Delete upload
int-U $upload_pk upload primary key to run agents on....

@exit 0 for success, others for failure....

Note
there is a user interface issue here in that the user has no easy way to discover and specify what the upload_pk is.

Definition in file fossjobs.php.

Function Documentation

◆ list_agents()

list_agents ( )

list agents

lists the agents that are registered with the system. Assumes that the agent plugins have been configured.

Returns
array $agent_list

scheduling agent tasks on upload ids

scheduling delagent tasks on upload ids

Definition at line 48 of file fossjobs.php.

Variable Documentation

◆ $Plugins

global $Plugins

include common-cli.php directly, common.php can not include common-cli.php becuase common.php is included before UI_CLI is set

Definition at line 60 of file fossjobs.php.

◆ $usage

Initial value:
= basename($argv[0]) . " [options]
Options:
-h :: help, this message
-v :: verbose output
-a :: list available agent tasks
-A string :: specify agent to schedule (default is everything from -a)
The string can be a comma-separated list of agent tasks.
-u :: list available upload ids
-U upload :: the upload identifier for scheduling agent tasks
The string can be a comma-separated list of upload ids.
Or, use 'ALL' to specify all upload ids.
-D upload :: the upload identifier for scheduling delete tasks
The string can either be 'ALL', a string (the upload_pk),
or an array of upload_pk's if multiple -D's were specified.
--username string :: user name
--password string :: password
--groupname string :: group name
-c string :: Specify the directory for the system configuration
"

Definition at line 70 of file fossjobs.php.