承接 bw/stand-with-ukraine-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bw/stand-with-ukraine-bundle

Composer 安装命令:

composer require bw/stand-with-ukraine-bundle

包简介

A Symfony bundle that provides StandWithUkraine banner and has some built-in features to block access to your resource for Russian-speaking users

README 文档

README

Stand With Ukraine

CI

На русском? Смотри README.ru.md

This bundle provides a built-in StandWithUkraine banner for your Symfony application and has some features to block content for Russian-speaking users. Why? Great question! There is a war in Ukraine right now. You can read more about it here.

The initial idea of this bundle is to push Russian-speaking people to think! Almost all Russian media are not independent anymore and spread fake news to their users about what is happening in the world and even in their own country. Everybody has a choice. You can choose different sources in different languages to read the news from many other independent and trusted media around the world, don't limit yourself with Russian language and Russian media only.

Features

Some features included in this bundle:

  • Display "StandWithUkraine" banner to show that your website stands united with the people of Ukraine. Example of StandWithUkraine banner
  • Block content for users who have the preferred language in Accept-Language request header set to ru. Basically, affects people who read most of the content in Russian language. Users would be able to access the content only after changing their preferred language to any other language. They still can keep Russian language, but as a secondary one. Example of access denied page
  • Block content for users who are trying to get access from Russian IP addresses, i.e. accessing the content from Russia. Users would be able to access the content only after connecting via a VPN client choosing a location different from Russia region there. It makes things less convenient probably, but if you're using a good VPN client - you get better security, especially if you're connecting from public Wi-Fi spots or do not trust your internet provider. Example of access denied page

Installation

Install with Composer:

$ symfony composer require bw/stand-with-ukraine-bundle

Then, enable the bundle if you don't use Symfony Flex:

// config/bundles.php

return [
    // ...
    BW\StandWithUkraineBundle\StandWithUkraineBundle::class => ['all' => true],
];

And then activate/deactivate event subscribers in its configuration.

Configuration

Configuration is optional, all options have defaults. But if you want to change it - create a config file config/services/stand_with_ukraine.yaml and tweak it. Below you can find the full configuration example with the default values:

# config/packages/stand_with_ukraine.yaml

stand_with_ukraine:
    banner:
        enabled:              true

        # Possition of the banner: "top" or "bottom"
        position:             top

        # Wrap the banner with a link to the given URL
        target_url:           null

        # Will be shown in the banner, HTTP host by default
        brand_name:           null
    ban_language:
        enabled:              true
        use_links:            true
    ban_country:
        enabled:              true
        use_links:            true

Or you can see it in your terminal, just run:

$ symfony console config:dump-reference stand_with_ukraine

Testing

For testing purposes, you can easily simulate bad requests to test things manually on your website in an easy way. To overwrite the actual country code with ru, use swu_overwrite_country_code_ru query parameter, i.e:

https://127.0.0.1:8000/?swu_overwrite_country_code_ru=yes

Also, you can overwrite preferred language with ru as well, use swu_overwrite_preferred_lang_ru query parameter, i.e:

https://127.0.0.1:8000/?swu_overwrite_preferred_lang_ru=yes

The system will thinks that you're sending requests from a Russian IP address or with Russian preferred language correspondingly and behave accordingly your configuration.

That's it!

Thanks for using this bundle! Feel free to create an issue or send a PR if you have any ideas how to improve it. And if you like it - please, share!

bw/stand-with-ukraine-bundle 适用场景与选型建议

bw/stand-with-ukraine-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 91 次下载、GitHub Stars 达 37, 最近一次更新时间为 2022 年 05 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 bw/stand-with-ukraine-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 bw/stand-with-ukraine-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 bw/stand-with-ukraine-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 91
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 37
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 37
  • Watchers: 3
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-05-03