Differential D21795 Diff 51951 src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php
Show All 21 Lines | final class PhabricatorCacheManagementPurgeWorkflow | ||||
} | } | ||||
public function execute(PhutilArgumentParser $args) { | public function execute(PhutilArgumentParser $args) { | ||||
$all_purgers = PhabricatorCachePurger::getAllPurgers(); | $all_purgers = PhabricatorCachePurger::getAllPurgers(); | ||||
$is_all = $args->getArg('all'); | $is_all = $args->getArg('all'); | ||||
$key_list = $args->getArg('caches'); | $key_list = $args->getArg('caches'); | ||||
if ($is_all && strlen($key_list)) { | if ($is_all && phutil_nonempty_string($key_list)) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
'Specify either "--all" or "--caches", not both.')); | 'Specify either "--all" or "--caches", not both.')); | ||||
} else if (!$is_all && !strlen($key_list)) { | } else if (!$is_all && !phutil_nonempty_string($key_list)) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
'Select caches to purge with "--all" or "--caches". Available '. | 'Select caches to purge with "--all" or "--caches". Available '. | ||||
'caches are: %s.', | 'caches are: %s.', | ||||
implode(', ', array_keys($all_purgers)))); | implode(', ', array_keys($all_purgers)))); | ||||
} | } | ||||
if ($is_all) { | if ($is_all) { | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |