Handle new file uploads from Slim framework and move to FOSSology.
More...
|
| createFileUpload ($uploadedFile, $folderId, $fileDescription, $isPublic, $ignoreScm=0) |
|
| handleUpload ($body, $uploadType, $folderId, $fileDescription, $isPublic, $ignoreScm=0) |
|
| sanitizeVcsData (&$vcsData) |
| Check if the passed VCS object is correct or not. More...
|
|
| sanitizeUrlData (&$urlData) |
| Check if the passed URL object is correct or not. More...
|
|
| sanitizeSrvData (&$srvData) |
| Check if the passed server upload object is correct or not. More...
|
|
| generateVcsUpload ($vcsData, $folderId, $fileDescription, $isPublic, $ignoreScm) |
|
| generateUrlUpload ($urlData, $folderName, $fileDescription, $isPublic, $ignoreScm) |
|
| generateSrvUpload ($srvData, $folderName, $fileDescription, $isPublic, $ignoreScm) |
|
| getMainLicenses ($dbManager, $uploadId, $groupId) |
|
Handle new file uploads from Slim framework and move to FOSSology.
Definition at line 42 of file UploadHelper.php.
Fossology\UI\Api\Helper\UploadHelper::__construct |
( |
| ) |
|
Constructor to get UploadFilePage and UploadVcsPage objects.
Definition at line 90 of file UploadHelper.php.
Fossology\UI\Api\Helper\UploadHelper::createFileUpload |
( |
|
$uploadedFile, |
|
|
|
$folderId, |
|
|
|
$fileDescription, |
|
|
|
$isPublic, |
|
|
|
$ignoreScm = 0 |
|
) |
| |
|
private |
Create request required by UploadFilePage
- Parameters
-
array | $uploadedFile | Uploaded file object by Slim |
string | $folderId | ID of the folder to upload the file |
string | $fileDescription | Description of file uploaded |
string | $isPublic | Upload is public, private or protected |
integer | $ignoreScm | 1 if the SCM should be ignored. |
- Returns
- array Array with status, message and upload id
Definition at line 152 of file UploadHelper.php.
Fossology\UI\Api\Helper\UploadHelper::createNewUpload |
( |
ServerRequestInterface |
$request, |
|
|
|
$folderId, |
|
|
|
$fileDescription, |
|
|
|
$isPublic, |
|
|
|
$ignoreScm, |
|
|
|
$uploadType |
|
) |
| |
Get a request from Slim and translate to Symfony request to be processed by FOSSology
- Parameters
-
ServerRequestInterface | $request | |
string | $folderId | ID of the folder to upload the file |
string | $fileDescription | Description of file uploaded |
string | $isPublic | Upload is public, private or protected |
boolean | $ignoreScm | True if the SCM should be ignored. |
string | $uploadType | Type of upload (if other than file) |
- Returns
- array Array with status, message and upload id
- See also
- createVcsUpload()
-
createFileUpload()
Definition at line 112 of file UploadHelper.php.
Fossology\UI\Api\Helper\UploadHelper::generateSrvUpload |
( |
|
$srvData, |
|
|
|
$folderName, |
|
|
|
$fileDescription, |
|
|
|
$isPublic, |
|
|
|
$ignoreScm |
|
) |
| |
|
private |
Generate the upload by calling handleRequest of HelperToUploadSrvPage
- Parameters
-
array | $srvData | Information from POST |
string | $folderId | ID of the folder |
string | $fileDescription | Description of the upload |
string | $isPublic | Upload is public, private or protected |
integer | $ignoreScm | 1 if the SCM should be ignored. |
- Returns
- array Array with status, message and upload id
Definition at line 457 of file UploadHelper.php.
Fossology\UI\Api\Helper\UploadHelper::generateUploadSummary |
( |
|
$uploadId, |
|
|
|
$groupId |
|
) |
| |
Fossology\UI\Api\Helper\UploadHelper::generateUrlUpload |
( |
|
$urlData, |
|
|
|
$folderName, |
|
|
|
$fileDescription, |
|
|
|
$isPublic, |
|
|
|
$ignoreScm |
|
) |
| |
|
private |
Generate the upload by calling handleRequest of HelperToUploadUrlPage
- Parameters
-
array | $urlData | Information from POST |
string | $folderId | ID of the folder |
string | $fileDescription | Description of the upload |
string | $isPublic | Upload is public, private or protected |
integer | $ignoreScm | 1 if the SCM should be ignored. |
- Returns
- array Array with status, message and upload id
Definition at line 414 of file UploadHelper.php.
Fossology\UI\Api\Helper\UploadHelper::generateVcsUpload |
( |
|
$vcsData, |
|
|
|
$folderId, |
|
|
|
$fileDescription, |
|
|
|
$isPublic, |
|
|
|
$ignoreScm |
|
) |
| |
|
private |
Generate the upload by calling handleRequest of HelperToUploadVcsPage
- Parameters
-
array | $vcsData | Information from POST |
string | $folderId | ID of the folder |
string | $fileDescription | Description of the upload |
string | $isPublic | Upload is public, private or protected |
integer | $ignoreScm | 1 if the SCM should be ignored. |
- Returns
- array Array with status, message and upload id
Definition at line 370 of file UploadHelper.php.
Fossology\UI\Api\Helper\UploadHelper::getMainLicenses |
( |
|
$dbManager, |
|
|
|
$uploadId, |
|
|
|
$groupId |
|
) |
| |
|
private |
Get main license selected for the upload
- Parameters
-
DbManager | $dbManager | DbManager object |
integer | $uploadId | Upload ID |
integer | $groupId | Group ID |
- Returns
- NULL|array
Definition at line 549 of file UploadHelper.php.
Fossology\UI\Api\Helper\UploadHelper::handleUpload |
( |
|
$body, |
|
|
|
$uploadType, |
|
|
|
$folderId, |
|
|
|
$fileDescription, |
|
|
|
$isPublic, |
|
|
|
$ignoreScm = 0 |
|
) |
| |
|
private |
Create request required by Upload pages
- Parameters
-
array | $body | Parsed upload request |
string | $uploadType | Type of upload (url, vcs or server) |
string | $folderId | ID of the folder to upload the file |
string | $fileDescription | Description of file uploaded |
string | $isPublic | Upload is public, private or protected |
integer | $ignoreScm | 1 if the SCM should be ignored. |
- Returns
- array Array with status, message and upload id
Definition at line 192 of file UploadHelper.php.
Fossology\UI\Api\Helper\UploadHelper::sanitizeSrvData |
( |
& |
$srvData | ) |
|
|
private |
Check if the passed server upload object is correct or not.
- Check if all the required parameters are passed by user.
- Add missing keys with empty data to prevent warnings.
- Parameters
-
array | $srvData | Parsed server upload object to be sanitized |
- Returns
- array|boolean True if everything is correct, error array otherwise
Definition at line 339 of file UploadHelper.php.
Fossology\UI\Api\Helper\UploadHelper::sanitizeUrlData |
( |
& |
$urlData | ) |
|
|
private |
Check if the passed URL object is correct or not.
- Check if all the required parameters are passed by user.
- Add missing keys with empty data to prevent warnings.
- Parameters
-
array | $urlData | Parsed URL object to be sanitized |
- Returns
- array|boolean True if everything is correct, error array otherwise
Definition at line 299 of file UploadHelper.php.
Fossology\UI\Api\Helper\UploadHelper::sanitizeVcsData |
( |
& |
$vcsData | ) |
|
|
private |
Check if the passed VCS object is correct or not.
- Check if all the required parameters are passed by user.
- Translate the
vcsType
to required values.
- Add missing keys with empty data to prevent warnings.
- Parameters
-
array | $vcsData | Parsed VCS object to be sanitized |
- Returns
- array|boolean True if everything is correct, error array otherwise
Definition at line 244 of file UploadHelper.php.
array Fossology\UI\Api\Helper\UploadHelper::VALID_UPLOAD_TYPES |
Initial value:= array(
"vcs",
"url",
"server"
)
Array of valid inputs for uploadType parameter
Definition at line 81 of file UploadHelper.php.
array Fossology\UI\Api\Helper\UploadHelper::VALID_VCS_TYPES |
Initial value:Array of valid inputs for vcsType parameter
Definition at line 72 of file UploadHelper.php.
The documentation for this class was generated from the following file: