本文整理汇总了PHP中ForgeConfig::get方法的典型用法代码示例。如果您正苦于以下问题:PHP ForgeConfig::get方法的具体用法?PHP ForgeConfig::get怎么用?PHP ForgeConfig::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ForgeConfig
的用法示例。
在下文中一共展示了ForgeConfig::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayBody
private function displayBody()
{
$items = $this->data_mapper->fetchAll($this->getProjectFromRequest());
$presenter = new ChooseNewsPresenter($items, $this->request->get('project_id'));
$renderer = TemplateRendererFactory::build()->getRenderer(ForgeConfig::get('codendi_dir') . '/src/templates/news/');
$renderer->renderToPage('choose_news', $presenter);
}
示例2: testFactoryShouldSetADefaultLanguageForUnknownLocales
public function testFactoryShouldSetADefaultLanguageForUnknownLocales()
{
$default_language = new BaseLanguage($this->supportedLanguages, ForgeConfig::get('sys_lang'));
$default_language->loadLanguage(ForgeConfig::get('sys_lang'));
$factory = new BaseLanguageFactory();
$this->assertEqual($default_language, $factory->getBaseLanguage('unknown_locale'));
}
示例3: send_new_user_email
function send_new_user_email($to, $login, $password, $confirm_hash, $template, $isAdminPresenter)
{
//needed by new_user_email.txt
$base_url = get_server_url();
$defaultTheme = $GLOBALS['sys_themedefault'];
$color_logo = "#0000";
$color_button = "#347DBA";
if (themeIsFlamingParrot($defaultTheme)) {
$defaultThemeVariant = $GLOBALS['sys_default_theme_variant'];
$color_logo = FlamingParrot_Theme::getColorOfCurrentTheme($defaultThemeVariant);
$color_button = $color_logo;
}
$logo_url = $base_url . "/themes/" . $defaultTheme . "/images/organization_logo.png";
$has_logo = file_exists(dirname(__FILE__) . '/../themes/' . $defaultTheme . '/images/organization_logo.png');
if ($isAdminPresenter) {
$subject = $GLOBALS['Language']->getText('account_register', 'welcome_email_title', $GLOBALS['sys_name']);
include $GLOBALS['Language']->getContent('account/new_account_email');
$presenter = new MailRegisterByAdminPresenter($has_logo, $logo_url, $title, $section_one, $section_two, $section_after_login, $thanks, $signature, $help, $color_logo, $login, $section_three, $section_after_password, $password);
} else {
$subject = $GLOBALS['Language']->getText('include_proj_email', 'account_register', $GLOBALS['sys_name']);
include $GLOBALS['Language']->getContent('include/new_user_email');
$redirect_url = $base_url . "/account/verify.php?confirm_hash={$confirm_hash}";
$presenter = new MailRegisterByUserPresenter($has_logo, $logo_url, $title, $section_one, $section_two, $section_after_login, $thanks, $signature, $help, $color_logo, $login, $redirect_url, $redirect_button, $color_button);
}
$renderer = TemplateRendererFactory::build()->getRenderer(ForgeConfig::get('codendi_dir') . '/src/templates/mail/');
$mail = initializeMail($subject, $GLOBALS['sys_noreply'], $to, $renderer->renderToString($template, $presenter), $message);
return $mail->send();
}
示例4: display
public function display(Codendi_Request $request)
{
$title = $GLOBALS['Language']->getText('plugin_git', 'descriptor_name');
$renderer = TemplateRendererFactory::build()->getRenderer(dirname(GIT_BASE_DIR) . '/templates');
$presenter = null;
switch ($request->get('action')) {
case 'list-repositories':
$presenter = $this->getListRepositoriesPresenter($request);
break;
case 'manage-allowed-projects':
case 'set-mirror-restriction':
case 'update-allowed-project-list':
$presenter = $this->getManageAllowedProjectsPresenter($request);
$renderer = TemplateRendererFactory::build()->getRenderer(ForgeConfig::get('codendi_dir') . '/src/templates/resource_restrictor');
break;
case 'show-edit-mirror':
case 'show-add-mirror':
break;
default:
$presenter = $this->getAllMirrorsPresenter($title);
break;
}
if (!$presenter) {
return;
}
$GLOBALS['HTML']->header(array('title' => $title, 'selected_top_tab' => 'admin'));
$renderer->renderToPage($presenter->getTemplate(), $presenter);
$GLOBALS['HTML']->footer(array());
}
示例5: getStdErrFilePath
/**
* Return path of the file that contains ssh command stderr
*
* @return String
*/
public function getStdErrFilePath()
{
if (!$this->filepath) {
$this->filepath = tempnam(ForgeConfig::get('tmp_dir'), 'stderr_');
}
return $this->filepath;
}
示例6: getUserGroupDisplayName
public static function getUserGroupDisplayName($name)
{
switch ($name) {
case self::NOBODY:
return $GLOBALS['Language']->getText('project_ugroup', 'ugroup_nobody');
case self::ANON:
return $GLOBALS['Language']->getText('project_ugroup', 'ugroup_anonymous_users');
case self::AUTHENTICATED:
$label = ForgeConfig::get(self::CONFIG_AUTHENTICATED_LABEL);
if ($label == false) {
$label = $GLOBALS['Language']->getText('project_ugroup', 'ugroup_authenticated_users');
}
return $label;
case self::REGISTERED:
$label = ForgeConfig::get(self::CONFIG_REGISTERED_LABEL);
if ($label == false) {
$label = $GLOBALS['Language']->getText('project_ugroup', 'ugroup_registered_users');
}
return $label;
case self::PROJECT_MEMBERS:
return $GLOBALS['Language']->getText('project_ugroup', 'ugroup_project_members');
case self::PROJECT_ADMINS:
return $GLOBALS['Language']->getText('project_ugroup', 'ugroup_project_admins');
default:
return util_translate_name_ugroup($name);
}
}
示例7: getAvatarIfEnabled
public function getAvatarIfEnabled()
{
if (ForgeConfig::get('sys_enable_avatars')) {
return '<div class="tracker_artifact_followup_avatar">' . $this->getHTMLAvatar() . '</div>';
}
return '';
}
示例8: stripOutlookTextQuote
private function stripOutlookTextQuote($mail_content)
{
if (ForgeConfig::get('sys_strip_outlook') == 1) {
return $this->stripOutlook($this->stripOutlook($mail_content, 'en'), 'fr');
}
return $mail_content;
}
示例9: setUp
public function setUp()
{
parent::setUp();
ForgeConfig::set('codendi_log', '/tmp');
$this->log_file = tempnam(ForgeConfig::get('codendi_log'), 'codendi_syslog');
$this->logger = new BackendLogger($this->log_file);
}
示例10: registerShutdownFunction
public function registerShutdownFunction()
{
if (ForgeConfig::get('DEBUG_MODE') && strpos($_SERVER['REQUEST_URI'], '/soap/') !== 0) {
$php_code = '$request =& ' . get_class($this) . '::instance(); $request->checkThatAllVariablesAreValidated();';
register_shutdown_function(create_function('', $php_code));
}
}
示例11: stream
public function stream(Git_HTTP_Command $command)
{
$cwd = '/tmp';
$descriptorspec = array(0 => array("pipe", "r"), 1 => array("pipe", "w"));
if (ForgeConfig::get('sys_logger_level') == Logger::DEBUG) {
$descriptorspec[2] = array('file', ForgeConfig::get('codendi_log') . '/git_http_error_log', 'a');
}
$pipes = array();
$this->logger->debug('Command: ' . $command->getCommand());
$this->logger->debug('Environment: ' . print_r($command->getEnvironment(), true));
$process = proc_open($command->getCommand(), $descriptorspec, $pipes, $cwd, $command->getEnvironment());
if (is_resource($process)) {
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
fwrite($pipes[0], file_get_contents('php://input'));
}
fclose($pipes[0]);
$first = true;
while ($result = stream_get_contents($pipes[1], self::CHUNK_LENGTH)) {
if ($first) {
list($headers, $body) = http_split_header_body($result);
foreach (explode("\r\n", $headers) as $header) {
header($header);
}
file_put_contents('php://output', $body);
} else {
file_put_contents('php://output', $result);
}
$first = false;
}
fclose($pipes[1]);
$return_value = proc_close($process);
}
}
示例12: html_get_timezone_popup
function html_get_timezone_popup($selected = 0)
{
$GLOBALS['HTML']->includeFooterJavascriptFile('/scripts/jstimezonedetect/jstz.min.js');
$GLOBALS['HTML']->includeFooterJavascriptFile('/scripts/tuleap/timezone.js');
$renderer = TemplateRendererFactory::build()->getRenderer(ForgeConfig::get('codendi_dir') . '/src/templates/account/');
return $renderer->renderToString('timezone', new Account_TimezoneSelectorPresenter($selected));
}
示例13: getAccess
public function getAccess()
{
if (is_null($this->is_public)) {
return ForgeConfig::get('sys_is_project_public') ? Project::ACCESS_PUBLIC : Project::ACCESS_PRIVATE;
} else {
return $this->is_public ? Project::ACCESS_PUBLIC : Project::ACCESS_PRIVATE;
}
}
示例14: __construct
public function __construct()
{
$this->env = array('GIT_PROJECT_ROOT' => ForgeConfig::get('sys_data_dir') . "/gitolite/repositories", 'GIT_HTTP_EXPORT_ALL' => "1", 'QUERY_STRING' => $_SERVER['QUERY_STRING'], 'REQUEST_METHOD' => $_SERVER['REQUEST_METHOD']);
$this->appendToEnv('PATH_INFO');
$this->appendToEnv('CONTENT_TYPE');
$this->appendToEnv('HTTP_ACCEPT_ENCODING');
$this->appendToEnv('HTTP_CONTENT_ENCODING');
}
示例15: searchSvnRepositories
public function searchSvnRepositories()
{
$auth_mod = $this->da->quoteSmart(ForgeConfig::get(SVN_Apache_SvnrootConf::CONFIG_SVN_AUTH_KEY));
$sql = "SELECT groups.*, service.*, unix_group_name AS repository_name, {$auth_mod} AS auth_mod\n FROM groups, service\n WHERE groups.group_id = service.group_id\n AND service.short_name = 'svn'\n AND service.is_used = '1'\n AND groups.status = 'A'";
$sql_fragments = array($sql);
$this->event_manager->processEvent(Event::GET_SVN_LIST_REPOSITORIES_SQL_FRAGMENTS, array('sql_fragments' => &$sql_fragments));
return $this->retrieve(implode(' UNION ', $sql_fragments));
}