<commit_before>Setup
=====

Installation
-------------
Install with composer:

.. code-block :: bash

    composer require jms/payment-core-bundle

And register the bundle in your ``AppKernel.php``:

.. code-block :: php

    // app/AppKernel.php

    public function registerBundles()
    {
        $bundles = array(
            // ...
            new JMS\Payment\CoreBundle\JMSPaymentCoreBundle(),
        );
    }

Configuration
-------------
The configuration is as simple as setting a random secret which will be used for encrypting data, in case this is requested.

You can generate the secret with the following command:

.. code-block :: bash

    # Feel free to increase the length of the generated string by
    # passing a larger number to openssl_random_pseudo_bytes
    php -r 'echo bin2hex(openssl_random_pseudo_bytes(16))."\n";'

And then use it in your configuration:

.. configuration-block ::

    .. code-block :: yaml

        # app/config/config.yml
        jms_payment_core:
            secret: yoursecret

    .. code-block :: xml

        <!-- app/config/config.xml -->
        <jms-payment-core secret="yoursecret" />

.. note ::

    If you change the secret, all data encrypted with the old secret will become unreadable.

Create database tables
----------------------
This bundle requires a few database tables to function. You can create these tables as follows.

If you're not using database migrations:

.. code-block :: bash

    bin/console doctrine:schema:update

Or, if you're using migrations:

.. code-block :: bash

    bin/console doctrine:migrations:diff
    bin/console doctrine:migrations:migrate

.. warning ::

    It's assumed you have entity auto mapping enabled, which is usually the case. If you don't, you need to either enabled it:

    .. code-block :: yaml

        # app/config/config.yml

        doctrine:
            orm:
                auto_mapping: true

    Or explicitely register the configuration from this bunde:

    .. code-block :: yaml

        # app/config/config.yml<commit_msg>Fix typos in setup instructions<commit_after>Setup
=====

Installation
-------------
Install with composer:

.. code-block :: bash

    composer require jms/payment-core-bundle

And register the bundle in your ``AppKernel.php``:

.. code-block :: php

    // app/AppKernel.php

    public function registerBundles()
    {
        $bundles = array(
            // ...
            new JMS\Payment\CoreBundle\JMSPaymentCoreBundle(),
        );
    }

Configuration
-------------
The configuration is as simple as setting a random secret which will be used for encrypting data, in case this is requested.

You can generate the secret with the following command:

.. code-block :: bash

    # Feel free to increase the length of the generated string by
    # passing a larger number to openssl_random_pseudo_bytes
    php -r 'echo bin2hex(openssl_random_pseudo_bytes(16))."\n";'

And then use it in your configuration:

.. configuration-block ::

    .. code-block :: yaml

        # app/config/config.yml
        jms_payment_core:
            secret: yoursecret

    .. code-block :: xml

        <!-- app/config/config.xml -->
        <jms-payment-core secret="yoursecret" />

.. note ::

    If you change the secret, all data encrypted with the old secret will become unreadable.

Create database tables
----------------------
This bundle requires a few database tables to function. You can create these tables as follows.

If you're not using database migrations:

.. code-block :: bash

    bin/console doctrine:schema:update

Or, if you're using migrations:

.. code-block :: bash

    bin/console doctrine:migrations:diff
    bin/console doctrine:migrations:migrate

.. warning ::

    It's assumed you have entity auto mapping enabled, which is usually the case. If you don't, you need to either enable it:

    .. code-block :: yaml

        # app/config/config.yml

        doctrine:
            orm:
                auto_mapping: true

    Or explicitly register the configuration from this bundle:

    .. code-block :: yaml

        # app/config/config.yml
{'fraction_non_alphanumeric': 0.10989545344031121, 'fraction_numerical': 0.0014587892049598833, 'mean_word_length': 2.3583673469387754, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '319320', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1085, 'n_words': 399}