FOSSology  4.4.0
Open Source License Compliance by Open Source Software
agent-spasht.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2019 Vivek Kumar <vvksindia@gmail.com>
4  Author: Vivek Kumar<vvksindia@gmail.com>
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
8 
13 
14 include_once(dirname(__DIR__) . "/agent/version.php");
15 
17 {
18  public function __construct()
19  {
20  $this->Name = "spasht";
21  $this->Title = _("Spasht Analysis");
22  $this->AgentName = "spasht";
23 
24  parent::__construct();
25  }
26 
34  function preInstall()
35  {
36  return false;
37  }
38 
46  public function AgentAdd($jobId, $uploadId, &$errorMsg, $dependencies=array(), $arguments=null)
47  {
48  $dependencies[] = "agent_adj2nest";
49 
50  $jobQueueId = \IsAlreadyScheduled($jobId, $this->AgentName, $uploadId);
51  if ($jobQueueId != 0) {
52  return $jobQueueId;
53  }
54 
55  $args = is_array($arguments) ? '' : $arguments;
56  return $this->doAgentAdd($jobId, $uploadId, $errorMsg, $dependencies, $uploadId, $args);
57  }
58 
59 
64  function AgentHasResults($uploadId=0)
65  {
66  return CheckARS($uploadId, $this->AgentName, "spasht agent", "spasht_ars");
67  }
68 }
69 
70 register_plugin(new SpashtAgentPlugin());
Contains the constants and helpers for authentication of user.
Definition: Auth.php:24
doAgentAdd($jobId, $uploadId, &$errorMsg, $dependencies, $jqargs="", $jq_cmd_args=null)
AgentAdd($jobId, $uploadId, &$errorMsg, $dependencies=array(), $arguments=null)
AgentHasResults($uploadId=0)
CheckARS($upload_pk, $AgentName, $AgentDesc, $AgentARSTableName)
Check the ARS table to see if an agent has successfully scanned an upload.
IsAlreadyScheduled($job_pk, $AgentName, $upload_pk)
Check if an agent is already scheduled in a job.
Definition: common-job.php:378