FOSSology  4.4.0
Open Source License Compliance by Open Source Software
wget_agent.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2012-2013 Hewlett-Packard Development Company, L.P.
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
13 define("TITLE_agent_wget_agent", "wget_agent");
14 
19 class agent_wget_agent extends FO_Plugin {
20 
21  public $Name = "wget_agent";
22  public $Title = TITLE_agent_wget_agent;
23  public $Version = "1.0";
24  public $Dependency = array();
25  public $DBaccess = PLUGIN_DB_WRITE;
26  public $AgentName = "wget_agent"; // agent.agent_name
27 
32  function RegisterMenus()
33  {
34  if ($this->State != PLUGIN_STATE_READY) {
35  return (0);
36  } // don't run
37 
38  /* fake menu item used to identify plugin agents */
39  menu_insert("Agents::" . $this->Title, 0, $this->Name);
40  }
41 
42 
53  function AgentHasResults($upload_pk)
54  {
55  return (0);
56  } // AgentHasResults()
57 
58 
77  function AgentAdd($job_pk, $upload_pk, &$ErrorMsg, $Dependencies)
78  {
79  $Dependencies[] = "wget_agent";
80  return CommonAgentAdd($this, $job_pk, $upload_pk, $ErrorMsg, $Dependencies);
81  } // AgentAdd()
82 
83 };
84 $NewPlugin = new agent_wget_agent;
This is the Plugin class. All plugins should:
Definition: FO_Plugin.php:57
Definition: state.hpp:16
UI plugin for WGET_AGENT.
Definition: wget_agent.php:19
AgentAdd($job_pk, $upload_pk, &$ErrorMsg, $Dependencies)
Queue the wget agent.
Definition: wget_agent.php:77
AgentHasResults($upload_pk)
Check if the upload has results from this agent.
Definition: wget_agent.php:53
RegisterMenus()
While menus can be added to any time at or after the PostInitialize phase, this is the standard locat...
Definition: wget_agent.php:32
CommonAgentAdd($plugin, $job_pk, $upload_pk, &$ErrorMsg, $Dependencies, $jqargs="", $jq_cmd_args=NULL)
Queue an agent. This is a simple version of AgentAdd() that can be used by multiple plugins that only...
Definition: common-job.php:433
menu_insert($Path, $LastOrder=0, $URI=NULL, $Title=NULL, $Target=NULL, $HTML=NULL)
Given a Path, order level for the last item, and optional plugin name, insert the menu item.
#define PLUGIN_DB_WRITE
Plugin requires write permission on DB.
Definition: libfossology.h:38