public static function GdprTasksSarWorker::readCsv in General Data Protection Regulation 8
Same name and namespace in other branches
- 8.2 modules/gdpr_tasks/src/Plugin/QueueWorker/GdprTasksSarWorker.php \Drupal\gdpr_tasks\Plugin\QueueWorker\GdprTasksSarWorker::readCsv()
- 3.0.x modules/gdpr_tasks/src/Plugin/QueueWorker/GdprTasksSarWorker.php \Drupal\gdpr_tasks\Plugin\QueueWorker\GdprTasksSarWorker::readCsv()
Read data from a CSV file.
@todo: Use something like this instead: \Consolidation\OutputFormatters\Formatters\CsvFormatter
Parameters
string $filename: The filename to read from (supports streams).
Return value
array CSV file data.
File
- modules/
gdpr_tasks/ src/ Plugin/ QueueWorker/ GdprTasksSarWorker.php, line 414
Class
- GdprTasksSarWorker
- Processes SARs tasks when data processing is required.
Namespace
Drupal\gdpr_tasks\Plugin\QueueWorkerCode
public static function readCsv($filename) {
$data = [];
$handle = fopen($filename, 'r');
while (!feof($handle)) {
$data[] = fgetcsv($handle);
}
fclose($handle);
return $data;
}