mpp/apicil-client-bundle
Composer 安装命令:
composer require mpp/apicil-client-bundle
包简介
Symfony ApiCil Bundle
关键字:
README 文档
README
Installation
To install this bundle, simply run the following command:
$ composer require mpp/apicil-client-bundle
Configuration
First create a guzzle client:
// config/packages/eight_point_guzzle.yaml eight_points_guzzle: clients: my_apicil_client: base_url: '%env(APICIL_BASE_URL)%' options: auth: - '%env(APICIL_USERNAME)%' - '%env(APICIL_PASSWORD)%' my_apicil_sign_client: base_url: '%env(APICIL_BASE_URL)%' options: auth: - '%env(APICIL_SIGN_USERNAME)%' - '%env(APICIL_SIGN_PASSWORD)%'
Then configure this client to be used by the bundle:
// config/packages/mpp_apicil_client.yaml mpp_apicil_client: http_client: 'eight_points_guzzle.client.my_apicil_client' sign_http_client: 'eight_points_guzzle.client.my_apicil_sign_client'
Make sure to have enabled the serializer & property info component in symfony configuration (for serialization/deserialization):
// config/packages/framework.yaml framework: serializer: enabled: true property_info: enabled: true
Clients
Here is the mapping of client for each specification name
How to use ?
How to get a specific client domain ?
Here is a sample controller on how to get a specific client domain:
<?php namespace App\Controller; use Mpp\ApicilClientBundle\Client\ApicilClientDomainRegistryInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; class ExampleController extends AbstractController { public function exampleAction(ApicilClientDomainRegistryInterface $apicilClientRegistry) { // Here are the three different available methods on how to retrieve a client domain by its alias (choose the one you prefer) $myClient = $apicilClientRegistry->get('client_domain_alias'); // or $myClient = $apicilClientRegistry->getClientDomainAlias(); // Execute operations from the retrieved client domain // ... } }
How to use each clients ?
You'll find an exemple of usage of each client below
- [WIP] ApicilAccClient (acc)
- [WIP] ApicilArbitrationClient (arbitration)
- ApicilTradingAccountClient (trading_account)
- [WIP] ApicilContractClient (contract)
- [WIP] ApicilCollectiveContractClient (collective_contract)
- [WIP] ApicilReferentialClient (referential)
- [WIP] ApicilProductClient (product)
- [WIP] ApicilFinancialProfileClient (financial_profile)
- [WIP] ApicilKycContactInformationClient (kyc_contact_information)
- [WIP] ApicilKycIbanClient (kyc_iban)
- [WIP] ApicilPreconizationClient (preconization)
- [WIP] ApicilManagementClient (management)
- [WIP] ApicilPartialRepurchaseClient (partial_repurchase)
- [WIP] ApicilTotalRepurchaseClient (total_repurchase)
- ApicilProjectClient (project)
- [WIP] ApicilPaymentClient (payment)
Tests
Update the environment variables in phpunit.xml.dist:
<!-- ... --> <php> <!-- ... --> <env name="APP_ENV" value="test" /> <env name="APICIL_BASE_URL" value="APICIL_BASE_URL" /> <env name="APICIL_USERNAME" value="USEERNAME" /> <env name="APICIL_PASSWORD" value="PASSWORD" /> <!-- ... --> </php> <!-- ... -->
Then, use the following commands if you want to run the tests suite
$ make composer-install # once
$ make phpunit
TODO
- Create missing model/dto classes used in clients
- CourtierDto
- DonneesReferencesActifDto
- FraisEncoursDto
- PeriodiciteDto
- ResultatDeCreationResource
- SituationCompteDto
- ProfilFinancierActeDto
- ProfilFinancierConsultationDto
- ProfilFinancierDto
- ProfilFinancierQuestionDto
- RepartitionDto
- ChangementCoordonneesDto
- ErreurCodeFonctionnelDto
- IbanDto
- RachatPartielDtoDeConsultation
- EmailPropositionDto
- RecuperationVersementSuppression
- SuppressionOptionDto
- ModeGestionDto
- QuestionSupportStructureDto
- EmailPropositionSouscriptionDto
- ListDocumentDto
- CompteTitreDto
- ContratProfilGestionDto
- RecuperationContratProfileGestionDto
- TrClasseActifDto
- BasePreconisationDto
- TrProfilAllocationAutoriseDto
- Add unit tests
- ApicilAccClient
- ApicilArbitrationClient
- ApicilTradingAccountClient
- ApicilContractClient
- ApicilCollectiveContractClient
- ApicilReferentialClient
- ApicilProductClient
- ApicilFinancialProfileClient
- ApicilKycContactInformationClient
- ApicilKycIbanClient
- ApicilPreconizationClient
- ApicilManagementClient
- ApicilPartialRepurchaseClient
- ApicilTotalRepurchaseClient
- ApicilProjectClient
- ApicilPaymentClient
- Update documetation
- Add client exemple usage for all routes in documentation
- Enhance how options are resolved (ex: how file related fields are handled => add Trait ?)
mpp/apicil-client-bundle 适用场景与选型建议
mpp/apicil-client-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.9k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 07 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「yaml」 「json」 「api」 「referential」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mpp/apicil-client-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mpp/apicil-client-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mpp/apicil-client-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Kinikit - PHP Application development framework MVC component
ext-json wrapper with sane defaults
A package to cast json fields, each sub-keys is castable
A PSR-7 compatible library for making CRUD API endpoints
SUML for PHP
SUML support for Symfony
统计信息
- 总下载量: 9.9k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-29