FOSSology  4.4.0
Open Source License Compliance by Open Source Software
agent-pkgagent.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2009-2013 Hewlett-Packard Development Company, L.P.
4  SPDX-FileCopyrightText: © 2015 Siemens AG
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
8 
10 
20 {
21  public function __construct() {
22  $this->Name = "agent_pkgagent";
23  $this->Title = _("Package Analysis (Parse package headers)");
24  $this->AgentName = "pkgagent";
25 
26  parent::__construct();
27  }
28 
33  function AgentHasResults($uploadId=0)
34  {
35  return CheckARS($uploadId, $this->AgentName, "package meta data scanner", "pkgagent_ars");
36  }
37 
42  function preInstall()
43  {
44  $dbManager = $GLOBALS['container']->get('db.manager');
45  $latestPkgAgent = $dbManager->getSingleRow("SELECT agent_enabled FROM agent WHERE agent_name=$1 ORDER BY agent_ts LIMIT 1",array('pkgagent'));
46  if (!empty($latestPkgAgent) && !$dbManager->booleanFromDb($latestPkgAgent['agent_enabled']))
47  {
48  return 0;
49  }
50  menu_insert("Agents::" . $this->Title, 0, $this->Name);
51  }
52 
53 }
54 
55 register_plugin(new PkgAgentPlugin());
UI plugin of pkgagent.
AgentHasResults($uploadId=0)
CheckARS($upload_pk, $AgentName, $AgentDesc, $AgentARSTableName)
Check the ARS table to see if an agent has successfully scanned an upload.
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.