PHPackages                             bw/stand-with-ukraine-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. bw/stand-with-ukraine-bundle

ActiveSymfony-bundle[Security](/categories/security)

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

v0.1.2(3y ago)36919[2 PRs](https://github.com/bocharsky-bw/stand-with-ukraine-bundle/pulls)MITPHP

Since May 3Pushed 2y ago2 watchersCompare

[ Source](https://github.com/bocharsky-bw/stand-with-ukraine-bundle)[ Packagist](https://packagist.org/packages/bw/stand-with-ukraine-bundle)[ RSS](/packages/bw-stand-with-ukraine-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (10)Versions (4)Used By (0)

StandWithUkraineBundle
======================

[](#standwithukrainebundle)

[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://vshymanskyy.github.io/StandWithUkraine/)

[![CI](https://github.com/bocharsky-bw/stand-with-ukraine-bundle/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/bocharsky-bw/stand-with-ukraine-bundle/actions/workflows/ci.yaml)

На русском? Смотри [README.ru.md](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](https://stand-with-ukraine.pp.ua/ToRussianPeople.html#-to-people-of-russia).

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
--------

[](#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](https://github.com/bocharsky-bw/stand-with-ukraine-bundle/raw/main/docs/images/banner.png)](https://github.com/bocharsky-bw/stand-with-ukraine-bundle/blob/main/docs/images/banner.png)
- **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](https://github.com/bocharsky-bw/stand-with-ukraine-bundle/raw/main/docs/images/access-denied.png)](https://github.com/bocharsky-bw/stand-with-ukraine-bundle/blob/main/docs/images/access-denied.png)
- **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](https://en.wikipedia.org/wiki/Virtual_private_network) 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](https://github.com/bocharsky-bw/stand-with-ukraine-bundle/raw/main/docs/images/access-denied.png)](https://github.com/bocharsky-bw/stand-with-ukraine-bundle/blob/main/docs/images/access-denied.png)

Installation
------------

[](#installation)

Install with [Composer](https://getcomposer.org/):

```
$ 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)

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
-------

[](#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](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](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!
----------

[](#thats-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!

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~16 days

Total

3

Last Release

1436d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce9dde2c8d3d5fcfdbb5427f981df17123b54b410e21e4dfc933f07983eefeba?d=identicon)[bocharsky-bw](/maintainers/bocharsky-bw)

---

Top Contributors

[![bocharsky-bw](https://avatars.githubusercontent.com/u/3317635?v=4)](https://github.com/bocharsky-bw "bocharsky-bw (75 commits)")[![sergiy-petrov](https://avatars.githubusercontent.com/u/8986207?v=4)](https://github.com/sergiy-petrov "sergiy-petrov (1 commits)")

---

Tags

bannerbundlestandwithukrainestopwarsymfony-bundleukraine

### Embed Badge

![Health badge](/badges/bw-stand-with-ukraine-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/bw-stand-with-ukraine-bundle/health.svg)](https://phpackages.com/packages/bw-stand-with-ukraine-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M650](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M309](/packages/easycorp-easyadmin-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
