Definition at line 45 of file IOFactory.php.
◆ __construct()
PHPExcel_IOFactory::__construct |
( |
| ) |
|
|
private |
◆ addSearchLocation()
static PHPExcel_IOFactory::addSearchLocation |
( |
|
$type = '' , |
|
|
|
$location = '' , |
|
|
|
$classname = '' |
|
) |
| |
|
static |
Add search location.
public
- Parameters
-
string | $type | Example: IWriter |
string | $location | Example: PHPExcel/Writer/{0}.php |
string | $classname | Example: PHPExcel_Writer_{0} |
Definition at line 118 of file IOFactory.php.
References $location, and array.
119 self::$_searchLocations[] =
array(
'type' => $type,
'path' =>
$location,
'class' => $classname );
Create styles array
The data for the language used.
◆ createReader()
static PHPExcel_IOFactory::createReader |
( |
|
$readerType = '' | ) |
|
|
static |
Create PHPExcel_Reader_IReader.
public
- Parameters
-
string | $readerType | Example: Excel2007 |
- Returns
- PHPExcel_Reader_IReader
- Exceptions
-
Definition at line 161 of file IOFactory.php.
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) {
◆ createReaderForFile()
static PHPExcel_IOFactory::createReaderForFile |
( |
|
$pFilename | ) |
|
|
static |
Create PHPExcel_Reader_IReader for file using automatic PHPExcel_Reader_IReader resolution.
public
- Parameters
-
string | $pFilename | The name of the spreadsheet file |
- Returns
- PHPExcel_Reader_IReader
- Exceptions
-
Definition at line 221 of file IOFactory.php.
References $reader.
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) {
266 $reader = self::createReader($extensionType);
276 foreach (self::$_autoResolveClasses as $autoResolveClass) {
278 if ($autoResolveClass !== $extensionType) {
279 $reader = self::createReader($autoResolveClass);
280 if (
$reader->canRead($pFilename)) {
◆ createWriter()
static PHPExcel_IOFactory::createWriter |
( |
PHPExcel |
$phpExcel, |
|
|
|
$writerType = '' |
|
) |
| |
|
static |
◆ getSearchLocations()
static PHPExcel_IOFactory::getSearchLocations |
( |
| ) |
|
|
static |
Get search locations.
public
- Returns
- array
Definition at line 89 of file IOFactory.php.
90 return self::$_searchLocations;
◆ identify()
static PHPExcel_IOFactory::identify |
( |
|
$pFilename | ) |
|
|
static |
Identify file type using automatic PHPExcel_Reader_IReader resolution.
public
- Parameters
-
string | $pFilename | The name of the spreadsheet file to identify |
- Returns
- string
- Exceptions
-
Definition at line 204 of file IOFactory.php.
References $reader.
205 $reader = self::createReaderForFile($pFilename);
206 $className = get_class(
$reader);
207 $classType = explode(
'_',$className);
209 return array_pop($classType);
◆ load()
static PHPExcel_IOFactory::load |
( |
|
$pFilename | ) |
|
|
static |
◆ setSearchLocations()
static PHPExcel_IOFactory::setSearchLocations |
( |
|
$value | ) |
|
|
static |
Set search locations.
public
- Parameters
-
- Exceptions
-
Definition at line 101 of file IOFactory.php.
102 if (is_array($value)) {
103 self::$_searchLocations = $value;
◆ $_autoResolveClasses
PHPExcel_IOFactory::$_autoResolveClasses |
|
staticprivate |
Initial value: 'Excel2007',
'Excel5',
'Excel2003XML',
'OOCalc',
'SYLK',
'Gnumeric',
'HTML',
'CSV',
)
Definition at line 66 of file IOFactory.php.
◆ $_searchLocations
PHPExcel_IOFactory::$_searchLocations |
|
staticprivate |
Initial value: array(
'type' =>
'IWriter',
'path' =>
'PHPExcel/Writer/{0}.php',
'class' =>
'PHPExcel_Writer_{0}' ),
array(
'type' =>
'IReader',
'path' =>
'PHPExcel/Reader/{0}.php',
'class' =>
'PHPExcel_Reader_{0}' )
)
Definition at line 54 of file IOFactory.php.
The documentation for this class was generated from the following file:
- libs/composer/vendor/phpoffice/phpexcel/Classes/PHPExcel/IOFactory.php