1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace OC\Files\Cache;
- use OCP\Files\Cache\ICacheEntry;
- class HomeCache extends Cache {
-
- public function calculateFolderSize($path, $entry = null) {
- if ($path !== '/' and $path !== '' and $path !== 'files' and $path !== 'files_trashbin' and $path !== 'files_versions') {
- return parent::calculateFolderSize($path, $entry);
- } elseif ($path === '' or $path === '/') {
-
- return 0;
- } else {
- return $this->calculateFolderSizeInner($path, $entry, true);
- }
- }
-
- public function get($file) {
- $data = parent::get($file);
- if ($file === '' or $file === '/') {
-
- $filesData = parent::get('files');
- if (isset($filesData['size'])) {
- $data['size'] = $filesData['size'];
- }
- }
- return $data;
- }
- }
|