本文整理匯總了PHP中PhabricatorEnv::envConfigExists方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhabricatorEnv::envConfigExists方法的具體用法?PHP PhabricatorEnv::envConfigExists怎麽用?PHP PhabricatorEnv::envConfigExists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PhabricatorEnv
的用法示例。
在下文中一共展示了PhabricatorEnv::envConfigExists方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: render
public function render()
{
$data = $this->getData();
$lib_data = $data['libraries'];
$lib_rows = array();
foreach ($lib_data as $key => $value) {
$lib_rows[] = array(phutil_escape_html($key), phutil_escape_html($value));
}
$lib_table = new AphrontTableView($lib_rows);
$lib_table->setHeaders(array('Library', 'Loaded From'));
$lib_table->setColumnClasses(array('header', 'wide wrap'));
$config_data = $data['config'];
ksort($config_data);
$mask = PhabricatorEnv::getEnvConfig('darkconsole.config-mask');
$mask = array_fill_keys($mask, true);
foreach ($mask as $masked_key => $ignored) {
if (!PhabricatorEnv::envConfigExists($masked_key)) {
throw new Exception("Configuration 'darkconsole.config-mask' masks unknown " . "configuration key '" . $masked_key . "'. If this key has been " . "renamed, you might be accidentally exposing information which you " . "don't intend to.");
}
}
$rows = array();
foreach ($config_data as $key => $value) {
if (empty($mask[$key])) {
$display_value = is_array($value) ? json_encode($value) : $value;
$display_value = phutil_escape_html($display_value);
} else {
$display_value = phutil_escape_html('<Masked>');
}
$rows[] = array(phutil_escape_html($key), $display_value);
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('Key', 'Value'));
$table->setColumnClasses(array('header', 'wide wrap'));
return $lib_table->render() . $table->render();
}