/** * Get all cached data * * @return mixed Boolean false on failure or a cached data object * * @since 11.1 */ public function getAll() { $path = $this->_root; $folders = $this->_folders($path); $data = array(); foreach ($folders as $folder) { $files = $this->_filesInFolder($path . '/' . $folder); $item = new JCacheStorageHelper($folder); foreach ($files as $file) { $item->updateSize(filesize($path . '/' . $folder . '/' . $file) / 1024); } $data[$folder] = $item; } return $data; }
/** * Get all cached data * * @return array * * @since 11.1 */ public function getAll() { parent::getAll(); $path = $this->_root; $folders = new DirectoryIterator($path); $data = array(); foreach ($folders as $folder) { if (!$folder->isDir() || $folder->isDot()) { continue; } $foldername = $folder->getFilename(); $files = new DirectoryIterator($path . '/' . $foldername); $item = new JCacheStorageHelper($foldername); foreach ($files as $file) { if (!$file->isFile()) { continue; } $filename = $file->getFilename(); $item->updateSize(filesize($path . '/' . $foldername . '/' . $filename) / 1024); } $data[$foldername] = $item; } return $data; }
/** * Get all cached data * * @return array * * @since 11.1 */ public function getAll() { parent::getAll(); $path = $this->_root; jimport('joomla.filesystem.folder'); $folders = JFolder::folders($path); $data = array(); foreach ($folders as $folder) { $files = JFolder::files($path . '/' . $folder); $item = new JCacheStorageHelper($folder); foreach ($files as $file) { $item->updateSize(filesize($path . '/' . $folder . '/' . $file)/1024); } $data[$folder] = $item; } return $data; }