Giter Club home page Giter Club logo

loeye's Introduction

loeye

php framework

Installation

composer require loeyae/loeye 

Quick Start

初始化应用

vendor/bin/loeye loeye:create-app

运行应用

vendor/bin/loeye loeye:run-app

或者直接运行根目录下的App.php

php App.php

Demo默认监听80端口,如需修改,编辑app/config/app/master.yml

server.port=80

Demo在php安装有Swoole扩展的情况下,会默认使用Swoole\Http\Server作为服务启动,如果没有安装Swoole,会使用React\Http\Server作为服务启动

开发应用前,将app目录加入到自动加载的namespace,比如编辑composer.json,增加psr-4自动加载规则

"autoload": {
    "psr-4": {
        "app\\": "app/"
    }
}

更新autoload

composer update

根据已有数据库快速搭建应用

  • 初始化应用
vender/bin/loeye loeye:create-app
  • 修改默认监听端口
  • 增加app目录namespace自动加载规则
  • 修改conf/database/master.yml中数据配置
  • 生成数据表对应实体
vendor\bin\loeye loeye:generate-entity

生成好的实体自带简单的验证规则,可根据实际情况进行调整

  • 生成实体类对应server
vendor\bin\loeye loeye:generate-server
  • 生成实体类对应的plugin
vendor\bin\loeye loeye:generate-entity-plugins
  • 生成实体类对应的module
vendor\bin\loeye loeye:generate-entity-module

生成的module默认使用jwt作为权限验证方式,conf/modules/token.yml 用于生成token, 默认通过/token 可访问, 访问其他module时在header中增加 token信息, Authorization: $token

  • 运行应用
vendor\bin\loeye loeye:run-app

根据已有数据库快速搭建service应用

  • 初始化service应用
vendor/bin/loeye loeye:create-app -d service
  • 修改默认监听端口
  • 增加app目录namespace自动加载规则
  • 修改conf/database/master.yml中数据配置
  • 生成数据表对应实体
vendor\bin\loeye loeye:generate-entity

生成好的实体自带简单的验证规则,可根据实际情况进行调整

  • 生成实体类对应server
vendor\bin\loeye loeye:generate-server
  • 生成默认service
vendor\bin\loeye loeye:create-service

service中会生成client的配置文件和client类,可用于其它应用访问该service使用, 使用时复制conf/clien,service/client目录下的文件到相应应用,注意修改conf/client/master.yml 中的service.server_url地址,以及service/client目录下各文件的namespace。 如果需要创建相应的plugin,可使用命令 vendor\bin\loeye loeye:generate-client-plugin

  • 运行应用
vendor\bin\loeye loeye:run-app

License

Licensed under Apache 2 license.

loeye's People

Contributors

loeyae avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.