mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-26 10:21:56 +00:00
Change reader exceptions to PHPExcel_Reader_Exception
This commit is contained in:
@@ -226,18 +226,18 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
|
||||
*
|
||||
* @param string $pFileName
|
||||
* @return boolean
|
||||
* @throws Exception
|
||||
* @throws PHPExcel_Reader_Exception
|
||||
*/
|
||||
public function canRead($pFilename)
|
||||
{
|
||||
// Check if file exists
|
||||
if (!file_exists($pFilename)) {
|
||||
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
}
|
||||
|
||||
// Check if zip class exists
|
||||
if (!class_exists('ZipArchive',FALSE)) {
|
||||
throw new Exception("ZipArchive library is not enabled");
|
||||
throw new PHPExcel_Reader_Exception("ZipArchive library is not enabled");
|
||||
}
|
||||
|
||||
$xl = false;
|
||||
@@ -269,13 +269,13 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
|
||||
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
|
||||
*
|
||||
* @param string $pFilename
|
||||
* @throws Exception
|
||||
* @throws PHPExcel_Reader_Exception
|
||||
*/
|
||||
public function listWorksheetInfo($pFilename)
|
||||
{
|
||||
// Check if file exists
|
||||
if (!file_exists($pFilename)) {
|
||||
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
}
|
||||
|
||||
$worksheetInfo = array();
|
||||
@@ -439,13 +439,13 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
|
||||
* Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object
|
||||
*
|
||||
* @param string $pFilename
|
||||
* @throws Exception
|
||||
* @throws PHPExcel_Reader_Exception
|
||||
*/
|
||||
public function listWorksheetNames($pFilename)
|
||||
{
|
||||
// Check if file exists
|
||||
if (!file_exists($pFilename)) {
|
||||
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
}
|
||||
|
||||
$worksheetNames = array();
|
||||
@@ -478,13 +478,13 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
|
||||
* Loads PHPExcel from file
|
||||
*
|
||||
* @param string $pFilename
|
||||
* @throws Exception
|
||||
* @throws PHPExcel_Reader_Exception
|
||||
*/
|
||||
public function load($pFilename)
|
||||
{
|
||||
// Check if file exists
|
||||
if (!file_exists($pFilename)) {
|
||||
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
}
|
||||
|
||||
// Initialisations
|
||||
|
||||
Reference in New Issue
Block a user