/** * Initialise this new cell collection * * @param \PHPExcel\Worksheet $parent The worksheet for this cell collection * @param 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 mixed[] $arguments Additional initialisation arguments */ public function __construct(\PHPExcel\Worksheet $parent, $arguments) { $cacheTime = isset($arguments['cacheTime']) ? $arguments['cacheTime'] : 600; if (is_null($this->cachePrefix)) { $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 * @throws \PHPExcel\Exception */ 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"); }
/** * Initialise this new cell collection * * @param \PHPExcel\Worksheet $parent The worksheet for this cell collection * @throws \PHPExcel\Exception */ 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 mixed[] $arguments Additional initialisation arguments * @throws \PHPExcel\Exception */ 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 * @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::sysGetTempDir(); parent::__construct($parent); if (is_null($this->fileHandle)) { $baseUnique = $this->getUniqueID(); $this->fileName = $this->cacheDirectory . '/PHPExcel.' . $baseUnique . '.cache'; $this->fileHandle = fopen($this->fileName, 'a+'); } }