FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\UI\Api\Controllers\FileSearchController Class Reference

Controller for file searching. More...

Inheritance diagram for Fossology\UI\Api\Controllers\FileSearchController:
Inheritance graph
Collaboration diagram for Fossology\UI\Api\Controllers\FileSearchController:
Collaboration graph

Public Member Functions

 __construct ($container)
 
 getFiles ($request, $response, $args)
 

Private Member Functions

 getPfileId (&$file)
 
 getInfoForFiles (&$inputFileList)
 
 getFileFindings ($pfileId)
 
 getFileConclusions ($pfileId)
 
 getFileCopyright ($pfileId)
 
 getPackageUpload ($pfileId)
 
 filterAccessibleUploads ($uploads)
 
 getMainLicenses ($uploads)
 

Private Attributes

 $fileHelper
 
 $clearingDao
 
 $licenseDao
 

Additional Inherited Members

- Protected Member Functions inherited from Fossology\UI\Api\Controllers\RestController
 getParsedBody (ServerRequestInterface $request)
 Parse request body as JSON and return associative PHP array. More...
 
 throwNotAdminException ()
 
 uploadAccessible ($id)
 
 isItemExists (int $uploadId, int $itemId)
 
- Protected Attributes inherited from Fossology\UI\Api\Controllers\RestController
 $container
 
 $restHelper
 
 $dbHelper
 

Detailed Description

Controller for file searching.

Definition at line 29 of file FileSearchController.php.

Constructor & Destructor Documentation

◆ __construct()

Fossology\UI\Api\Controllers\FileSearchController::__construct (   $container)
Parameters
ContainerInterface$container

Reimplemented from Fossology\UI\Api\Controllers\RestController.

Definition at line 52 of file FileSearchController.php.

Member Function Documentation

◆ filterAccessibleUploads()

Fossology\UI\Api\Controllers\FileSearchController::filterAccessibleUploads (   $uploads)
private

From a list of uploads, filter out inaccessible uploads.

Parameters
array$uploadsList of uploads to filter from
Returns
array Array of accessible uploads

Definition at line 195 of file FileSearchController.php.

◆ getFileConclusions()

Fossology\UI\Api\Controllers\FileSearchController::getFileConclusions (   $pfileId)
private

Get the license conclusions for the given pfile id

Parameters
integer$pfileId
See also
Fossology::UI::Api::Helper::FileHelper::pfileConclusions()

Definition at line 164 of file FileSearchController.php.

◆ getFileCopyright()

Fossology\UI\Api\Controllers\FileSearchController::getFileCopyright (   $pfileId)
private

Get the copyright for given pfile id

Parameters
integer$pfileId
See also
Fossology::UI::Api::Helper::FileHelper::pfileCopyright()

Definition at line 175 of file FileSearchController.php.

◆ getFileFindings()

Fossology\UI\Api\Controllers\FileSearchController::getFileFindings (   $pfileId)
private

Get the scanner findings for given pfile id

Parameters
integer$pfileId
See also
Fossology::UI::Api::Helper::FileHelper::pfileScannerFindings()

Definition at line 154 of file FileSearchController.php.

◆ getFiles()

Fossology\UI\Api\Controllers\FileSearchController::getFiles (   $request,
  $response,
  $args 
)

Get the file information based on hashes sent

Parameters
ServerRequestInterface$request
ResponseHelper$response
array$args
Returns
ResponseHelper

Definition at line 68 of file FileSearchController.php.

◆ getInfoForFiles()

Fossology\UI\Api\Controllers\FileSearchController::getInfoForFiles ( $inputFileList)
private

For given array of files, update the upload ids, scanner findings and conclusions.

Parameters
File[]$inputFileList

Definition at line 127 of file FileSearchController.php.

◆ getMainLicenses()

Fossology\UI\Api\Controllers\FileSearchController::getMainLicenses (   $uploads)
private

Get the list of main licenses from a list of uploads

Parameters
array$uploadsUploads to get main licenses from
Returns
array Unique array of main licenses for given uploads

Definition at line 211 of file FileSearchController.php.

◆ getPackageUpload()

Fossology\UI\Api\Controllers\FileSearchController::getPackageUpload (   $pfileId)
private

Get the upload ids where the file has been uploaded as the source package

Parameters
integer$pfileId

Definition at line 184 of file FileSearchController.php.

◆ getPfileId()

Fossology\UI\Api\Controllers\FileSearchController::getPfileId ( $file)
private

For given file, get the pfile_pk from the file hash. Return false if not found.

Parameters
File$fileFile to get id for
See also
Fossology::UI::Api::Helper::FileHelper::getPfile()

Definition at line 108 of file FileSearchController.php.

Member Data Documentation

◆ $clearingDao

ClearingDao Fossology\UI\Api\Controllers\FileSearchController::$clearingDao
private

Clearing Dao object

Definition at line 41 of file FileSearchController.php.

◆ $fileHelper

FileHelper Fossology\UI\Api\Controllers\FileSearchController::$fileHelper
private

File helper object

Definition at line 35 of file FileSearchController.php.

◆ $licenseDao

LicenseDao Fossology\UI\Api\Controllers\FileSearchController::$licenseDao
private

License Dao object

Definition at line 47 of file FileSearchController.php.


The documentation for this class was generated from the following file: