定制 vikkio88/slime-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

vikkio88/slime-api

Composer 安装命令:

composer create-project vikkio88/slime-api

包简介

a simple RestFul API framework based on Slim v3

README 文档

README

Build Status Scrutinizer Code Quality Code Climate Test Coverage Issue Count

Laravel is as heavy as a pregnant morbidly obese hippo and full of things that you would never use but you like eloquent models?

Well use slime-api for fuck sake.

Basically a boilerplate to create quickly RestFulAPI.

Ingredients

Aqua, Eloquent (from Laravel), Slim (v3), Some other bullshit

Beware, it might contain nuts

HowTo

First clone the project

git clone git@github.com:vikkio88/slime.git

or install with composer

composer create-project vikkio88/slime-api WHATEVER

Install the dependencies (not needed if you used create-project command above)

composer install

Move and edit the configuration from the file .env.example to the file .env

Run the migrations and seeders

php novice migrate && php novice seeder

Run the tests

phpunit

Novice

novice is a php cli script taken from another project. In this small project I extended it to make it easier for everyone to generate classes and even generate their own commands.

How to

Novice will run a script which is in the right place, if it extends the right Interface. The file config/console contains the path where novice will search for the scripts

return [
    'commandPaths' => [
        'App\Lib\Slime\Console\Commands\\',
        'App\Console\\'
    ]
];

If you need more, just add more (dont forget to add them to the composer json autoloader config)

Usage

To run a novice command you will need to be in the root of the project and type

$ php novice <command_name>

Command Bundled

Out of the box Slime provide you the following novice commands:

create_config <name>
create_migration <name>
create_model <name> (namespaces availabile)
create_action <name> (namespaces availabile)
create_seeder <name>
create_route <name>
migrate
seed
build

which code can be found on App\Lib\Slime\Console\Commands

and

coverage [percentage]
echo [parameter1] [parameter2] ...

which code can be found on App\Console

Build Command

Running the command php novice build you will generate a lighter version of your api project (easier to deploy via ftp) in the dist/ folder.

php novice build

Will generate the deployable version, if you want it to be execute with verbose output just add -v

php novice build clean

will clean the dist/ folder.

There is one configuration file that will allow you to customize your build config/build.php You can add to this file the folders and the files you want the build script to copy over, and if you want to exclude more files on the vendor clean process.

Namespaced Generator Commands

php novice create_model users\\player

Will generate a Model inside the right folder, creating the namespace structure (psr4 standard) and the namespace string on the file head. the command above will generate Models/Users/Player.php file and the class will be in the namespace App\Models\Users.

php novice create_action users\\player_get_one

Will generate an Action inside the right folder, creating the namespace structure (psr4 standard) and the namespace string on the file head. the command above will generate Actions/Users/PlayerGetOne.php file and the class will be in the namespace App\Actions\Users.

All the Generator commands convert snake_case into UpperCamelCase, so if you type

php novice create_model users\\player_match

the command above will generate Models/Users/PlayerMatch.php file and the class will be in the namespace App\Models\Users.

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-10-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固