diff --git a/Classes/Autoloader.php b/Classes/Autoloader.php index 89c2625..23a619b 100644 --- a/Classes/Autoloader.php +++ b/Classes/Autoloader.php @@ -155,18 +155,17 @@ class Autoloader */ public function loadClass($className) { - if (null === $this->_namespace || $this->_namespace.$this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace.$this->_namespaceSeparator))) { - $fileName = ''; - $namespace = ''; - if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) { - $namespace = substr($className, 0, $lastNsPos); - $className = substr($className, $lastNsPos + 1); - $fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; - } - $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension; - - require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName; - } + if (null === $this->_namespace || $this->_namespace.$this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace.$this->_namespaceSeparator))) { + $fileName = ''; + $namespace = ''; + if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) { + $namespace = substr($className, 0, $lastNsPos); + $className = substr($className, $lastNsPos + 1); + $fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; + } + $fileName = str_replace(array('\\','_'), DIRECTORY_SEPARATOR, $className) . $this->_fileExtension; + require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName; + } } } diff --git a/Classes/Bootstrap.php b/Classes/Bootstrap.php index 76942e8..6e4b997 100644 --- a/Classes/Bootstrap.php +++ b/Classes/Bootstrap.php @@ -29,15 +29,15 @@ namespace PHPExcel; /** PHPOffice root directory */ if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', dirname(__FILE__) . '/'); + define('PHPEXCEL_ROOT', dirname(__FILE__)); } -include PHPEXCEL_ROOT . 'Autoloader.php'; +include PHPEXCEL_ROOT . '/Autoloader.php'; $autoloader = new Autoloader('PHPExcel', PHPEXCEL_ROOT); $autoloader->register(); -// As we always try to run the autoloader before anything else, we can use it to do a few +// As we always run the bootstrap before anything else, we can use it to do a few // simple checks and initialisations // check mbstring.func_overload if (ini_get('mbstring.func_overload') & 2) { @@ -45,4 +45,3 @@ if (ini_get('mbstring.func_overload') & 2) { } Shared_String::buildCharacterSets(); - diff --git a/Classes/PHPExcel/Cell.php b/Classes/PHPExcel/Cell.php index 47086e5..04ea52d 100644 --- a/Classes/PHPExcel/Cell.php +++ b/Classes/PHPExcel/Cell.php @@ -50,14 +50,14 @@ class Cell * * @var PHPExcel\Cell_IValueBinder */ - private static $_valueBinder = NULL; + protected static $_valueBinder = NULL; /** * Value of the cell * * @var mixed */ - private $_value; + protected $_value; /** * Calculated value of the cell (used for caching) @@ -69,34 +69,34 @@ class Cell * * @var mixed */ - private $_calculatedValue = NULL; + protected $_calculatedValue = NULL; /** * Type of the cell data * * @var string */ - private $_dataType; + protected $_dataType; /** * Parent worksheet * * @var PHPExcel\CachedObjectStorage_CacheBase */ - private $_parent; + protected $_parent; /** * Index to cellXf * * @var int */ - private $_xfIndex; + protected $_xfIndex; /** * Attributes of the formula * */ - private $_formulaAttributes; + protected $_formulaAttributes; /** diff --git a/Classes/PHPExcel/Comment.php b/Classes/PHPExcel/Comment.php index 3d5545b..e319b5e 100644 --- a/Classes/PHPExcel/Comment.php +++ b/Classes/PHPExcel/Comment.php @@ -42,63 +42,63 @@ class Comment implements IComparable * * @var string */ - private $_author; + protected $_author; /** * Rich text comment * * @var PHPExcel\RichText */ - private $_text; + protected $_text; /** * Comment width (CSS style, i.e. XXpx or YYpt) * * @var string */ - private $_width = '96pt'; + protected $_width = '96pt'; /** * Left margin (CSS style, i.e. XXpx or YYpt) * * @var string */ - private $_marginLeft = '59.25pt'; + protected $_marginLeft = '59.25pt'; /** * Top margin (CSS style, i.e. XXpx or YYpt) * * @var string */ - private $_marginTop = '1.5pt'; + protected $_marginTop = '1.5pt'; /** * Visible * * @var boolean */ - private $_visible = false; + protected $_visible = false; /** * Comment height (CSS style, i.e. XXpx or YYpt) * * @var string */ - private $_height = '55.5pt'; + protected $_height = '55.5pt'; /** * Comment fill color * * @var PHPExcel\Style_Color */ - private $_fillColor; + protected $_fillColor; /** * Alignment * * @var string */ - private $_alignment; + protected $_alignment; /** * Create a new PHPExcel\Comment diff --git a/Classes/PHPExcel/DocumentProperties.php b/Classes/PHPExcel/DocumentProperties.php index b04c750..8612515 100644 --- a/Classes/PHPExcel/DocumentProperties.php +++ b/Classes/PHPExcel/DocumentProperties.php @@ -50,84 +50,84 @@ class DocumentProperties * * @var string */ - private $_creator = 'Unknown Creator'; + protected $_creator = 'Unknown Creator'; /** * LastModifiedBy * * @var string */ - private $_lastModifiedBy; + protected $_lastModifiedBy; /** * Created * * @var datetime */ - private $_created; + protected $_created; /** * Modified * * @var datetime */ - private $_modified; + protected $_modified; /** * Title * * @var string */ - private $_title = 'Untitled Spreadsheet'; + protected $_title = 'Untitled Spreadsheet'; /** * Description * * @var string */ - private $_description = ''; + protected $_description = ''; /** * Subject * * @var string */ - private $_subject = ''; + protected $_subject = ''; /** * Keywords * * @var string */ - private $_keywords = ''; + protected $_keywords = ''; /** * Category * * @var string */ - private $_category = ''; + protected $_category = ''; /** * Manager * * @var string */ - private $_manager = ''; + protected $_manager = ''; /** * Company * * @var string */ - private $_company = 'Microsoft Corporation'; + protected $_company = 'Microsoft Corporation'; /** * Custom Properties * * @var string */ - private $_customProperties = array(); + protected $_customProperties = array(); /** diff --git a/Classes/PHPExcel/DocumentSecurity.php b/Classes/PHPExcel/DocumentSecurity.php index 53042a1..9c52a3d 100644 --- a/Classes/PHPExcel/DocumentSecurity.php +++ b/Classes/PHPExcel/DocumentSecurity.php @@ -42,35 +42,35 @@ class DocumentSecurity * * @var boolean */ - private $_lockRevision; + protected $_lockRevision; /** * LockStructure * * @var boolean */ - private $_lockStructure; + protected $_lockStructure; /** * LockWindows * * @var boolean */ - private $_lockWindows; + protected $_lockWindows; /** * RevisionsPassword * * @var string */ - private $_revisionsPassword; + protected $_revisionsPassword; /** * WorkbookPassword * * @var string */ - private $_workbookPassword; + protected $_workbookPassword; /** * Create a new PHPExcel\DocumentSecurity diff --git a/Classes/PHPExcel/IOFactory.php b/Classes/PHPExcel/IOFactory.php index 584b583..f58bd34 100644 --- a/Classes/PHPExcel/IOFactory.php +++ b/Classes/PHPExcel/IOFactory.php @@ -41,10 +41,9 @@ class IOFactory * Search locations * * @var array - * @access private * @static */ - private static $_searchLocations = array( + protected static $_searchLocations = array( array( 'type' => 'IWriter', 'path' => 'PHPExcel/Writer/{0}.php', 'class' => 'Writer_{0}' ), array( 'type' => 'IReader', 'path' => 'PHPExcel/Reader/{0}.php', 'class' => 'Reader_{0}' ) ); @@ -53,10 +52,9 @@ class IOFactory * Autoresolve classes * * @var array - * @access private * @static */ - private static $_autoResolveClasses = array( + protected static $_autoResolveClasses = array( 'Excel2007', 'Excel5', 'Excel2003XML', diff --git a/Classes/PHPExcel/NamedRange.php b/Classes/PHPExcel/NamedRange.php index 4912bb4..02429f4 100644 --- a/Classes/PHPExcel/NamedRange.php +++ b/Classes/PHPExcel/NamedRange.php @@ -42,35 +42,35 @@ class NamedRange * * @var string */ - private $_name; + protected $_name; /** * Worksheet on which the named range can be resolved * * @var PHPExcel\Worksheet */ - private $_worksheet; + protected $_worksheet; /** * Range of the referenced cells * * @var string */ - private $_range; + protected $_range; /** * Is the named range local? (i.e. can only be used on $this->_worksheet) * * @var bool */ - private $_localOnly; + protected $_localOnly; /** * Scope * * @var PHPExcel\Worksheet */ - private $_scope; + protected $_scope; /** * Create a new NamedRange diff --git a/Classes/PHPExcel/Reader/HTML.php b/Classes/PHPExcel/Reader/HTML.php index 7d69257..f3929bd 100644 --- a/Classes/PHPExcel/Reader/HTML.php +++ b/Classes/PHPExcel/Reader/HTML.php @@ -110,7 +110,7 @@ class Reader_HTML extends Reader_Abstract implements Reader_IReader { // Reading 2048 bytes should be enough to validate that the format is HTML $data = fread($this->_fileHandle, 2048); - if ((strpos('<',$data) !== FALSE) && + if ((strpos($data, '<') !== FALSE) && (strlen($data) !== strlen(strip_tags($data)))) { return TRUE; } diff --git a/Classes/PHPExcel/RichText.php b/Classes/PHPExcel/RichText.php index cefe846..462aa68 100644 --- a/Classes/PHPExcel/RichText.php +++ b/Classes/PHPExcel/RichText.php @@ -42,7 +42,7 @@ class RichText implements IComparable * * @var PHPExcel\RichText_ITextElement[] */ - private $_richTextElements; + protected $_richTextElements; /** * Create a new PHPExcel\RichText instance diff --git a/Classes/PHPExcel/Settings.php b/Classes/PHPExcel/Settings.php index 4bb7ab9..371d167 100644 --- a/Classes/PHPExcel/Settings.php +++ b/Classes/PHPExcel/Settings.php @@ -44,11 +44,11 @@ class Settings const PDF_RENDERER_MPDF = 'mPDF'; - private static $_chartRenderers = array( + protected static $_chartRenderers = array( self::CHART_RENDERER_JPGRAPH, ); - private static $_pdfRenderers = array( + protected static $_pdfRenderers = array( self::PDF_RENDERER_TCPDF, self::PDF_RENDERER_DOMPDF, self::PDF_RENDERER_MPDF, @@ -62,7 +62,7 @@ class Settings * * @var string */ - private static $_zipClass = self::ZIPARCHIVE; + protected static $_zipClass = self::ZIPARCHIVE; /** @@ -72,14 +72,14 @@ class Settings * * @var string */ - private static $_chartRendererName = NULL; + protected static $_chartRendererName = NULL; /** * Directory Path to the external Library used for rendering charts * * @var string */ - private static $_chartRendererPath = NULL; + protected static $_chartRendererPath = NULL; /** @@ -89,14 +89,14 @@ class Settings * * @var string */ - private static $_pdfRendererName = NULL; + protected static $_pdfRendererName = NULL; /** * Directory Path to the external Library used for rendering PDF files * * @var string */ - private static $_pdfRendererPath = NULL; + protected static $_pdfRendererPath = NULL; /** diff --git a/Classes/PHPExcel/Worksheet.php b/Classes/PHPExcel/Worksheet.php index 74608cf..ac39f58 100644 --- a/Classes/PHPExcel/Worksheet.php +++ b/Classes/PHPExcel/Worksheet.php @@ -52,280 +52,280 @@ class Worksheet implements IComparable * * @var array */ - private static $_invalidCharacters = array('*', ':', '/', '\\', '?', '[', ']'); + protected static $_invalidCharacters = array('*', ':', '/', '\\', '?', '[', ']'); /** * Parent spreadsheet * * @var PHPExcel */ - private $_parent; + protected $_parent; /** * Cacheable collection of cells * * @var PHPExcel\CachedObjectStorage_xxx */ - private $_cellCollection = null; + protected $_cellCollection = null; /** * Collection of row dimensions * * @var PHPExcel\Worksheet_RowDimension[] */ - private $_rowDimensions = array(); + protected $_rowDimensions = array(); /** * Default row dimension * * @var PHPExcel\Worksheet_RowDimension */ - private $_defaultRowDimension = null; + protected $_defaultRowDimension = null; /** * Collection of column dimensions * * @var PHPExcel\Worksheet_ColumnDimension[] */ - private $_columnDimensions = array(); + protected $_columnDimensions = array(); /** * Default column dimension * * @var PHPExcel\Worksheet_ColumnDimension */ - private $_defaultColumnDimension = null; + protected $_defaultColumnDimension = null; /** * Collection of drawings * * @var PHPExcel\Worksheet_BaseDrawing[] */ - private $_drawingCollection = null; + protected $_drawingCollection = null; /** * Collection of Chart objects * * @var PHPExcel\Chart[] */ - private $_chartCollection = array(); + protected $_chartCollection = array(); /** * Worksheet title * * @var string */ - private $_title; + protected $_title; /** * Sheet state * * @var string */ - private $_sheetState; + protected $_sheetState; /** * Page setup * * @var PHPExcel\Worksheet_PageSetup */ - private $_pageSetup; + protected $_pageSetup; /** * Page margins * * @var PHPExcel\Worksheet_PageMargins */ - private $_pageMargins; + protected $_pageMargins; /** * Page header/footer * * @var PHPExcel\Worksheet_HeaderFooter */ - private $_headerFooter; + protected $_headerFooter; /** * Sheet view * * @var PHPExcel\Worksheet_SheetView */ - private $_sheetView; + protected $_sheetView; /** * Protection * * @var PHPExcel\Worksheet_Protection */ - private $_protection; + protected $_protection; /** * Collection of styles * * @var PHPExcel\Style[] */ - private $_styles = array(); + protected $_styles = array(); /** * Conditional styles. Indexed by cell coordinate, e.g. 'A1' * * @var array */ - private $_conditionalStylesCollection = array(); + protected $_conditionalStylesCollection = array(); /** * Is the current cell collection sorted already? * * @var boolean */ - private $_cellCollectionIsSorted = false; + protected $_cellCollectionIsSorted = false; /** * Collection of breaks * * @var array */ - private $_breaks = array(); + protected $_breaks = array(); /** * Collection of merged cell ranges * * @var array */ - private $_mergeCells = array(); + protected $_mergeCells = array(); /** * Collection of protected cell ranges * * @var array */ - private $_protectedCells = array(); + protected $_protectedCells = array(); /** * Autofilter Range and selection * * @var PHPExcel\Worksheet_AutoFilter */ - private $_autoFilter = NULL; + protected $_autoFilter = NULL; /** * Freeze pane * * @var string */ - private $_freezePane = ''; + protected $_freezePane = ''; /** * Show gridlines? * * @var boolean */ - private $_showGridlines = true; + protected $_showGridlines = true; /** * Print gridlines? * * @var boolean */ - private $_printGridlines = false; + protected $_printGridlines = false; /** * Show row and column headers? * * @var boolean */ - private $_showRowColHeaders = true; + protected $_showRowColHeaders = true; /** * Show summary below? (Row/Column outline) * * @var boolean */ - private $_showSummaryBelow = true; + protected $_showSummaryBelow = true; /** * Show summary right? (Row/Column outline) * * @var boolean */ - private $_showSummaryRight = true; + protected $_showSummaryRight = true; /** * Collection of comments * * @var PHPExcel\Comment[] */ - private $_comments = array(); + protected $_comments = array(); /** * Active cell. (Only one!) * * @var string */ - private $_activeCell = 'A1'; + protected $_activeCell = 'A1'; /** * Selected cells * * @var string */ - private $_selectedCells = 'A1'; + protected $_selectedCells = 'A1'; /** * Cached highest column * * @var string */ - private $_cachedHighestColumn = 'A'; + protected $_cachedHighestColumn = 'A'; /** * Cached highest row * * @var int */ - private $_cachedHighestRow = 1; + protected $_cachedHighestRow = 1; /** * Right-to-left? * * @var boolean */ - private $_rightToLeft = false; + protected $_rightToLeft = false; /** * Hyperlinks. Indexed by cell coordinate, e.g. 'A1' * * @var array */ - private $_hyperlinkCollection = array(); + protected $_hyperlinkCollection = array(); /** * Data validation objects. Indexed by cell coordinate, e.g. 'A1' * * @var array */ - private $_dataValidationCollection = array(); + protected $_dataValidationCollection = array(); /** * Tab color * * @var PHPExcel\Style_Color */ - private $_tabColor; + protected $_tabColor; /** * Dirty flag * * @var boolean */ - private $_dirty = true; + protected $_dirty = true; /** * Hash * * @var string */ - private $_hash = null; + protected $_hash = null; /** * Create a new worksheet diff --git a/Classes/PHPExcel/WorksheetIterator.php b/Classes/PHPExcel/WorksheetIterator.php index 5a891cc..99856dc 100644 --- a/Classes/PHPExcel/WorksheetIterator.php +++ b/Classes/PHPExcel/WorksheetIterator.php @@ -44,14 +44,14 @@ class WorksheetIterator implements \Iterator * * @var PHPExcel */ - private $_subject; + protected $_subject; /** * Current iterator position * * @var int */ - private $_position = 0; + protected $_position = 0; /** * Create a new worksheet iterator