FOSSology  4.4.0
Open Source License Compliance by Open Source Software
agent-demomod.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2013 Hewlett-Packard Development Company, L.P.
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
13 define("TITLE_AGENT_DEMOMOD", _("Demomod scanner"));
14 
19 class agent_demomod extends FO_Plugin {
20 
21  public $Name = "agent_demomod";
22  public $Title = TITLE_AGENT_DEMOMOD;
23  public $Version = "1.0";
24  public $Dependency = array();
26  public $AgentName = "demomod";
27 
28 
32  function RegisterMenus()
33  {
34  if ($this->State != PLUGIN_STATE_READY) { return (0); // don't run
35  }
36  menu_insert("Agents::" . $this->Title, 0, $this->Name);
37  }
38 
39 
50  function AgentHasResults($upload_pk)
51  {
52  return CheckARS($upload_pk, $this->AgentName, "demonstration module scanner", "demomod_ars");
53  } // AgentHasResults()
54 
55 
74  function AgentAdd($job_pk, $upload_pk, &$ErrorMsg, $Dependencies)
75  {
76  $Dependencies[] = "agent_adj2nest";
77  return CommonAgentAdd($this, $job_pk, $upload_pk, $ErrorMsg, $Dependencies);
78  } // AgentAdd()
79 }
80 
81 $NewPlugin = new agent_demomod;
82 
This is the Plugin class. All plugins should:
Definition: FO_Plugin.php:57
Definition: state.hpp:16
UI plugin for demomod (handle user requests)
RegisterMenus()
Register additional menus.
$AgentName
agent.agent_name
$DBaccess
DB access required.
$Title
Page title.
AgentHasResults($upload_pk)
Check if the upload has already been successfully scanned.
$Version
Plugin versin.
$Dependency
Dependecy for plugin.
AgentAdd($job_pk, $upload_pk, &$ErrorMsg, $Dependencies)
Queue the demomod agent.
$Name
Mod name.
CheckARS($upload_pk, $AgentName, $AgentDesc, $AgentARSTableName)
Check the ARS table to see if an agent has successfully scanned an upload.
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