Skip to content

Commit

Permalink
fix(spasht): updated requested in feat/spasht_4.0
Browse files Browse the repository at this point in the history
Signed-off-by: vivek kumar <vvksindia@gmail.com>
  • Loading branch information
viv9k authored and GMishx committed Oct 14, 2019
1 parent 07a9cb4 commit 5dedea0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
21 changes: 16 additions & 5 deletions src/spasht/agent/Makefile
@@ -1,9 +1,20 @@
# Copyright Siemens AG 2014
######################################################################
# Copyright (C) 2019.
# Author: Vivek Kumar<vvksindia@gmail.com>
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
######################################################################

TOP = ../../..
VARS = $(TOP)/Makefile.conf
Expand Down
17 changes: 1 addition & 16 deletions src/spasht/agent/SpashtAgent.php
Expand Up @@ -102,15 +102,6 @@ function processUploadId($uploadId)

$uploadAvailable = $this->searchUploadIdInSpasht($uploadId);

if($uploadAvailable == false)
{
$file = fopen('/home/fossy/abc.json','w');
fwrite($file,"no data available");
fclose($file);

return false;
}

$scancodeVersion = $this->getScanCodeVersion($uploadAvailable);

$getNewResult = $this->getInformation($scancodeVersion, $uploadAvailable, $pfileSha1AndpfileId);
Expand Down Expand Up @@ -359,17 +350,12 @@ protected function sperateLicenses($key)
*/
protected function insertLicensesSpashtAgentRecord($body, $agentId)
{
$file = fopen('/home/fossy/abc.json','w');
foreach($body as $key)
{
foreach($key['license'] as $license)
{
$l = $this->licenseDao->getLicenseByShortName($license);
if($l == null)
{
fwrite($file, $license."->null");
}
else
if($l != null)
{
if(!empty($l->getId()))
{
Expand All @@ -378,7 +364,6 @@ protected function insertLicensesSpashtAgentRecord($body, $agentId)
}
}
}
fclose($file);
return true;
}

Expand Down

0 comments on commit 5dedea0

Please sign in to comment.