Differential D15072 Diff 36395 src/applications/files/applicationpanel/PhabricatorFilesApplicationStorageEnginePanel.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/applicationpanel/PhabricatorFilesApplicationStorageEnginePanel.php
| Show All 20 Lines | public function buildConfigurationPagePanel() { | ||||
| $chunk_engines = PhabricatorFileStorageEngine::loadWritableChunkEngines(); | $chunk_engines = PhabricatorFileStorageEngine::loadWritableChunkEngines(); | ||||
| $yes = pht('Yes'); | $yes = pht('Yes'); | ||||
| $no = pht('No'); | $no = pht('No'); | ||||
| $rows = array(); | $rows = array(); | ||||
| $rowc = array(); | $rowc = array(); | ||||
| foreach ($engines as $key => $engine) { | foreach ($engines as $key => $engine) { | ||||
| $limited = $no; | if ($engine->isTestEngine()) { | ||||
| continue; | |||||
| } | |||||
| $limit = null; | $limit = null; | ||||
| if ($engine->hasFilesizeLimit()) { | if ($engine->hasFilesizeLimit()) { | ||||
| $limited = $yes; | |||||
| $limit = phutil_format_bytes($engine->getFilesizeLimit()); | $limit = phutil_format_bytes($engine->getFilesizeLimit()); | ||||
| } else { | |||||
| $limit = pht('Unlimited'); | |||||
| } | } | ||||
| if ($engine->canWriteFiles()) { | if ($engine->canWriteFiles()) { | ||||
| $writable = $yes; | $writable = $yes; | ||||
| } else { | } else { | ||||
| $writable = $no; | $writable = $no; | ||||
| } | } | ||||
| if ($engine->isTestEngine()) { | |||||
| $test = $yes; | |||||
| } else { | |||||
| $test = $no; | |||||
| } | |||||
| if (isset($writable_engines[$key]) || isset($chunk_engines[$key])) { | if (isset($writable_engines[$key]) || isset($chunk_engines[$key])) { | ||||
| $rowc[] = 'highlighted'; | $rowc[] = 'highlighted'; | ||||
| } else { | } else { | ||||
| $rowc[] = null; | $rowc[] = null; | ||||
| } | } | ||||
| $rows[] = array( | $rows[] = array( | ||||
| $key, | $key, | ||||
| get_class($engine), | get_class($engine), | ||||
| $test, | |||||
| $writable, | $writable, | ||||
| $limited, | |||||
| $limit, | $limit, | ||||
| ); | ); | ||||
| } | } | ||||
| $table = id(new AphrontTableView($rows)) | $table = id(new AphrontTableView($rows)) | ||||
| ->setNoDataString(pht('No storage engines available.')) | ->setNoDataString(pht('No storage engines available.')) | ||||
| ->setHeaders( | ->setHeaders( | ||||
| array( | array( | ||||
| pht('Key'), | pht('Key'), | ||||
| pht('Class'), | pht('Class'), | ||||
| pht('Unit Test'), | |||||
| pht('Writable'), | pht('Writable'), | ||||
| pht('Has Limit'), | |||||
| pht('Limit'), | pht('Limit'), | ||||
| )) | )) | ||||
| ->setRowClasses($rowc) | ->setRowClasses($rowc) | ||||
| ->setColumnClasses( | ->setColumnClasses( | ||||
| array( | array( | ||||
| '', | '', | ||||
| 'wide', | 'wide', | ||||
| '', | '', | ||||
| '', | |||||
| '', | |||||
| 'n', | 'n', | ||||
| )); | )); | ||||
| $box = id(new PHUIObjectBoxView()) | $box = id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText(pht('Storage Engines')) | ->setHeaderText(pht('Storage Engines')) | ||||
| ->setTable($table); | ->setTable($table); | ||||
| return $box; | return $box; | ||||
| Show All 9 Lines | |||||