os2web/os2web_datalookup 问题修复 & 功能扩展

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

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

os2web/os2web_datalookup

Composer 安装命令:

composer require os2web/os2web_datalookup

包简介

Provides integration with Danish data lookup services such as Service platformen or Datafordeler.

README 文档

README

Install

OS2Web Data lookup provides integration with Danish data lookup services such as Service platformen or Datafordeler. Module is available to download via composer.

composer require os2web/os2web_datalookup
drush en os2web_datalookup

Update

Updating process for OS2Web Data lookup module is similar to the usual Drupal 8 module. Use Composer's built-in command for listing packages that have updates available:

composer outdated os2web/os2web_datalookup

Automated testing and code quality

See OS2Web testing and CI information

Contribution

Project is opened for new features and os course bugfixes. If you have any suggestion, or you found a bug in project, you are very welcome to create an issue in GitHub repository issue tracker. For issue description, there is expected that you will provide clear and sufficient information about your feature request or bug report.

Code review policy

See OS2Web code review policy

Git name convention

See OS2Web git name convention

Using services in other modules

// CVR lookup
/** @var \Drupal\os2web_datalookup\Plugin\DataLookupManager $pluginManager */
$pluginManager = \Drupal::service('plugin.manager.os2web_datalookup');
/** @var \Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupCompanyInterface $cvrPlugin */
$cvrPlugin = $pluginManager->createDefaultInstanceByGroup('cvr_lookup');

if ($cvrPlugin->isReady()) {
  $cvrResult = $cvrPlugin->lookup($cvr);
}

// CPR lookup.
/** @var \Drupal\os2web_datalookup\Plugin\DataLookupManager $pluginManager */
$pluginManager = \Drupal::service('plugin.manager.os2web_datalookup');
/** @var \Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupCprInterface $cprPlugin */
$cprPlugin = $pluginManager->createDefaultInstanceByGroup('cpr_lookup');

if ($cprPlugin->isReady()) {
  $cprResult = $cprPlugin->lookup($cpr);
}

// CVR lookup - DEPRECATED.
\Drupal::service('plugin.manager.os2web_datalookup')->createInstance('serviceplatformen_cvr')->getLegalUnit('[CVR number]')


// CPP lookup - DEPRECATED.
\Drupal::service('plugin.manager.os2web_datalookup')->createInstance('serviceplatformen_cpr')->cprBasicInformation('[CPR number]'))

New services/features

Datafordeler integration (https://datafordeler.dk)

In the scope of os2forms project already implemented light integration with Danmarks Adresseregister (DAR) via fetching data for form elements autocomplete.

See os2forms_dawa submodule

As soon as it is clear how the integration is going to be used, then os2forms_dawa will be refactored to OS2Web Data lookup plugin.

Important notes

Serviceplatformen plugins

Settings for CPR and CVR serviceplatformen plugins are storing as configuration in db and will(could) be exported as yml file via Drupal's configuration management system. And afterward could be tracked by git.

If case you have public access to your git repository, all settings from plugins will be exposed for third persons.

To avoid/prevent this behavior, we recommend use Config ignore module, where you can add all settings you do not want to export/import via the configuration management system.

Coding standards

Our coding are checked by GitHub Actions (cf. .github/workflows/pr.yml). Use the commands below to run the checks locally.

PHP

docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.3-fpm composer install
# Fix (some) coding standards issues
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.3-fpm composer coding-standards-apply
# Check that code adheres to the coding standards
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.3-fpm composer coding-standards-check

Markdown

docker run --rm --volume $PWD:/md peterdavehello/markdownlint markdownlint --ignore vendor --ignore LICENSE.md '**/*.md' --fix
docker run --rm --volume $PWD:/md peterdavehello/markdownlint markdownlint --ignore vendor --ignore LICENSE.md '**/*.md'

Code analysis

We use PHPStan for static code analysis.

Running statis code analysis on a standalone Drupal module is a bit tricky, so we use a helper script to run the analysis:

docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.3-fpm ./scripts/code-analysis

os2web/os2web_datalookup 适用场景与选型建议

os2web/os2web_datalookup 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15.61k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 11 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 os2web/os2web_datalookup 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 os2web/os2web_datalookup 我们能提供哪些服务?
定制开发 / 二次开发

基于 os2web/os2web_datalookup 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 15.61k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 9
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: EUPL-1.2
  • 更新时间: 2019-11-28