Ejemplo n.º 1
0
 public static function initialize($method = self::cache_in_memory, $arguments = array())
 {
     if (!in_array($method, self::$_storageMethods)) {
         return false;
     }
     switch ($method) {
         case self::cache_to_apc:
             if (!function_exists('apc_store')) {
                 return false;
             }
             if (apc_sma_info() === false) {
                 return false;
             }
             break;
         case self::cache_to_memcache:
             if (!function_exists('memcache_add')) {
                 return false;
             }
             break;
         case self::cache_to_wincache:
             if (!function_exists('wincache_ucache_add')) {
                 return false;
             }
             break;
     }
     self::$_storageMethodParameters[$method] = self::$_storageMethodDefaultParameters[$method];
     foreach ($arguments as $k => $v) {
         if (isset(self::$_storageMethodParameters[$method][$k])) {
             self::$_storageMethodParameters[$method][$k] = $v;
         }
     }
     if (is_null(self::$_cacheStorageMethod)) {
         self::$_cacheStorageClass = 'CachedObjectStorage_' . $method;
         self::$_cacheStorageMethod = $method;
     }
     return true;
 }
Ejemplo n.º 2
0
 /**
  * Create a new worksheet
  *
  * @param PHPExcel 		$pParent
  * @param string 		$pTitle
  */
 public function __construct(PHPExcel $pParent = null, $pTitle = 'Worksheet')
 {
     // Set parent and title
     $this->_parent = $pParent;
     $this->setTitle($pTitle);
     $this->setSheetState(Worksheet::SHEETSTATE_VISIBLE);
     $this->_cellCollection = CachedObjectStorageFactory::getInstance($this);
     // Set page setup
     $this->_pageSetup = new Worksheet_PageSetup();
     // Set page margins
     $this->_pageMargins = new Worksheet_PageMargins();
     // Set page header/footer
     $this->_headerFooter = new Worksheet_HeaderFooter();
     // Set sheet view
     $this->_sheetView = new Worksheet_SheetView();
     // Drawing collection
     $this->_drawingCollection = new ArrayObject();
     // Protection
     $this->_protection = new Worksheet_Protection();
     // Gridlines
     $this->_showGridlines = true;
     $this->_printGridlines = false;
     // Outline summary
     $this->_showSummaryBelow = true;
     $this->_showSummaryRight = true;
     // Default row dimension
     $this->_defaultRowDimension = new Worksheet_RowDimension(null);
     // Default column dimension
     $this->_defaultColumnDimension = new Worksheet_ColumnDimension(null);
 }
Ejemplo n.º 3
0
 /**
  * Set the method that should be used for cell cacheing
  *
  * @param string $method Name of the cacheing method
  * @param array $arguments Optional configuration arguments for the cacheing method
  * @return boolean Success or failure
  */
 public static function setCacheStorageMethod($method = CachedObjectStorageFactory::cache_in_memory, $arguments = array())
 {
     return CachedObjectStorageFactory::initialize($method, $arguments);
 }
Ejemplo n.º 4
0
 /**
  * Create a new worksheet
  *
  * @param PHPExcel        $pParent
  * @param string        $pTitle
  */
 public function __construct(Spreadsheet $parent = null, $pTitle = 'Worksheet')
 {
     // Set parent and title
     $this->parent = $parent;
     $this->setTitle($pTitle, false);
     // setTitle can change $pTitle
     $this->setCodeName($this->getTitle());
     $this->setSheetState(Worksheet::SHEETSTATE_VISIBLE);
     $this->cellCollection = CachedObjectStorageFactory::getInstance($this);
     // Set page setup
     $this->pageSetup = new Worksheet\PageSetup();
     // Set page margins
     $this->pageMargins = new Worksheet\PageMargins();
     // Set page header/footer
     $this->headerFooter = new Worksheet\HeaderFooter();
     // Set sheet view
     $this->sheetView = new Worksheet\SheetView();
     // Drawing collection
     $this->drawingCollection = new \ArrayObject();
     // Chart collection
     $this->chartCollection = new \ArrayObject();
     // Protection
     $this->protection = new Worksheet\Protection();
     // Default row dimension
     $this->defaultRowDimension = new Worksheet\RowDimension(null);
     // Default column dimension
     $this->defaultColumnDimension = new Worksheet\ColumnDimension(null);
     $this->autoFilter = new Worksheet\AutoFilter(null, $this);
 }