2017 © Pedro Peláez
 

symfony-bundle lapresselibre-bundle

Symfony bundle of mediapart/lapresselibre library

image

mediapart/lapresselibre-bundle

Symfony bundle of mediapart/lapresselibre library

  • Friday, November 17, 2017
  • by methylbro
  • Repository
  • 6 Watchers
  • 3 Stars
  • 2,960 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 5 Versions
  • 19 % Grown

The README.md

La Presse Libre Symfony Bundle

Build Status Code Coverage Scrutinizer Quality Score Total Downloads Latest Stable Version, (*1)

Installation

Install the package with Composer:, (*2)

composer require mediapart/lapresselibre-bundle

Load the bundle into your Kernel:, (*3)

# app/AppKernel.php

$bundles = array(
    // ...
    new Mediapart\Bundle\LaPresseLibreBundle\MediapartLaPresseLibreBundle(),
);

Configure your App with your LaPresseLibre partner credentials:, (*4)

# app/config/config.yml

mediapart_la_presse_libre:
    public_key:   %lapresselibre_publickey%
    secret_key:   %lapresselibre_secretkey%
    aes_password: %lapresselibre_aespassword%
    aes_iv:       %lapresselibre_aesiv%

WebServices

Configure the routing:, (*5)

# app/config/routing.yml

MediapartLaPresseLibreWebServices:
  resource: "@MediapartLaPresseLibreBundle/Resources/config/routing/webservices.php"
  #prefix: lapresselibre/

And then, indicates your endpoints uri into LaPresseLibre partner platform., (*6)

Define what your endpoints have to do. For example, Your verification endpoint will look like :, (*7)

<?php
# src/Acme/LaPresseLibre/Verification.php

namespace AppBundle\LaPresseLibre;

use Mediapart\LaPresseLibre\Subscription\Type as SubscriptionType;

class Verification
{
    private $public_key;

    public function __construct($public_key)
    {
        $this->public_key = $public_key;
    }

    public function alwaysVerifiedAccounts(array $data, $isTesting = false)
    {
        $now = new \DateTime('next year');
        return [
            'Mail' => $data['Mail'],
            'CodeUtilisateur' => $data['CodeUtilisateur'],
            'TypeAbonnement' => SubscriptionType::MONTHLY,
            'DateExpiration' => $now->format("Y-m-d\TH:i:sO"),
            'DateSouscription' => $now->format("Y-m-d\TH:i:sO"),
            'AccountExist' => true,
            'PartenaireID' => $this->public_key,
        ];
    }
}
# app/config/services.yml

services:
  your_verification_service:
    class: 'AppBundle\LaPresseLibre\Verification'
    arguments: 
      - '%lapresselibre_publickey%'
    tags:
      - { name: 'lapresselibre', route: 'lapresselibre_verification', operation: 'Mediapart\LaPresseLibre\Operation\Verification', method: 'alwaysVerifiedAccounts' }

https://github.com/NextINpact/LaPresseLibreSDK/wiki/Liaison-de-compte-utilisateur-par-redirection, (*8)

Configure the routing:, (*9)

# app/config/routing.yml

MediapartLaPresseLibreLinkAccount:
  resource: "@MediapartLaPresseLibreBundle/Resources/config/routing/link-account.php"
  #prefix: lapresselibre/

Implements Mediapart/LaPresseLibre/Account/Repository and Mediapart\Bundle\LaPresseLibreBundle\Account\AccountProvider interfaces., (*10)

# app/config/services.yml

services:
  # …
  your_account_repository:
    class: 'AppBundle\LaPresseLibre\AccountRepository'
  your_account_provider:
    class: 'AppBundle\LaPresseLibre\AccountProvider'

Update the config :, (*11)

# app/config/config.yml

mediapart_lapresselibre:
    # …
    account:
        repository: 'your_account_repository'
        provider: 'your_account_provider'

The Versions

17/11 2017

dev-master

9999999-dev

Symfony bundle of mediapart/lapresselibre library

  Sources   Download

CC BY-NC-SA

The Requires

 

The Development Requires

by Thomas GASC

17/11 2017

v2.0.1

2.0.1.0

Symfony bundle of mediapart/lapresselibre library

  Sources   Download

CC BY-NC-SA

The Requires

 

The Development Requires

by Thomas GASC

14/11 2017

v2.0.0

2.0.0.0

Symfony bundle of mediapart/lapresselibre library

  Sources   Download

CC BY-NC-SA

The Requires

 

The Development Requires

by Thomas GASC

10/10 2017

v1.0.1

1.0.1.0

Symfony bundle of mediapart/lapresselibre library

  Sources   Download

CC BY-NC-SA

The Requires

 

The Development Requires

by Thomas GASC

22/09 2017

v1.0.0

1.0.0.0

Symfony bundle of mediapart/lapresselibre library

  Sources   Download

CC BY-NC-SA

The Requires

 

The Development Requires

by Thomas GASC