Use class_exists() with FALSE second argument

This commit is contained in:
Mark Baker 2012-09-06 22:56:56 +01:00
parent 9820b46649
commit f87ca1419d
6 changed files with 40 additions and 19 deletions

View File

@ -65,7 +65,7 @@ class PHPExcel_Autoloader
* @param string $pClassName Name of the object to load * @param string $pClassName Name of the object to load
*/ */
public static function Load($pClassName){ public static function Load($pClassName){
if ((class_exists($pClassName)) || (strpos($pClassName, 'PHPExcel') !== 0)) { if ((class_exists($pClassName,FALSE)) || (strpos($pClassName, 'PHPExcel') !== 0)) {
// Either already loaded, or not a PHPExcel class request // Either already loaded, or not a PHPExcel class request
return FALSE; return FALSE;
} }

View File

@ -33,7 +33,7 @@
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PHPExcel_CachedObjectStorage_CacheBase { abstract class PHPExcel_CachedObjectStorage_CacheBase {
/** /**
* Parent worksheet * Parent worksheet

View File

@ -267,7 +267,7 @@ class PHPExcel_CachedObjectStorage_SQLite3 extends PHPExcel_CachedObjectStorage_
* @return boolean * @return boolean
*/ */
public static function cacheMethodIsAvailable() { public static function cacheMethodIsAvailable() {
if (!class_exists('SQLite3')) { if (!class_exists('SQLite3',FALSE)) {
return false; return false;
} }

View File

@ -236,7 +236,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
} }
// Check if zip class exists // Check if zip class exists
if (!class_exists('ZipArchive')) { if (!class_exists('ZipArchive',FALSE)) {
throw new Exception("ZipArchive library is not enabled"); throw new Exception("ZipArchive library is not enabled");
} }

View File

@ -190,7 +190,7 @@ class PHPExcel_Reader_OOCalc implements PHPExcel_Reader_IReader
} }
// Check if zip class exists // Check if zip class exists
if (!class_exists('ZipArchive')) { if (!class_exists('ZipArchive',FALSE)) {
throw new Exception("ZipArchive library is not enabled"); throw new Exception("ZipArchive library is not enabled");
} }

View File

@ -1,15 +1,36 @@
# PHPExcel - OpenXML - Read, Write and Create Excel documents in PHP - Spreadsheet engine # PHPExcel - OpenXML - Read, Write and Create spreadsheet documents in PHP - Spreadsheet engine
PHPExcel is a Project providing a set of classes for the PHP programming language that allow you to write to and read from different spreadsheet file formats, like Excel (BIFF) .xls, Excel 2007 (OfficeOpenXML) .xlsx, CSV, Libre/OpenOffice Calc .ods, Gnumeric, PDF, HTML, ... This project is built around Microsoft's OpenXML standard and PHP. PHPExcel is a library written in pure PHP and providing a set of classes that allow you to write to and read from different spreadsheet file formats, like Excel (BIFF) .xls, Excel 2007 (OfficeOpenXML) .xlsx, CSV, Libre/OpenOffice Calc .ods, Gnumeric, PDF, HTML, ... This project is built around Microsoft's OpenXML standard and PHP.
Checkout the features this class set provides, such as setting spreadsheet meta data (author, title, description, ...), multiple worksheets, different fonts and font styles, cell borders, fills, gradients, adding images to your spreadsheet, calculating formulas, converting between file types and much, much more!
Want to bookmark this page? Please use [www.phpexcel.net](http://www.phpexcel.net) as the URL. ## File Formats supported
### Reading
* BIFF 5-8 (.xls) Excel 95 and above
* Office Open XML (.xlsx) Excel 2007 and above
* SpreadsheetML (.xml) Excel 2003
* Open Document Format/OASIS (.ods)
* Gnumeric
* HTML
* SYLK
* CSV
### Writing
* BIFF 8 (.xls) Excel 95 and above
* Office Open XML (.xlsx) Excel 2007 and above
* HTML
* CSV
* PDF (using either the tcPDF, DomPDF or mPDF libraries, which need to be installed separately)
## Requirements
* PHP version 5.2.0 or higher
* PHP extension php_zip enabled (required if you need PHPExcel to handle .xlsx .ods or .gnumeric files)
* PHP extension php_xml enabled
* PHP extension php_gd2 enabled (optional, but required for exact column width autocalculation)
## Want to contribute? ## Want to contribute?
Fork us! Fork us!
## Donations
[<img src="https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif">](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7UYH9AS6HND74) via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7UYH9AS6HND74).
## License ## License
PHPExcel is licensed under [LGPL (GNU LESSER GENERAL PUBLIC LICENSE)](https://github.com/PHPOffice/PHPExcel/blob/master/license.md) PHPExcel is licensed under [LGPL (GNU LESSER GENERAL PUBLIC LICENSE)](https://github.com/PHPOffice/PHPExcel/blob/master/license.md)