承接 dotkernel/api 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

dotkernel/api

最新稳定版本:7.0.0

Composer 安装命令:

composer create-project dotkernel/api

包简介

Dotkernel API

README 文档

README

Dotkernel API is a PHP skeleton app for building REST APIs based on Mezzio microframework and Laminas components which implements standards like PSR-3, PSR-4, PSR-7, PSR-11 and PSR-15.

Dotkernel API is an alternative for legacy Laminas API Tools (formerly Apigility) applications and is based on Enrico Zimuel's Zend Expressive API - Skeleton example.

Live demo.

Documentation

Documentation is available at: https://docs.dotkernel.org/api-documentation/

Version History

Branch Release PSR-11 OSS Lifecycle PHP Version
7.0 >= 7.1 1 OSS Lifecycle PHP from Packagist (specify version)
7.0 < 7.1 1 OSS Lifecycle PHP from Packagist (specify version)
6.0 < 7.0 1 OSS Lifecycle PHP from Packagist (specify version)
5.0 < 6.0 1 OSS Lifecycle PHP from Packagist (specify version)
4.0 < 5.0 1 OSS Lifecycle PHP from Packagist (specify version)
3.0 < 4.0 1 OSS Lifecycle PHP from Packagist (specify version)

Badges

OSS Lifecycle Packagist Dependency Version

GitHub issues GitHub forks GitHub stars GitHub license

Build Static codecov Qodana PHPStan

Getting Started

Clone the project

Using your terminal, navigate inside the directory you want to download the project files into. Make sure that the directory is empty before proceeding to the download process. Once there, run the following command:

git clone https://github.com/dotkernel/api.git .

Install the project dependencies

composer install

Development mode

Do not enable development mode in production!

If you're installing the project for development, you should enable development mode by running:

composer development-enable

You can disable development mode by running:

composer development-disable

You can check the development status by running:

composer development-status

Prepare config files

  • duplicate config/autoload/cors.local.php.dist as config/autoload/cors.local.php <- if your API is consumed by another application, make sure configure the allowed_origins
  • duplicate config/autoload/local.php.dist as config/autoload/local.php
  • optional: to run/create tests, duplicate config/autoload/local.test.php.dist as config/autoload/local.test.php <- this creates a new in-memory database that your tests will run on

Setup database

Use an existing empty one or create a new MariaDB/MySQL database.

Recommended collation: utf8mb4_general_ci.

With a database created, fill out the database connection params in config/autoload/local.php under $databases['default'].

Creating migrations

Create a new migration by running:

php ./vendor/bin/doctrine-migrations diff

The new migration file will be placed in src/Core/src/App/src/Migration/.

Running migrations

Execute a new migration by running:

php ./vendor/bin/doctrine-migrations migrate

This command will prompt you to confirm that you want to run it:

WARNING! You are about to execute a migration in database "<database>" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:

Hit Enter to confirm the operation.

Executing fixtures

Fixtures are used to seed the database with initial values and must be executed after migrating the database.

To list all the fixtures, run:

php ./bin/doctrine fixtures:list

This will output all the fixtures in the order of execution.

To execute all fixtures, run:

php ./bin/doctrine fixtures:execute

To execute a specific fixture, run:

php ./bin/doctrine fixtures:execute --class=FixtureClassName

More details on how fixtures work can be found in dotkernel/dot-data-fixtures documentation.

Mail configuration

If your application sends emails, you must configure an outgoing mail server under config/autoload/mail.global.php.

Test the installation

Run the following command in your project's directory to start PHPs built-in server:

php -S 0.0.0.0:8080 -t public

Running command composer serve will do the same thing, but the server will time out after a couple of minutes.

Sending a GET request to the application's home page should output the following message:

{
    "message": "Dotkernel API version 7"
}

dotkernel/api 适用场景与选型建议

dotkernel/api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 138 次下载、GitHub Stars 达 51, 最近一次更新时间为 2020 年 04 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「rest」 「api」 「REST API」 「laminas」 「mezzio」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 51
  • Watchers: 10
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-22