/** * Get storage capacity. * * @param array $options * @return array|boolean Capacity as array or false on failure * * @triggers getCapacity.pre(PreEvent) * @triggers getCapacity.post(PostEvent) * @triggers getCapacity.exception(ExceptionEvent) */ public function getCapacity(array $options = array()) { $args = new ArrayObject(array('options' => &$options)); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = Utils::getDiskCapacity(ini_get('zend_datacache.disk.save_path')); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { return $this->triggerException(__FUNCTION__, $args, $e); } }
/** * Internal method to get storage capacity. * * @param array $normalizedOptions * @return array|boolean Associative array of capacity, false on failure * @throws Exception\ExceptionInterface */ protected function internalGetCapacity(array & $normalizedOptions) { return Utils::getDiskCapacity(ini_get('zend_datacache.disk.save_path')); }
/** * Get capacity * * @param array $options * @return mixed */ public function getCapacity(array $options = array()) { $args = new ArrayObject(); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = Utils::getDiskCapacity($this->getOptions()->getCacheDir()); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (Exception $e) { return $this->triggerException(__FUNCTION__, $args, $e); } }
/** * Internal method to get storage capacity. * * @param array $normalizedOptions * @return array|boolean Capacity as array or false on failure * @throws Exception\ExceptionInterface */ protected function internalGetCapacity(array &$normalizedOptions) { return Utils::getDiskCapacity($this->getOptions()->getCacheDir()); }
public function testGetDiskCapacity() { $this->_assertCapacity(Utils::getDiskCapacity(__DIR__)); }