Change reader exceptions to PHPExcel_Reader_Exception

This commit is contained in:
Mark Baker
2012-10-29 23:48:29 +00:00
parent d66f61bfbb
commit 8f3640e44c
18 changed files with 167 additions and 123 deletions
+9 -9
View File
@@ -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