/** * Initialise this new cell collection * * @param PHPExcel_Worksheet $parent The worksheet for this cell collection * @param array of mixed $arguments Additional initialisation arguments */ public function __construct(PHPExcel_Worksheet $parent, $arguments) { $this->_memoryCacheSize = isset($arguments['memoryCacheSize']) ? $arguments['memoryCacheSize'] : '1MB'; parent::__construct($parent); if (is_null($this->_fileHandle)) { $this->_fileHandle = fopen('php://temp/maxmemory:' . $this->_memoryCacheSize, 'a+'); } }
/** * Initialise this new cell collection * * @param PHPExcel_Worksheet $parent The worksheet for this cell collection * @param array of mixed $arguments Additional initialisation arguments */ public function __construct(PHPExcel_Worksheet $parent, $arguments) { $cacheTime = isset($arguments['cacheTime']) ? $arguments['cacheTime'] : 600; if ($this->_cachePrefix === null) { $baseUnique = $this->_getUniqueID(); $this->_cachePrefix = substr(md5($baseUnique), 0, 8) . '.'; $this->_cacheTime = $cacheTime; parent::__construct($parent); } }
/** * Initialise this new cell collection * * @param PHPExcel_Worksheet $parent The worksheet for this cell collection * @param array of mixed $arguments Additional initialisation arguments */ public function __construct(PHPExcel_Worksheet $parent, $arguments) { $this->_cacheDirectory = isset($arguments['dir']) && $arguments['dir'] !== null ? $arguments['dir'] : PHPExcel_Shared_File::sys_get_temp_dir(); parent::__construct($parent); if (is_null($this->_fileHandle)) { $baseUnique = $this->_getUniqueID(); $this->_fileName = $this->_cacheDirectory . '/PHPExcel.' . $baseUnique . '.cache'; $this->_fileHandle = fopen($this->_fileName, 'a+'); } }
/** * Initialise this new cell collection * * @param PHPExcel_Worksheet $parent The worksheet for this cell collection */ public function __construct(PHPExcel_Worksheet $parent) { parent::__construct($parent); if (is_null($this->_DBHandle)) { $this->_TableName = str_replace('.', '_', $this->_getUniqueID()); $_DBName = ':memory:'; $this->_DBHandle = new SQLiteDatabase($_DBName); if ($this->_DBHandle === false) { throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError())); } if (!$this->_DBHandle->queryExec('CREATE TABLE kvp_' . $this->_TableName . ' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError())); } } }
/** * Initialise this new cell collection * * @param PHPExcel_Worksheet $parent The worksheet for this cell collection * @param array of mixed $arguments Additional initialisation arguments */ public function __construct(PHPExcel_Worksheet $parent, $arguments) { $memcacheServer = isset($arguments['memcacheServer']) ? $arguments['memcacheServer'] : 'localhost'; $memcachePort = isset($arguments['memcachePort']) ? $arguments['memcachePort'] : 11211; $cacheTime = isset($arguments['cacheTime']) ? $arguments['cacheTime'] : 600; if (is_null($this->_cachePrefix)) { $baseUnique = $this->_getUniqueID(); $this->_cachePrefix = substr(md5($baseUnique), 0, 8) . '.'; // Set a new Memcache object and connect to the Memcache server $this->_memcache = new Memcache(); if (!$this->_memcache->addServer($memcacheServer, $memcachePort, false, 50, 5, 5, true, array($this, 'failureCallback'))) { throw new PHPExcel_Exception('Could not connect to MemCache server at ' . $memcacheServer . ':' . $memcachePort); } $this->_cacheTime = $cacheTime; parent::__construct($parent); } }
/** * Initialise this new cell collection * * @param PHPExcel_Worksheet $parent The worksheet for this cell collection */ public function __construct(PHPExcel_Worksheet $parent) { parent::__construct($parent); if (is_null($this->_DBHandle)) { $this->_TableName = str_replace('.', '_', $this->_getUniqueID()); $_DBName = ':memory:'; $this->_DBHandle = new SQLite3($_DBName); if ($this->_DBHandle === false) { throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg()); } if (!$this->_DBHandle->exec('CREATE TABLE kvp_' . $this->_TableName . ' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg()); } } $this->_selectQuery = $this->_DBHandle->prepare("SELECT value FROM kvp_" . $this->_TableName . " WHERE id = :id"); $this->_insertQuery = $this->_DBHandle->prepare("INSERT OR REPLACE INTO kvp_" . $this->_TableName . " VALUES(:id,:data)"); $this->_updateQuery = $this->_DBHandle->prepare("UPDATE kvp_" . $this->_TableName . " SET id=:toId WHERE id=:fromId"); $this->_deleteQuery = $this->_DBHandle->prepare("DELETE FROM kvp_" . $this->_TableName . " WHERE id = :id"); }
public function __construct(PHPExcel_Worksheet $parent) { parent::__construct($parent); if (is_null($this->_fileHandle)) { $baseUnique = $this->_getUniqueID(); $this->_fileName = PHPExcel_Shared_File::sys_get_temp_dir() . '/PHPExcel.' . $baseUnique . '.cache'; $this->_fileHandle = fopen($this->_fileName, 'a+'); } }
public function __construct(PHPExcel_Worksheet $parent) { parent::__construct($parent); if (is_null($this->_fileHandle)) { if (function_exists('posix_getpid')) { $baseUnique = posix_getpid(); } else { $baseUnique = mt_rand(); } $this->_fileName = sys_get_temp_dir() . '/PHPExcel.' . uniqid($baseUnique, true) . '.cache'; $this->_fileHandle = fopen($this->_fileName, 'a+'); } }
public function __construct(PHPExcel_Worksheet $parent, $arguments) { $cacheTime = isset($arguments['cacheTime']) ? $arguments['cacheTime'] : 600; if (is_null($this->_cachePrefix)) { if (function_exists('posix_getpid')) { $baseUnique = posix_getpid(); } else { $baseUnique = mt_rand(); } $this->_cachePrefix = substr(md5(uniqid($baseUnique, true)), 0, 8) . '.'; $this->_cacheTime = $cacheTime; parent::__construct($parent); } }
public function __construct(PHPExcel_Worksheet $parent, $arguments) { $memcacheServer = isset($arguments['memcacheServer']) ? $arguments['memcacheServer'] : 'localhost'; $memcachePort = isset($arguments['memcachePort']) ? $arguments['memcachePort'] : 11211; $cacheTime = isset($arguments['cacheTime']) ? $arguments['cacheTime'] : 600; if (is_null($this->_cachePrefix)) { if (function_exists('posix_getpid')) { $baseUnique = posix_getpid(); } else { $baseUnique = mt_rand(); } $this->_cachePrefix = substr(md5(uniqid($baseUnique, true)), 0, 8) . '.'; // Set a new Memcache object and connect to the Memcache server $this->_memcache = new Memcache(); if (!$this->_memcache->connect($memcacheServer, $memcachePort)) { throw new Exception('Could not connect to Memcache server at ' . $memcacheServer . ':' . $memcachePort); } $this->_cacheTime = $cacheTime; parent::__construct($parent); } }
/** * Initialise this new cell collection * * @param PHPExcel_Worksheet $parent The worksheet for this cell collection * @param array of mixed $arguments Additional initialisation arguments */ public function __construct(PHPExcel_Worksheet $parent, $arguments) { $this->_cacheDirectory = isset($arguments['dir']) && $arguments['dir'] !== NULL ? $arguments['dir'] : LEAFLET_PLUGIN_ICONS_DIR; parent::__construct($parent); if (is_null($this->_fileHandle)) { $baseUnique = $this->_getUniqueID(); $this->_fileName = $this->_cacheDirectory . '/PHPExcel.' . $baseUnique . '.cache'; $this->_fileHandle = fopen($this->_fileName, 'a+'); } }