Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/cache/DivinerDiskCache.php
| Show All 20 Lines | public function delete() { | ||||
| $this->getCache()->destroyCache(); | $this->getCache()->destroyCache(); | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| /** | /** | ||||
| * Convert a long-form hash key like `ccbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaN` into | * Convert a long-form hash key like `ccbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaN` into | ||||
| * a shortened directory form, like `cc/bb/aaaaaaaaN`. In conjunction with | * a shortened directory form, like `cc/bb/aaaaaaaaN`. In conjunction with | ||||
| * @{class:PhutilDirectoryKeyValueCache}, this gives us nice directories | * @{class:PhutilDirectoryKeyValueCache}, this gives us nice directories | ||||
| * inside .divinercache instead of a million hash files with huge names at | * inside `.divinercache` instead of a million hash files with huge names at | ||||
| * top level. | * the top level. | ||||
| */ | */ | ||||
| protected function getHashKey($hash) { | protected function getHashKey($hash) { | ||||
| return implode( | return implode( | ||||
| '/', | '/', | ||||
| array( | array( | ||||
| substr($hash, 0, 2), | substr($hash, 0, 2), | ||||
| substr($hash, 2, 2), | substr($hash, 2, 2), | ||||
| substr($hash, 4, 8), | substr($hash, 4, 8), | ||||
| )); | )); | ||||
| } | } | ||||
| } | } | ||||