codivores/laravel-ocpi-emsp 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

codivores/laravel-ocpi-emsp

最新稳定版本:v0.1.1

Composer 安装命令:

composer require codivores/laravel-ocpi-emsp

包简介

A Laravel package for OCPI (Open Charge Point Interface) protocol as eMSP (e-Mobility Service Provider).

README 文档

README

Latest Version on Packagist Total Downloads

Laravel package for OCPI (Open Charge Point Interface) protocol as eMSP (e-Mobility Service Provider).

Key Features:

  • OCPI version: 2.1.1
  • OCPI Modules:
    • CDRs
    • Commands
    • Credentials & Registration
    • Locations
    • Sessions
    • Versions

Version support

  • PHP: 8.2, 8.3
  • Laravel: 11.0

Installation

You can install the package via composer:

composer require codivores/laravel-ocpi-emsp

If you want to customize the eMSP configuration (party information, versions and available modules), you can publish the dedicated config file:

php artisan vendor:publish --tag="ocpi-emsp-config"

This is the content of the published config file:

return [

    /*
    |--------------------------------------------------------------------------
    | Party
    |--------------------------------------------------------------------------
    */

    'party' => [
        'party_id' => env('OCPI_EMSP_PARTY_ID'),
        'country_code' => env('OCPI_EMSP_COUNTRY_CODE'),
        'business_details' => [
            'name' => env('OCPI_EMSP_NAME', env('APP_NAME')),
            'website' => env('OCPI_EMSP_WEBSITE', env('APP_URL')),
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Versions
    |--------------------------------------------------------------------------
    */

    'versions' => [
        '2.1.1' => [
            'modules' => [
                'cdrs',
                'commands',
                'credentials',
                'locations',
                'sessions',
            ],
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Modules
    |--------------------------------------------------------------------------
    */

    'module' => [
        'cdrs' => [
            'id_separator' => env('OCPI_EMSP_MODULE_CDRS_ID_SEPARATOR', '___'),
        ],
    ],

];

If you want to customize the package configuration, you can publish the config file:

php artisan vendor:publish --tag="ocpi-config"

This is the content of the published config file:

return [

    /*
    |--------------------------------------------------------------------------
    | Server
    |--------------------------------------------------------------------------
    */

    'server' => [
        'enabled' => env('OCPI_SERVER_ENABLED', true),
        'routing' => [
            'uri_prefix' => env('OCPI_SERVER_ROUTING_URI_PREFIX', 'ocpi/emsp'),
            'name_prefix' => env('OCPI_SERVER_ROUTING_NAME_PREFIX', 'ocpi.emsp.'),
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Client
    |--------------------------------------------------------------------------
    */

    'client' => [
        'server' => [
            'url' => env('OCPI_CLIENT_SERVER_URL', env('APP_URL')).'/'.env('OCPI_SERVER_ROUTING_URI_PREFIX', 'ocpi/emsp'),
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Database
    |--------------------------------------------------------------------------
    */

    'database' => [
        'connection' => env('OCPI_DATABASE_CONNECTION', env('DB_CONNECTION', 'sqlite')),
        'table' => [
            'prefix' => env('OCPI_DATABASE_TABLE_PREFIX', 'ocpi_'),
        ],
    ],

];

Getting started

Define the eMSP information environment variables:

OCPI_EMSP_PARTY_ID=MYC
OCPI_EMSP_COUNTRY_CODE=FR
OCPI_EMSP_NAME=My Company
OCPI_EMSP_WEBSITE=https://www.my-company.org

Initialize a new "Sender" Party to start credentials exchange:

php artisan ocpi:credentials:initialize

Run credentials exchange with a new "Sender" Party:

php artisan ocpi:credentials:register {party_code}

Other commands

Update credentials and versions with a Party:

php artisan ocpi:credentials:update {party_code} {--without_new_client_token}

Synchronize locations of all or a specific Party:

php artisan ocpi:locations:synchronize {--P|party=}

License

The DBAD License (DBAD). Please see License File for more information.

统计信息

  • 总下载量: 91
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2024-10-24