Download the PHP package quansitech/qscmf-cross-api without Composer

On this page you can find all versions of the php package quansitech/qscmf-cross-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package qscmf-cross-api

qscmf-cross-api

用于管理其他系统访问的接口,类restful的接口规范(接口命名方面不完全遵守)

安装

v2升级操作

用法

使用数据迁移管理接口权限

接口例子

属性设置

属性值在继承了RestController的类里进行设置

属性 说明 格式
filter 过滤请求,只有通过了才能进行业务数据的访问 二维数组 [['id', 'isExists', 'Order', 404], ['item_id', 'isExists', 'Item', 404]]
目前仅支持isExists,检查数据库表有无对应的记录,没有则返回设置的http状态码

restful规范的语义化请求

  1. get 表示获取信息 ,对应controller的gets方法
  2. post 表示创建信息,对应controller的create方法
  3. put 表示编辑信息, 对应controller的update方法
  4. delete 表示删除信息,对应controller的delete方法

验证请求

接口必须验证通过才能访问

版本控制

通过在http请求头的accept里加入version=1.2之类的版本号来控制接口的请求路由

如get请求,在accept 的位置加入 version=1.2,那么就会匹配到controller的 gets_v1_2的方法

内置方法

方法名 说明 参数 返回值
response 返回请求内容 message 提示信息
status 类型标记
data 返回的具体内容
code http状态码,默认值 200
extra_res_data 额外需要返回的数据,默认为空数组
返回json或者xml等格式的字符串(根据请求的资源类型而定)
{ 'info': 'message内容', 'status': 1, 'data': 'data的json格式内容', 'extra_res_data':'自定义返回内容'}
checkRequired 必填验证 data 需要验证的数组
required_list 必填的字段设置,有两种格式,直接举例说明: 1. [ 'id', 'name'] 表示id, name字段都是必填,如果没有填写,自动返回"id必填"这样的错误提示。 2. [ 'title'=> '文章标题', 'type' => '文章类型'], 表示 title, type都是必填字段,后面的value值表示对应字段的中文描述,如没有传递type字段,会自动返回“文章类型必填”的错误提示,这样用户更容易理解错误信息。
验证不通过,直接response错误信息,否则返回true

环境变量

环境变量在.env文件中设置

设置值 说明 默认值
QSCMF_CROSS_API_MAINTENANCE 关闭接口的请求

All versions of qscmf-cross-api with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
tiderjian/think-core Version >=11.32.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package quansitech/qscmf-cross-api contains the following files

Loading the files please wait ....