2017 © Pedro Peláez
 

project moant

Micro framework powered by slim

image

moext/moant

Micro framework powered by slim

  • Thursday, June 14, 2018
  • by moext
  • Repository
  • 0 Watchers
  • 7 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 33 % Grown

The README.md

, (*1)

License , (*2)

Introduction

Moant is a php micro framework powered by slim.Used for easy and quick development api.
Moant have the following characteristics: * restful api route * flexible api version control * customize package * php cli command * ......, (*3)

Installation

composer create-project pygroos/moant your-app '1.0.*' --prefer-dist -vvv

Example

  • Route
$app->get('/', '\App\Api\DemoApi:test');
  • Config
APP_DEBUG=true
TIMEZONE=Asia/Shanghai

# Database config
# [required]
DB_TYPE=mysql
DB_NAME=test
DB_HOST=127.0.0.1
DB_USERNAME=root
DB_PASSWORD=
# [optional]
DB_PORT=
DB_CHARSET=
DB_PREFIX=

# Redis config
REDIS_SCHEME=tcp
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
  • Api demo
<?php

namespace App\Api;

use App\Services\DB;
use App\Services\Redis;
use App\Services\Logger;

class DemoApi extends BaseApi
{
    public function test()
    {
        // Get Param Example
        $param = $this->request->getParam('param', 0);

        // DB Service Example
        $db = DB::getInstance();
        $arrUser = $db->select('users', ['username']);

        // Redis Service Example
        $redis = Redis::getInstance();
        $redis->setex('redis_key', 3600, json_encode($arrUser));

        // Logger Service Example
        Logger::add(
            'name',
            [
                $this->request->getUri(),
                $this->request->getMethod()
            ]
        );

        return $this->outPut(
            200,
            'success',
            ['project' => 'Moant Framework'],
            $this->version
        );
    } 
}
  • Command
php task.php [Class] [Method] [(optional) param ...]

In use package

Video tutorial

http://study.163.com/course/introduction/1004712047.htm, (*4)

The Versions

14/06 2018

dev-master

9999999-dev

Micro framework powered by slim

  Sources   Download

MIT

The Requires

 

The Development Requires

by Cunhui Niu

framework slim moant

14/06 2018

dev-dev

dev-dev

Micro framework powered by slim

  Sources   Download

MIT

The Requires

 

The Development Requires

by Cunhui Niu

framework slim moant

23/05 2018

v1.0.3

1.0.3.0

Micro framework powered by slim

  Sources   Download

MIT

The Requires

 

The Development Requires

by Cunhui Niu

framework slim moant

04/01 2018

v1.0.2

1.0.2.0

Micro framework powered by slim

  Sources   Download

MIT

The Requires

 

The Development Requires

by Cunhui Niu

framework slim moant

04/01 2018

v1.0.1

1.0.1.0

Micro framework powered by slim

  Sources   Download

MIT

The Requires

 

The Development Requires

by Cunhui Niu

framework slim moant

20/12 2017

v1.0.0

1.0.0.0

Micro framework powered by slim

  Sources   Download

MIT

The Requires

 

The Development Requires

by Cunhui Niu

framework slim moant