sipsystemgm/parser-command-bundle

Simple parser command

1.2.3 2021-10-26 11:01 UTC

This package is auto-updated.

Last update: 2024-04-26 16:42:40 UTC


README

This is a parser command bundle.The functionality is implemented here to run parse command and run queue manager

This component was developed to demonstrate developing approaches only!!!

Installation

% composer require sipsystemgm/parser-command-bundle
// config/bundles.php

return [
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    ...
    // Insert bundle over there
    Sip\ParserCommand\ParserCommandBundle::class => ['all' => true]
]

Configuration

# config/packeges/messager.yaml
framework:
    messenger:
        transports:
             # insert parameter
             parser: '%env(MESSENGER_TRANSPORT_DSN)%'
        routing:
            # insert parameter
            'Sip\ParserCommand\Message\ParserQueueMessage': parser
# .env
###> symfony/messenger ###
# Choose one of the transports below
...
# uncomment this page and set you parameters
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
###< symfony/messenger ###

# insert this block and set your parameters
##> memcached ###
MEMCACHED_HOST=localhost
MEMCACHED_PORT=11211
##> memcached ###
% php bin/console doctrine:migrations:diff
% php bin/console doctrine:migrations:migrate

Run

# run php bin/console parser --help for more details

% php bin/console parser https://some-host 4 20
% php bin/console messenger:consume parser

Testing

Configurations

% composer require --dev phpunit/phpunit symfony/test-pack
% cp .env.test .env.test.local
% cp phpunit.xml.dist phpunit.xml

insert memcached block in file .env.test.local and set your parameters if they are different

##> memcached ###
MEMCACHED_HOST=localhost
MEMCACHED_PORT=11211
##> memcached ##

insert test path directory in file phpunit.xml

<testsuite name="Project Test Suite">
    <directory>tests</directory>
    ...
    <directory>vendor/sipsystemgm/parser-command-bundle/tests</directory>
 </testsuite>

Run test

% composer exec phpunit