📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
belediyescripti.demodesign.com.tr
/
_class
/
Classes
/
PHPExcel
📝
IOFactory.php
← Geri Dön
<?php if (!defined("PHPEXCEL_ROOT")) { define("PHPEXCEL_ROOT", dirname(__FILE__) . "/../"); require PHPEXCEL_ROOT . "PHPExcel/Autoloader.php"; } class PHPExcel_IOFactory { private static $autoResolveClasses = ["Excel2007", "Excel5", "Excel2003XML", "OOCalc", "SYLK", "Gnumeric", "HTML", "CSV"]; private static $searchLocations = [["type" => "IWriter", "path" => "PHPExcel/Writer/{0}.php", "class" => "PHPExcel_Writer_{0}"], ["type" => "IReader", "path" => "PHPExcel/Reader/{0}.php", "class" => "PHPExcel_Reader_{0}"]]; private function __construct() { } public static function getSearchLocations() { return self::$searchLocations; } public static function setSearchLocations($value) { if (is_array($value)) { self::$searchLocations = $value; } else { throw new PHPExcel_Reader_Exception("Invalid parameter passed."); } } public static function addSearchLocation($type = "", $location = "", $classname = "") { self::$searchLocations[] = ["type" => $type, "path" => $location, "class" => $classname]; } public static function createWriter(PHPExcel $phpExcel, $writerType = "") { $searchType = "IWriter"; foreach (self::$searchLocations as $searchLocation) { if ($searchLocation["type"] == $searchType) { $className = str_replace("{0}", $writerType, $searchLocation["class"]); $instance = new $className($phpExcel); if ($instance !== NULL) { return $instance; } } } throw new PHPExcel_Reader_Exception("No " . $searchType . " found for type " . $writerType); } public static function createReader($readerType = "") { $searchType = "IReader"; foreach (self::$searchLocations as $searchLocation) { if ($searchLocation["type"] == $searchType) { $className = str_replace("{0}", $readerType, $searchLocation["class"]); $instance = new $className(); if ($instance !== NULL) { return $instance; } } } throw new PHPExcel_Reader_Exception("No " . $searchType . " found for type " . $readerType); } public static function load($pFilename) { $reader = self::createReaderForFile($pFilename); return $reader->load($pFilename); } public static function identify($pFilename) { $reader = self::createReaderForFile($pFilename); $className = get_class($reader); $classType = explode("_", $className); unset($reader); return array_pop($classType); } public static function createReaderForFile($pFilename) { $pathinfo = pathinfo($pFilename); $extensionType = NULL; if (isset($pathinfo["extension"])) { strtolower($pathinfo["extension"]); switch (strtolower($pathinfo["extension"])) { case "xlsx": case "xlsm": case "xltx": case "xltm": $extensionType = "Excel2007"; break; case "xls": case "xlt": $extensionType = "Excel5"; break; case "ods": case "ots": $extensionType = "OOCalc"; break; case "slk": $extensionType = "SYLK"; break; case "xml": $extensionType = "Excel2003XML"; break; case "gnumeric": $extensionType = "Gnumeric"; break; case "htm": case "html": $extensionType = "HTML"; break; case "csv": default: if ($extensionType !== NULL) { $reader = self::createReader($extensionType); if (isset($reader) && $reader->canRead($pFilename)) { return $reader; } } } } foreach (self::$autoResolveClasses as $autoResolveClass) { if ($autoResolveClass !== $extensionType) { $reader = self::createReader($autoResolveClass); if ($reader->canRead($pFilename)) { return $reader; } } } throw new PHPExcel_Reader_Exception("Unable to identify a reader for this file"); } } ?>
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula