Symfony

Setup guide for install and configure 1Pilot client on Symfony

Install on Symfony Application

Install Symfony Bundle

composer require 1pilotapp/symfony-client

Setup Symfony 4

1. add a new config/packages/one_pilot_client.yaml file with the following content

one_pilot_client:
private_key: "%env(ONE_PILOT_PRIVATE_KEY)%"
mail_from_address: "%env(ONE_PILOT_MAIL_FROM_ADDRESS)%"

2. add to your .env file the following parameters:

ONE_PILOT_PRIVATE_KEY=[your key]
ONE_PILOT_MAIL_FROM_ADDRESS=[your-app-mail-from@example.com]

ONE_PILOT_PRIVATE_KEY can be any random alphanumeric string. If you are not sure what key to use, go to 1Pilot dashboard and open the page to add a new site: a random key will be generated for you, and you can copy / paste it in your file. Of course you are free to create a totally different key, just make sure you have the same key in your .env and on the 1Pilot dashboard.

ONE_PILOT_MAIL_FROM_ADDRESS email address that you use for send mail from your application. It's used by the email verification tool for ensure emails are properly send by your application.

3. add to your config/routes.yaml the following configuration:

one_pilot:
resource: "@OnePilotClientBundle/Resources/config/routing.xml"
prefix: /

Setup Symfony 3

1. add to your app/config/config.yml file the following configuration keys:

one_pilot_client:
private_key: "%one_pilot_private_key%"
mail_from_address: "%one_pilot_mail_from_address%"

2. add to your app/config/parameters.yml.dist file the following parameters:

one_pilot_private_key: ~
one_pilot_mail_from_address: ~

This defines the new required configuration parameters.

3. add to your app/config/parameters.yml file the following parameters:

one_pilot_private_key: [your key]
one_pilot_mail_from_address: [your-app-mail-from@example.com]

one_pilot_private_key can be any random alphanumeric string. If you are not sure what key to use, go to 1Pilot dashboard and open the page to add a new site: a random key will be generated for you, and you can copy / paste it in your file. Of course you are free to create a totally different key, just make sure you have the same key in your parameters.yml and on the 1Pilot dashboard.

one_pilot_mail_from_address email address that you use for send mail from your application. It's used by the email verification tool for ensure emails are properly send by your application.

4. add to your app/config/routing.yml the following configuration:

one_pilot:
resource: "@OnePilotClientBundle/Resources/config/routing.xml"
prefix: /

5. add to your app/AppKernel.php file, in the registerBundles method, the following line:

...
new OnePilot\ClientBundle\OnePilotClientBundle(),
...

Advanced configuration

If your server is not at time you can have issue to connect your application to 1Pilot. For solve that edit app/config/config.ymland add skip_timestamp_validation like bellow.

one_pilot_client:
private_key: "..."
skip_timestamp_validation: true

Please note that this option will decrease security and that you should as much as possible set your server at the correct time.

‚Äč