leadingsystems/contao-api 问题修复 & 功能扩展

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

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

leadingsystems/contao-api

Composer 安装命令:

composer require leadingsystems/contao-api

包简介

Leading Systems API as a Contao bundle

README 文档

README

The API bundle adds the Leading Systems API functionality to Contao 4.

This extension is meant to assist other Leading Systems extensions such as the e-commerce extension Merconis. Technically, standalone usage is possible but we can't offer support for this extension unless it's combined with Merconis.

For more information visit the Merconis website

What is LS API and what is it good for?

LS API adds REST-like API functionality to Contao and allows you to write your own API resources.

LS API can be used in the Contao frontend and backend and it comes with a basic authentication and authorization system.

Usage

Getting started

Backend usage

With this Contao extension installed the Contao backend navigation has a new navigation group "LS API". One of the navigation items is labeled "API receiver". A click on it opens the backend API endpoint in the browser window. Since no API resource has been specified, the API will present you a JSON response with information about all available resources.

The URL of the backend API endpoint will look like this:

http://mydomain.com/contao?do=be_mod_ls_apiReceiver

To call a specific API resource, the parameter "resource" needs to be added to the URL:

http://mydomain.com/contao?do=be_mod_ls_apiReceiver&resource=getCurrentBackendUserName

Calling this URL directly would result in an "access denied" response because we didn't specify an API key:

{
"status": "error",   
"data": null,
"message": "Access denied",  
"code": 0  
}

In order to use our API credentials when accessing a resource, we need to make a POST request to the API url sending the following POST parameters:

ls_api_key:       SOME-KEY-SPECIFIED-IN-THE-CONTAO-BACKEND
ls_api_username:  username-of-an-api-user
ls_api_password:  password-of-an-api-user

The API can accept API users, frontend users or backend users, depending on the requested resource. If a resource accepts only API users (users explicitly defined as API users in the backend) the parameters ls_api_username and ls_api_password are mandatory.

If a resource accepts frontend or backend users the parameter ls_api_key still has to be provided but the user credentials for an API user can be omitted if there's a frontend or backend user logged in.

Frontend usage

To create a frontend API endpoint you have to create a frontend module of the type LS API RECEIVER and place that frontend module on a frontend page (e.g. using a content element or placing it in the layout).

You can then call the API by simply calling this page:

http://mydomain.com/api.html

To call a specific API resource, the parameter "resource" needs to be added to the URL:

http://mydomain.com/api/resource/getCurrentFrontendUserName.html

Calling this URL directly would result in an "access denied" response because we didn't specify an API key. The frontend API endpoint behaves in exactly the same way as mentioned before with the backend API endpoint.

leadingsystems/contao-api 适用场景与选型建议

leadingsystems/contao-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.27k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 03 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2018-03-15