Inline documentation changes
git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@85955 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
parent
097a30b6d8
commit
0285c3e428
|
@ -162,10 +162,11 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can the current PHPExcel_Reader_IReader read the file?
|
* Can the current PHPExcel_Reader_IReader read the file?
|
||||||
*
|
*
|
||||||
* @param string $pFileName
|
* @param string $pFileName
|
||||||
* @return boolean
|
* @return boolean
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function canRead($pFilename)
|
public function canRead($pFilename)
|
||||||
{
|
{
|
||||||
|
|
|
@ -177,30 +177,31 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can the current PHPExcel_Reader_IReader read the file?
|
* Can the current PHPExcel_Reader_IReader read the file?
|
||||||
*
|
*
|
||||||
* @param string $pFileName
|
* @param string $pFileName
|
||||||
* @return boolean
|
* @return boolean
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function canRead($pFilename)
|
public function canRead($pFilename)
|
||||||
{
|
{
|
||||||
// Check if zip class exists
|
|
||||||
if (!class_exists('ZipArchive')) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if file exists
|
// Check if file exists
|
||||||
if (!file_exists($pFilename)) {
|
if (!file_exists($pFilename)) {
|
||||||
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if zip class exists
|
||||||
|
if (!class_exists('ZipArchive')) {
|
||||||
|
throw new Exception("ZipArchive library is not enabled");
|
||||||
|
}
|
||||||
|
|
||||||
$xl = false;
|
$xl = false;
|
||||||
// Load file
|
// Load file
|
||||||
$zip = new ZipArchive;
|
$zip = new ZipArchive;
|
||||||
if ($zip->open($pFilename) === true) {
|
if ($zip->open($pFilename) === true) {
|
||||||
// check if it is an OOXML archive
|
// check if it is an OOXML archive
|
||||||
$rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels"));
|
$rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels"));
|
||||||
if ($rels) {
|
if ($rels !== false) {
|
||||||
foreach ($rels->Relationship as $rel) {
|
foreach ($rels->Relationship as $rel) {
|
||||||
switch ($rel["Type"]) {
|
switch ($rel["Type"]) {
|
||||||
case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument":
|
case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument":
|
||||||
|
|
|
@ -179,23 +179,24 @@ class PHPExcel_Reader_Gnumeric implements PHPExcel_Reader_IReader
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can the current PHPExcel_Reader_IReader read the file?
|
* Can the current PHPExcel_Reader_IReader read the file?
|
||||||
*
|
*
|
||||||
* @param string $pFileName
|
* @param string $pFileName
|
||||||
* @return boolean
|
* @return boolean
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function canRead($pFilename)
|
public function canRead($pFilename)
|
||||||
{
|
{
|
||||||
// Check if gzlib functions are available
|
|
||||||
if (!function_exists('gzread')) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if file exists
|
// Check if file exists
|
||||||
if (!file_exists($pFilename)) {
|
if (!file_exists($pFilename)) {
|
||||||
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if gzlib functions are available
|
||||||
|
if (!function_exists('gzread')) {
|
||||||
|
throw new Exception("gzlib library is not enabled");
|
||||||
|
}
|
||||||
|
|
||||||
// Read signature data (first 3 bytes)
|
// Read signature data (first 3 bytes)
|
||||||
$fh = fopen($pFilename, 'r');
|
$fh = fopen($pFilename, 'r');
|
||||||
$data = fread($fh, 2);
|
$data = fread($fh, 2);
|
||||||
|
|
|
@ -169,23 +169,24 @@ class PHPExcel_Reader_OOCalc implements PHPExcel_Reader_IReader
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can the current PHPExcel_Reader_IReader read the file?
|
* Can the current PHPExcel_Reader_IReader read the file?
|
||||||
*
|
*
|
||||||
* @param string $pFileName
|
* @param string $pFileName
|
||||||
* @return boolean
|
* @return boolean
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function canRead($pFilename)
|
public function canRead($pFilename)
|
||||||
{
|
{
|
||||||
// Check if zip class exists
|
|
||||||
if (!class_exists('ZipArchive')) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if file exists
|
// Check if file exists
|
||||||
if (!file_exists($pFilename)) {
|
if (!file_exists($pFilename)) {
|
||||||
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if zip class exists
|
||||||
|
if (!class_exists('ZipArchive')) {
|
||||||
|
throw new Exception("ZipArchive library is not enabled");
|
||||||
|
}
|
||||||
|
|
||||||
// Load file
|
// Load file
|
||||||
$zip = new ZipArchive;
|
$zip = new ZipArchive;
|
||||||
if ($zip->open($pFilename) === true) {
|
if ($zip->open($pFilename) === true) {
|
||||||
|
|
|
@ -87,10 +87,11 @@ class PHPExcel_Reader_SYLK implements PHPExcel_Reader_IReader
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can the current PHPExcel_Reader_IReader read the file?
|
* Can the current PHPExcel_Reader_IReader read the file?
|
||||||
*
|
*
|
||||||
* @param string $pFileName
|
* @param string $pFileName
|
||||||
* @return boolean
|
* @return boolean
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function canRead($pFilename)
|
public function canRead($pFilename)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue