BVB Source Codes

WSTShop v1.1.0 B2C revenue system Show MemoryGZip.php Source code

Return Download WSTShop v1.1.0 B2C revenue system: download MemoryGZip.php Source code - Download WSTShop v1.1.0 B2C revenue system Source code - Type:.php
  1. <?php
  2. /**
  3.  * PHPExcel
  4.  *
  5.  * Copyright (c) 2006 - 2014 PHPExcel
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2.1 of the License, or (at your option) any later version.
  11.  *
  12.  * This library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Lesser General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the Free Software
  19.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  20.  *
  21.  * @category   PHPExcel
  22.  * @package    PHPExcel_CachedObjectStorage
  23.  * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
  24.  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
  25.  * @version    1.8.0, 2014-03-02
  26.  */
  27.  
  28.  
  29. /**
  30.  * PHPExcel_CachedObjectStorage_MemoryGZip
  31.  *
  32.  * @category   PHPExcel
  33.  * @package    PHPExcel_CachedObjectStorage
  34.  * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
  35.  */
  36. class PHPExcel_CachedObjectStorage_MemoryGZip extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
  37.  
  38.     /**
  39.      * Store cell data in cache for the current cell object if it's "dirty",
  40.      *     and the 'nullify' the current cell object
  41.      *
  42.          * @return      void
  43.      * @throws  PHPExcel_Exception
  44.      */
  45.         protected function _storeData() {
  46.                 if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
  47.                         $this->_currentObject->detach();
  48.  
  49.                         $this->_cellCache[$this->_currentObjectID] = gzdeflate(serialize($this->_currentObject));
  50.                         $this->_currentCellIsDirty = false;
  51.                 }
  52.                 $this->_currentObjectID = $this->_currentObject = null;
  53.         }       //      function _storeData()
  54.  
  55.  
  56.     /**
  57.      * Add or Update a cell in cache identified by coordinate address
  58.      *
  59.      * @param   string                  $pCoord         Coordinate address of the cell to update
  60.      * @param   PHPExcel_Cell   $cell           Cell to update
  61.          * @return      void
  62.      * @throws  PHPExcel_Exception
  63.      */
  64.         public function addCacheData($pCoord, PHPExcel_Cell $cell) {
  65.                 if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
  66.                         $this->_storeData();
  67.                 }
  68.  
  69.                 $this->_currentObjectID = $pCoord;
  70.                 $this->_currentObject = $cell;
  71.                 $this->_currentCellIsDirty = true;
  72.  
  73.                 return $cell;
  74.         }       //      function addCacheData()
  75.  
  76.  
  77.     /**
  78.      * Get cell at a specific coordinate
  79.      *
  80.      * @param   string                  $pCoord         Coordinate of the cell
  81.      * @throws  PHPExcel_Exception
  82.      * @return  PHPExcel_Cell   Cell that was found, or null if not found
  83.      */
  84.         public function getCacheData($pCoord) {
  85.                 if ($pCoord === $this->_currentObjectID) {
  86.                         return $this->_currentObject;
  87.                 }
  88.                 $this->_storeData();
  89.  
  90.                 //      Check if the entry that has been requested actually exists
  91.                 if (!isset($this->_cellCache[$pCoord])) {
  92.                         //      Return null if requested entry doesn't exist in cache
  93.                         return null;
  94.                 }
  95.  
  96.                 //      Set current entry to the requested entry
  97.                 $this->_currentObjectID = $pCoord;
  98.                 $this->_currentObject = unserialize(gzinflate($this->_cellCache[$pCoord]));
  99.         //    Re-attach this as the cell's parent
  100.         $this->_currentObject->attach($this);
  101.  
  102.                 //      Return requested entry
  103.                 return $this->_currentObject;
  104.         }       //      function getCacheData()
  105.  
  106.  
  107.         /**
  108.          * Get a list of all cell addresses currently held in cache
  109.          *
  110.          * @return  array of string
  111.          */
  112.         public function getCellList() {
  113.                 if ($this->_currentObjectID !== null) {
  114.                         $this->_storeData();
  115.                 }
  116.  
  117.                 return parent::getCellList();
  118.         }
  119.  
  120.  
  121.         /**
  122.          * Clear the cell collection and disconnect from our parent
  123.          *
  124.          * @return      void
  125.          */
  126.         public function unsetWorksheetCells() {
  127.                 if(!is_null($this->_currentObject)) {
  128.                         $this->_currentObject->detach();
  129.                         $this->_currentObject = $this->_currentObjectID = null;
  130.                 }
  131.                 $this->_cellCache = array();
  132.  
  133.                 //      detach ourself from the worksheet, so that it can then delete this object successfully
  134.                 $this->_parent = null;
  135.         }       //      function unsetWorksheetCells()
  136.  
  137. }
  138.  
downloadMemoryGZip.php Source code - Download WSTShop v1.1.0 B2C revenue system Source code
Related Source Codes/Software:
HTML 5 black reactive booth design dream weaving dedecms site template (adaptive) v1.0 - HTML5 black-response design dream dedecms template... 2017-05-06
DolpinPHP v1.0.0 rapid development framework - DophinPHP (Dolphin PHP) is an open source rapid de... 2017-05-06
HTML 5 responsive weave template v1.0 dream relaxed and blog posts - HTML5 response-refreshing blog dream template is a... 2017-05-06
Responsive precision chemical chemical class dreams to template (adaptive equipment) v1.0 - Response precision chemical chemical dream templat... 2017-05-06
HTML 5 high-end dedecms decorate construction company enterprise template - Dedecms latest kernel source code, this source cod... 2017-05-06
Blue air conditioning refrigeration electronic enterprise website dream weaving template v1.0 - Blue air conditioning and refrigeration electronic... 2017-05-06
Dream weaving white large entrepreneurial wealth information class site template v1.0 - Dream white large entrepreneurial wealth of inform... 2017-05-06
bash-guide - A guide to learn bash 2017-06-05
N-blog - Learn the Node together. J 2017-06-05
Become-A-Full-Stack-Web-Developer - Free resources for learning Full Stack Web Develop... 2017-06-05
compromise - Natural language processing in javascript ... 2017-06-05
stack-on-a-budget - A collection of services with great free tiers for... 2017-06-05
packer - Packer is a tool for creating identical machine im... 2017-06-05
pkg - Package your Node.js project into an executable ... 2017-06-05
Dapper - Dapper - a simple object mapper for .Net 2017-06-05
python-fire - Python Fire is a library for automatically generat... 2017-06-04
kaminari - A Scope & Engine based, clean, powerful, custo... 2017-06-04

 Back to top