Download the PHP package jswei/dawn-api without Composer

On this page you can find all versions of the php package jswei/dawn-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 dawn-api

Dawn-Api

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads

说明

ThinkPHP5编写的restful风格的API,集API请求处理,权限认证,自动生成文档等功能;

安装

v0.0.4版本

  1. 修复ThinkPHP更新出现的BUG
  2. 生成文档API优化

功能增强

关于dawn-api更改的部分

这里再次对dawn-api进行了改动,下面就更改的一些地方进行说明

  1. 优化并使用了自动加载扩展函数,解放了每次都要手动在extraActionList书写的问题
  2. Wiki文档可以使用注解进行标记了,解放了需要在getRules()中写参数才能显示的问题,当然,只是做优化,您还可以写在里面,在这里我主要使用注解方式.下面是注解的用法,以login为例:

    /**
         * @title 用户登录
         * @method login 
         * @param string $phone 账号 true
         * @param string $password 密码 true md5
         * @route('v1/user/login')
         * @return Object User 用户信息
       */
    • @title 接口名称
    • @method 注解的方法,表现为Wiki方法login的接口参数说明
    • @param 参数列表,以一个空格隔开.形如:[数据类型 形参 参数名称 是否必须 备注说明 取值范围]
    • @route 注解路由,在wiki的表现形式是将路由显示在方法后面
    • @return 返回的数据类型,以一个空格隔开.形如:[数据类型 参数名称 备注说明]
    • 完成后的效果:

    注解显示效果

  3. 配合使用ThinkPHP5.1.*的注解路由更家灵活多变,上面的例子就用到了注解路由,更多有关于注解路由请参考

    关于dawn-api说明

    1. 为了方便使用这里讲修改过的dawn-api也提交到项目中了
    2. 原先下载是的是没有适配后的dawn-api所以不支持ThinkPHP5.1.*
    3. 关于其他的配置以及wiki的配置,请参见dawn-api的说明
    4. 修改的不太成熟,如有问题请提出

    新增了命令行工具

    为了方便使用在这里新增了命令行工具,使用命令行工具可以快速的创建API控制器,下面做简单的介绍

    1. 进入项目目录后,输入php ./think可以查看可以使用的命令行,看到了api,就表示可以使用提供的命令行工具了,显示如图:

    命令行

    1. 使用命令php ./think api -s first -c news创建一个命名空间为first 名称为news的控制器,运行命令后出现了Success就创建成功了.如图:

    wiki文档

    1. 命令执行成功后你会看到在项目中application\first\controller中多出了一个名为News.php的文件,这个就是为你生成的一些方法.

    2. 在生成控制器的同时还在配置文件api_doc.php生成了相应的文档的相关配置,如图:

    wiki文档

    1. 打开wiki这时就可以看见基本的相关api的文档说明,如图:

    wiki文档

    1. 这时候点击api地址可以测试是否成功(这里使用的是BaseAuth,浏览器提示登录窗口).如图:

    wiki文档

    需要注意的是因为开启了注解路由,创建成功之后最好执行路由生成工具,重新生成路由.

    api命令号的说明

    下面主要介绍一下提供的参数,方便您使用

    1. 首先,你可以使用php ./think api -h查看帮助,您将得到的结果如下:

    wiki文档

    • -s or --namespace 生成的控制器的命名空间
    • -c or --controller 生成的控制器的名称
    • -i or --id 生成的文档配置的id,默认是根据原配置一次增加
    • -p or --parent 作为一个文档的子节点的父亲id,默认是0顶级节点
    • 看一些列子
    1. php ./think api -s first -c sub -p 5 #为id为5的创建一个字文档,id自增
    2. php ./think api -s first -c sub1 -i 8 #创建一个id为8的文档节点,父级为顶级
    3. php ./think api -s first -c sub2 -i 9 -p 5 #创建一个id为5的创建一个id为9的子级文档节点

    运行成功后:

    wiki文档02

    wiki文档03

    wiki文档04

    wiki文档04

在线的例子

在线示例WIKI

Postman接口文档


All versions of dawn-api with dependencies

PHP Build Version
Package Version
Requires topthink/framework Version ~5.0 || ~6.0
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 jswei/dawn-api contains the following files

Loading the files please wait ...