surfnet/stepup-bundle

一个用于所有 Step-up 应用的共享代码和框架集成的 Symfony 5|6 包。

6.0.17 2024-05-24 13:37 UTC

README

Build Status Scrutinizer Code Quality SensioLabsInsight

一个用于所有 Step-up 应用的共享代码和框架集成的 Symfony 2 和 3 包。有关 Stepup 的概述,请参阅 Stepup-Deploy

安装

  • 将包添加到您的 Composer 文件中(对于 Symfony 2 支持,请使用版本约束 "~3.5")

    composer require surfnet/stepup-bundle
  • 将包添加到您的内核中 app/AppKernel.php

    public function registerBundles()
    {
        // ...
        $bundles[] = new Surfnet\StepupBundle\SurfnetStepupBundle;
    }
  • 复制并调整错误模板到您的应用程序文件夹

    • src/Resources/views/Exception/error.html.twigapp/Resources/SurfnetStepupBundle/views/Exception/error.html.twig
    • src/Resources/views/Exception/error404.html.twigapp/Resources/SurfnetStepupBundle/views/Exception/error404.html.twig

安装资源

{% stylesheets filter='less'
'@SurfnetStepupBundle/Resources/public/less/stepup.less'
%}
<link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen" />
{% endstylesheets %}
{% javascripts
'@SurfnetStepupBundle/Resources/public/js/stepup.js'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}

使用区域设置切换器

区域设置切换器是一个可以通过 Twig 函数渲染的表单。

{% if app.user %}
    {% set locale_switcher = stepup_locale_switcher('handler_route', ['return-url' => app.request.uri]) %}
    {{ form_start(locale_switcher, { attr: { class: 'form-inline' }}) }}
    {{ form_widget(locale_switcher.locale) }}
    {{ form_widget(locale_switcher.switch) }}
    {{ form_end(locale_switcher) }}
{% endif %}
{% stylesheets filter='less'
'@SurfnetStepupBundle/Resources/public/less/style.less'
%}
<link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen" />
{% endstylesheets %}
{% javascripts
'@SurfnetStepupBundle/Resources/public/js/index.js'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}

发布策略

变更日志

该包的变更日志保存在 ./CHANGELOG 文件中。发布的历史可以在该文件中找到。以前的 RMT 发布说明也保存在此文件中,以供历史参考。请使用 markdown 格式来设置变更日志。

请更新变更日志,包括即将发布的版本中引入的任何显著更改。如果您尚不确定下一个版本号,请给发布标题一个通用的值,例如 即将发布的版本。在将更改合并到发布分支之前,请确保更新变更日志中的发布标题。

示例变更日志条目

# 2.5.23
Brief explenation on the major changes of this release

## New features
 * Title of PR of the new feature #30
 * Support of POST binding for AuthnRequest #31
 
## Bugfixes
 * Title of PR of the bugfix #33

## Improvements
 * Title of PR of the improvement #29
 

在发布分支上发布热补丁时,请更新发布分支上的变更日志,并在发布热补丁后,也将热补丁合并到 develop。