drsmithfr/symfony-political-choice

This library allows Symfony users to choose their political stance in the ongoing conflict.

1.0.1 2023-03-27 17:15 UTC

This package is auto-updated.

Last update: 2024-04-27 19:40:30 UTC


README

This library allows Symfony users to choose their political stance in the ongoing conflict between Ukraine and Russia. Users can select to support Ukraine, Russia, or World-Peace. Additionally, users can disable political messages and return to a normal Symfony application.

Installation

You can install the library using Composer:

composer require drsmithfr/symfony-political-choice

Usage

To use the library, you must override the bin/console file of your project.

#!/usr/bin/env php
<?php

use App\Kernel;
use DrSmithFr\ChooseYourSide\Application;

if (!is_file(dirname(__DIR__) . '/vendor/autoload_runtime.php')) {
    throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function (array $context) {
    $kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

    return new Application($kernel);
};

NOTE

By default, the library will display #StandWithPeace.

You can select your side by passing it to the Application as second parameter.

#!/usr/bin/env php
<?php

use App\Kernel;
use DrSmithFr\ChooseYourSide\Application;
use DrSmithFr\ChooseYourSide\Side;

if (!is_file(dirname(__DIR__) . '/vendor/autoload_runtime.php')) {
    throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function (array $context) {
    $kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

    return new Application($kernel, Side::APOLITICAL);
};

Accepted values

  • Side::APOLITICAL
  • Side::PEACE
  • Side::UKRAINE
  • Side::RUSSIA

Security

This library has been designed with security in mind. It does not collect or store any user data, and all user choices are kept private.