34        define(
'PHPEXCEL_ROOT', dirname(__FILE__) . 
'/../');
 
   35        require(PHPEXCEL_ROOT . 
'PHPExcel/Autoloader.php');
 
   55                array( 
'type' => 
'IWriter', 
'path' => 
'PHPExcel/Writer/{0}.php', 
'class' => 
'PHPExcel_Writer_{0}' ),
 
   56                array( 
'type' => 
'IReader', 
'path' => 
'PHPExcel/Reader/{0}.php', 
'class' => 
'PHPExcel_Reader_{0}' )
 
  102                if (is_array($value)) {
 
  103                        self::$_searchLocations = $value;
 
  119                self::$_searchLocations[] = array( 
'type' => 
$type, 
'path' => 
$location, 
'class' => $classname );
 
  134                $searchType = 
'IWriter';
 
  137                foreach (self::$_searchLocations as $searchLocation) {
 
  138                        if ($searchLocation[
'type'] == $searchType) {
 
  139                                $className = str_replace(
'{0}', $writerType, $searchLocation[
'class']);
 
  141                                $instance = 
new $className($phpExcel);
 
  142                                if ($instance !== NULL) {
 
  163                $searchType = 
'IReader';
 
  166                foreach (self::$_searchLocations as $searchLocation) {
 
  167                        if ($searchLocation[
'type'] == $searchType) {
 
  168                                $className = str_replace(
'{0}', $readerType, $searchLocation[
'class']);
 
  170                                $instance = 
new $className();
 
  171                                if ($instance !== NULL) {
 
  190        public static function load($pFilename) {
 
  192                return $reader->load($pFilename);
 
  206                $className = get_class(
$reader);
 
  207                $classType = explode(
'_',$className);
 
  209                return array_pop($classType);
 
  224                $pathinfo = pathinfo($pFilename);
 
  226                $extensionType = NULL;
 
  227                if (isset($pathinfo[
'extension'])) {
 
  228                        switch (strtolower($pathinfo[
'extension'])) {
 
  233                                        $extensionType = 
'Excel2007';
 
  237                                        $extensionType = 
'Excel5';
 
  241                                        $extensionType = 
'OOCalc';
 
  244                                        $extensionType = 
'SYLK';
 
  247                                        $extensionType = 
'Excel2003XML';
 
  250                                        $extensionType = 
'Gnumeric';
 
  254                                        $extensionType = 
'HTML';
 
  265                        if ($extensionType !== NULL) {
 
  276                foreach (self::$_autoResolveClasses as $autoResolveClass) {
 
  278                        if ($autoResolveClass !== $extensionType) {
 
  280                                if (
$reader->canRead($pFilename)) {
 
An exception for terminatinating execution or to throw for unit testing.
static createWriter(PHPExcel $phpExcel, $writerType='')
Create PHPExcel_Writer_IWriter.
static setSearchLocations($value)
Set search locations.
static $_autoResolveClasses
static addSearchLocation($type='', $location='', $classname='')
Add search location.
static createReader($readerType='')
Create PHPExcel_Reader_IReader.
static createReaderForFile($pFilename)
Create PHPExcel_Reader_IReader for file using automatic PHPExcel_Reader_IReader resolution.
__construct()
Private constructor for PHPExcel_IOFactory.
static load($pFilename)
Loads PHPExcel from file using automatic PHPExcel_Reader_IReader resolution.
static getSearchLocations()
Get search locations.
static identify($pFilename)
Identify file type using automatic PHPExcel_Reader_IReader resolution.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'