Пример #1
0
 /**
  * Create new file.
  *
  * @param string  $file
  * @param Closure $callback
  * @param null    $format
  *
  * @throws \Maatwebsite\Clerk\Exceptions\DriverNotFoundException
  * @return \Maatwebsite\Clerk\Excel\Reader
  */
 public static function load($file, Closure $callback = null, $format = null)
 {
     // Passing in empty strings, will prevent a workbook from being initialized
     $instance = new static();
     $format = $format ?: $instance->getFormat();
     return ReaderFactory::create($instance->getDriver('reader'), $file, $callback, $format);
 }
Пример #2
0
 public function test_that_factory_can_guess_the_file_type()
 {
     $this->assertInstanceOf('Maatwebsite\\Clerk\\Excel\\Adapters\\PHPExcel\\Readers\\Reader', ReaderFactory::create(new PHPExcel('drivers.reader.excel2003'), __DIR__ . '/files/test.xls'));
 }