本文整理汇总了PHP中ForgeConfig类的典型用法代码示例。如果您正苦于以下问题:PHP ForgeConfig类的具体用法?PHP ForgeConfig怎么用?PHP ForgeConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ForgeConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testFactoryShouldReturnModStuffIfStuffAuthIsConfiguredForThisProjectAndDefaultConfigIsModPerl
function testFactoryShouldReturnModStuffIfStuffAuthIsConfiguredForThisProjectAndDefaultConfigIsModPerl()
{
$projectInfo = array();
ForgeConfig::set(SVN_Apache_SvnrootConf::CONFIG_SVN_AUTH_KEY, SVN_Apache_SvnrootConf::CONFIG_SVN_AUTH_PERL);
$factory = $this->GivenAAuthFactoryWithStuffPlugin();
$this->assertIsA($factory->get($projectInfo), 'SVN_Apache_ModStuff');
}
示例2: 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);
}
示例3: 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;
}
示例4: 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();
}
示例5: 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);
}
}
示例6: 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));
}
示例7: 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());
}
示例8: 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;
}
示例9: itCreatesUserWithPrefixSetFromConfig
public function itCreatesUserWithPrefixSetFromConfig()
{
$suffix = '-team';
ForgeConfig::set(GenericUserFactory::CONFIG_KEY_SUFFIX, $suffix);
$generic_user = $this->factory->create('120', 'my_password');
$this->assertEqual(substr($generic_user->getUnixName(), -strlen($suffix)), $suffix);
}
示例10: 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);
}
}
示例11: 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);
}
示例12: 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'));
}
示例13: itSavesNothingIfThereAreNoProjectLanguageAndMoreThanOneSystemLanguage
public function itSavesNothingIfThereAreNoProjectLanguageAndMoreThanOneSystemLanguage()
{
ForgeConfig::set('sys_supported_languages', 'it_IT,ja_JP');
stub($this->dao)->getUsedLanguageForProject()->returns(false);
expect($this->dao)->updateLanguageOption()->never();
$this->language_manager->getUsedLanguageForProject($this->project);
}
示例14: 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));
}
}
示例15: getAvatarIfEnabled
public function getAvatarIfEnabled()
{
if (ForgeConfig::get('sys_enable_avatars')) {
return '<div class="tracker_artifact_followup_avatar">' . $this->getHTMLAvatar() . '</div>';
}
return '';
}