update lock clucknut
All checks were successful
All checks were successful
This commit is contained in:
6
vendor/maatwebsite/excel/README.md
vendored
6
vendor/maatwebsite/excel/README.md
vendored
@@ -32,7 +32,7 @@
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/SpartnerNL/Laravel-Excel/actions">
|
||||
<img src="https://github.com/Maatwebsite/Laravel-Excel/workflows/Run%20tests/badge.svg?branch=3.1" alt="Github Actions">
|
||||
<img src="https://github.com/SpartnerNL/Laravel-Excel/actions/workflows/run-tests.yml/badge.svg" alt="Github Actions">
|
||||
</a>
|
||||
|
||||
<a href="https://styleci.io/repos/14259390">
|
||||
@@ -47,7 +47,7 @@
|
||||
<img src="https://poser.pugx.org/maatwebsite/excel/downloads.png" alt="Total Downloads">
|
||||
</a>
|
||||
|
||||
<a href="https://packagist.org/packages/maatwebsite/excel">
|
||||
<a href="https://github.com/SpartnerNL/Laravel-Excel/blob/3.1/LICENSE">
|
||||
<img src="https://poser.pugx.org/maatwebsite/excel/license.png" alt="License">
|
||||
</a>
|
||||
</p>
|
||||
@@ -102,4 +102,4 @@ ## :wrench: Supported Versions
|
||||
|---- |----|----|----|
|
||||
| 2.1 | <=5.6 | <=7.0 | Unsupported since 15-5-2018 |
|
||||
| 3.0 | ^5.5 | ^7.0 | Unsupported since 31-12-2018 |
|
||||
| 3.1 | >=5.8 \| <=11.x | ^7.2 \| ^8.0 | New features |
|
||||
| 3.1 | >=5.8 \| <=12.x | ^7.2 \| ^8.0 | New features |
|
||||
|
||||
6
vendor/maatwebsite/excel/composer.json
vendored
6
vendor/maatwebsite/excel/composer.json
vendored
@@ -23,14 +23,14 @@
|
||||
"ext-json": "*",
|
||||
"php": "^7.0||^8.0",
|
||||
"phpoffice/phpspreadsheet": "^1.30.0",
|
||||
"illuminate/support": "5.8.*||^6.0||^7.0||^8.0||^9.0||^10.0||^11.0||^12.0",
|
||||
"illuminate/support": "5.8.*||^6.0||^7.0||^8.0||^9.0||^10.0||^11.0||^12.0||^13.0",
|
||||
"psr/simple-cache": "^1.0||^2.0||^3.0",
|
||||
"composer/semver": "^3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"orchestra/testbench": "^6.0||^7.0||^8.0||^9.0||^10.0",
|
||||
"orchestra/testbench": "^6.0||^7.0||^8.0||^9.0||^10.0||^11.0",
|
||||
"predis/predis": "^1.1",
|
||||
"laravel/scout": "^7.0||^8.0||^9.0||^10.0"
|
||||
"laravel/scout": "^7.0||^8.0||^9.0||^10.0||^11.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
0
vendor/maatwebsite/excel/src/Console/ExportMakeCommand.php
vendored
Normal file → Executable file
0
vendor/maatwebsite/excel/src/Console/ExportMakeCommand.php
vendored
Normal file → Executable file
0
vendor/maatwebsite/excel/src/Console/ImportMakeCommand.php
vendored
Normal file → Executable file
0
vendor/maatwebsite/excel/src/Console/ImportMakeCommand.php
vendored
Normal file → Executable file
2
vendor/maatwebsite/excel/src/Exporter.php
vendored
2
vendor/maatwebsite/excel/src/Exporter.php
vendored
@@ -27,7 +27,7 @@ public function download($export, string $fileName, ?string $writerType = null,
|
||||
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||
*/
|
||||
public function store($export, string $filePath, ?string $disk = null, ?string $writerType = null, $diskOptions = []);
|
||||
public function store($export, string $filePath, ?string $diskName = null, ?string $writerType = null, $diskOptions = []);
|
||||
|
||||
/**
|
||||
* @param object $export
|
||||
|
||||
@@ -22,11 +22,12 @@ class WriterFactory
|
||||
* @param string $writerType
|
||||
* @param Spreadsheet $spreadsheet
|
||||
* @param object $export
|
||||
* @param string|null $filePath
|
||||
* @return IWriter
|
||||
*
|
||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||
*/
|
||||
public static function make(string $writerType, Spreadsheet $spreadsheet, $export): IWriter
|
||||
public static function make(string $writerType, Spreadsheet $spreadsheet, $export, ?string $filePath = null): IWriter
|
||||
{
|
||||
$writer = IOFactory::createWriter($spreadsheet, $writerType);
|
||||
|
||||
@@ -45,6 +46,11 @@ public static function make(string $writerType, Spreadsheet $spreadsheet, $expor
|
||||
if ($writer instanceof Csv) {
|
||||
static::applyCsvSettings(config('excel.exports.csv', []));
|
||||
|
||||
// Auto-detect TSV files and apply tab delimiter
|
||||
if ($filePath && static::isTsvFile($filePath) && !($export instanceof WithCustomCsvSettings)) {
|
||||
static::applyCsvSettings(['delimiter' => "\t"]);
|
||||
}
|
||||
|
||||
if ($export instanceof WithCustomCsvSettings) {
|
||||
static::applyCsvSettings($export->getCsvSettings());
|
||||
}
|
||||
@@ -89,4 +95,16 @@ private static function includesCharts($export): bool
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $filePath
|
||||
* @return bool
|
||||
*/
|
||||
private static function isTsvFile(string $filePath): bool
|
||||
{
|
||||
$pathInfo = pathinfo($filePath);
|
||||
$extension = strtolower($pathInfo['extension'] ?? '');
|
||||
|
||||
return $extension === 'tsv';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public function handle(Writer $writer)
|
||||
}
|
||||
|
||||
// Write to temp file with empty sheets.
|
||||
$writer->write($sheetExport, $this->temporaryFile, $this->writerType);
|
||||
$writer->write($this->export, $this->temporaryFile, $this->writerType);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
3
vendor/maatwebsite/excel/src/Writer.php
vendored
3
vendor/maatwebsite/excel/src/Writer.php
vendored
@@ -172,7 +172,8 @@ public function write($export, TemporaryFile $temporaryFile, string $writerType)
|
||||
$writer = WriterFactory::make(
|
||||
$writerType,
|
||||
$this->spreadsheet,
|
||||
$export
|
||||
$export,
|
||||
$temporaryFile->getLocalPath()
|
||||
);
|
||||
|
||||
if ($temporaryFile instanceof RemoteTemporaryFile && !$temporaryFile->existsLocally() && !$this->isRunningServerless()) {
|
||||
|
||||
Reference in New Issue
Block a user