jefero / bot_common
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=8.0
- ext-ctype: *
- ext-iconv: *
- ext-json: *
- ext-redis: *
- aws/aws-sdk-php: 3.177
- composer/package-versions-deprecated: 1.11.99.4
- doctrine/annotations: ^1.0
- doctrine/doctrine-bundle: ^2.4
- doctrine/doctrine-migrations-bundle: ^3.1
- doctrine/orm: ^2.9
- irazasyed/telegram-bot-sdk: ^3.6
- nelmio/api-doc-bundle: ^4.6
- phpdocumentor/reflection-docblock: ^5.2
- predis/predis: ^1.1
- ramsey/uuid-doctrine: ^1.7
- symfony/flex: ^1.3.1
- vkcom/vk-php-sdk: ^5.101
- zircote/swagger-php: ^3.2
Requires (Dev)
- codeception/codeception: ^4.1
- codeception/module-asserts: ^1.3
- codeception/module-doctrine2: ^1.1
- codeception/module-filesystem: ^1.0
- codeception/module-phpbrowser: ^1.0
- codeception/module-rest: ^1.3
- codeception/module-symfony: ^2.0
- mockery/mockery: ^1.4
- phpstan/phpstan: ^0.12.81
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
- symfony/browser-kit: 5.3.*
- symfony/css-selector: 5.3.*
- symfony/debug-bundle: 5.3.*
- symfony/maker-bundle: ^1.0
- symfony/phpunit-bridge: ^5.3
- symfony/stopwatch: 5.3.*
- symfony/web-profiler-bundle: 5.3.*
- vimeo/psalm: ^4.6
Conflicts
Replaces
README
Библиотека для удобного создания ботов для множества платформ
Installation
Install bot common with composer
composer require jefero/bot_common
Configuring
class Kernel extends BaseKernel { //Path to library private const COMMON_PATH = 'vendor/jefero/bot_common'; use MicroKernelTrait; //Import bot containers protected function configureContainer(ContainerConfigurator $container): void { $container->import('../' . self::COMMON_PATH . '/config/{packages}/*.yaml'); $container->import('../' . self::COMMON_PATH . '/config/{packages}/' . (string)$this->environment . '/*.yaml'); $container->import('../' . self::COMMON_PATH . '/config/services.yaml'); $container->import('../' . self::COMMON_PATH . '/config/{services}_' . (string)$this->environment . '.yaml'); //...other settings } //Import bot routes protected function configureRoutes(RoutingConfigurator $routes): void { $routes->import('../' . self::COMMON_PATH . '/config/{routes}/' . (string)$this->environment . '/*.yaml'); $routes->import('../' . self::COMMON_PATH . '/config/{routes}/*.yaml'); //...other settings } //Add method for register bot bundles public function registerBundles(): iterable { /** @psalm-suppress UnresolvableInclude */ $commonBundles = require $this->getProjectDir() . '/' . self::COMMON_PATH . '/config/bundles.php'; /** @psalm-suppress UnresolvableInclude */ $currentBundles = require $this->getProjectDir() . '/config/bundles.php'; $bundles = array_merge($commonBundles, $currentBundles); foreach ($bundles as $class => $envs) { /** @psalm-suppress UndefinedClass */ yield new $class(); } } }
Add jefero_common_dir parameter to your services.yaml
parameters: jefero_common_dir: '%kernel.project_dir%/vendor/jefero/bot_common' #...other params