title: CodeIgniter with PHPExcel fatal error cannot redeclare class IOFactory
body: <p>I'm trying to use PHPExcel with CodeIgniter.</p>
  
  <p>My problem is when i want to use this method below, I got <strong>PHP Fatal Error : Cannot redeclare class IOFactory</strong> </p>
  
  <blockquote>
    <p>If you're uncertain of the filetype, you can use the IO Factory's identify() method to identify the reader that you need, before using the createReader() method to instantiate the reader object.</p>
  </blockquote>
  
  <p>Below is my code:</p>
  
  <pre><code>$this-&gt;load-&gt;library('PHPExcel');
  
  $this-&gt;load-&gt;library('PHPExcel/IOFactory');
  
  $path = $upload_data['full_path'];
  
  $inputFileType = PHPExcel_IOFactory::identify($path);
  
  $objReader = PHPExcel_IOFactory::createReader($inputFileType);
  
  $objPHPExcel = $objReader-&gt;load($path);
  
  $objWorksheet = $objPHPExcel-&gt;getActiveSheet();
  </code></pre>
  
  <p>I try to find if the IOFactory class already created somewhere but cannot find it.</p>
  
  <p>FYI, im using the latest version of CodeIgniter (2.1) and PHPExcel (1.7.6) at this time of writing.</p>