| 
									
										
										
										
											2017-10-01 08:48:59 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use PhpOffice\PhpSpreadsheet\IOFactory; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | require __DIR__ . '/../Header.php'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $inputFileName = __DIR__ . '/sampleData/non-existing-file.xls'; | 
					
						
							|  |  |  | $helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory to identify the format'); | 
					
						
							| 
									
										
										
										
											2017-10-01 11:07:04 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-01 08:48:59 +00:00
										 |  |  | try { | 
					
						
							|  |  |  |     $spreadsheet = IOFactory::load($inputFileName); | 
					
						
							|  |  |  | } catch (InvalidArgumentException $e) { | 
					
						
							|  |  |  |     $helper->log('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) . '": ' . $e->getMessage()); | 
					
						
							|  |  |  | } |