mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-26 04:28:36 +00:00
committed by
Adrien Crivelli
parent
77199c9877
commit
07455d24f6
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
|
||||
use InvalidArgumentException;
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
|
||||
error_reporting(E_ALL);
|
||||
set_time_limit(0);
|
||||
|
||||
@@ -24,8 +27,8 @@ require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||
$inputFileName = './sampleData/example_1.xls';
|
||||
echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory to identify the format<br />';
|
||||
try {
|
||||
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$spreadsheet = IOFactory::load($inputFileName);
|
||||
} catch (InvalidArgumentException $e) {
|
||||
die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) . '": ' . $e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user