Helper class to export license reference bulk data as CSV or JSON from the DB.
More...
Helper class to export license reference bulk data as CSV or JSON from the DB.
Definition at line 21 of file BulkTextExport.php.
◆ __construct()
| Fossology\Lib\Application\BulkTextExport::__construct |
( |
DbManager |
$dbManager | ) |
|
Constructor
- Parameters
-
| DbManager | $dbManager | DB manager to use. |
Definition at line 37 of file BulkTextExport.php.
◆ createCsvContent()
| Fossology\Lib\Application\BulkTextExport::createCsvContent |
( |
|
$result | ) |
|
|
private |
Create CSV content from result array.
- Parameters
-
| array | $result | Database result array |
- Returns
- string CSV content
Definition at line 179 of file BulkTextExport.php.
◆ createJson()
| Fossology\Lib\Application\BulkTextExport::createJson |
( |
|
$result | ) |
|
|
private |
Create JSON content from result array.
- Parameters
-
| array | $result | Database result array |
- Returns
- string JSON content
Definition at line 222 of file BulkTextExport.php.
◆ exportBulkText()
| Fossology\Lib\Application\BulkTextExport::exportBulkText |
( |
|
$user_pk = 0, |
|
|
|
$group_pk = 0, |
|
|
|
$generateJson = false |
|
) |
| |
Export license reference bulk data from the DB as CSV or JSON.
- Parameters
-
| int | $user_pk | Filter by user ID, set 0 to export all |
| int | $group_pk | Filter by group ID, set 0 to export all |
| bool | $generateJson | Whether to generate JSON format instead of CSV |
- Returns
- string CSV or JSON content
Definition at line 79 of file BulkTextExport.php.
◆ groupResultsByText()
| Fossology\Lib\Application\BulkTextExport::groupResultsByText |
( |
|
$result | ) |
|
|
private |
Group flat DB rows by bulk text, splitting licenses into add/remove buckets.
- Parameters
-
| array | $result | Database result array |
- Returns
- array Associative array keyed by rf_text with grouped export fields
Definition at line 119 of file BulkTextExport.php.
◆ normalizeNewlinesForCsv()
| Fossology\Lib\Application\BulkTextExport::normalizeNewlinesForCsv |
( |
|
$value | ) |
|
|
private |
Convert CR/LF variants to literal
for line-safe CSV rows.
- Parameters
-
| string | null | $value | Value to normalize. |
- Returns
- string
Definition at line 209 of file BulkTextExport.php.
◆ setDelimiter()
| Fossology\Lib\Application\BulkTextExport::setDelimiter |
( |
|
$delimiter = ',' | ) |
|
Update the delimiter.
- Parameters
-
| string | $delimiter | New delimiter to use. |
Definition at line 46 of file BulkTextExport.php.
◆ setEnclosure()
| Fossology\Lib\Application\BulkTextExport::setEnclosure |
( |
|
$enclosure = '"' | ) |
|
Update the enclosure.
- Parameters
-
| string | $enclosure | New enclosure to use. |
Definition at line 61 of file BulkTextExport.php.
◆ $dbManager
| DbManager Fossology\Lib\Application\BulkTextExport::$dbManager |
|
protected |
◆ $delimiter
| string Fossology\Lib\Application\BulkTextExport::$delimiter = ',' |
|
protected |
◆ $enclosure
| string Fossology\Lib\Application\BulkTextExport::$enclosure = '"' |
|
protected |
The documentation for this class was generated from the following file: