Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
TIGERB committed May 7, 2017
2 parents c6b5578 + 23751b1 commit 4da8f90
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
11 changes: 7 additions & 4 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/cocoapods/l/AFNetworking.svg" alt="License"></a>
</p>

<p align="center"> 从0开始搭建一个属于你自己的PHP框架 <p>
<p align="center"> 从0开始构建一个属于你自己的PHP框架 <p>

<p align="center"> <a href="./README.md">英文版</a> <p>

Expand Down Expand Up @@ -209,7 +209,7 @@ $this->get('v1/user/info', function (Framework\App $app) {

**微单体路由**

我在这里详细说下这里所谓的微单体路由,面向SOA和微服务架构大行其道的今天,有很多的团队都在向服务化迈进,但是服务化中困难最大和成本最高的地方之一应该就是分布式的事务问题。这导致对于小的团队从单体架构走向服务架构难免困难重重,所以有人提出来了微单体架构,按照我的理解就是在一个单体架构的SOA过程,我们把微服务中的的各个服务还是以模块的方式放在同一个单体中,比如:
我在这里详细说下这里所谓的微单体路由,面向SOA和微服务架构大行其道的今天,有很多的团队都在向服务化迈进,但是服务化过程中很多问题的复杂度都是指数级的增长,例如分布式的事务,服务部署,跨服务问题追踪等等。这导致对于小的团队从单体架构走向服务架构难免困难重重,所以有人提出来了微单体架构,按照我的理解就是在一个单体架构的SOA过程,我们把微服务中的的各个服务还是以模块的方式放在同一个单体中,比如:

```
app
Expand Down Expand Up @@ -561,7 +561,7 @@ public function testDemo()
{
$this->assertEquals(
'Hello Easy PHP',
// 执行demo模块index控制器hello操作,断言结果是不是等于Hello Easy PHP 
// 执行demo模块index控制器hello操作,断言结果是不是等于'Hello Easy PHP' 
App::$app->get('demo/index/hello')
);
}
Expand Down Expand Up @@ -649,15 +649,18 @@ cp ./.git-hooks/* ./git/hooks

然后正常发起PR即可, 所有的commit我都会进行代码格式(psr)验证和commit-msg验证,如果发生错误,请按照提示纠正即可。

项目地址:[https://github.com/TIGERB/easy-php](https://github.com/TIGERB/easy-php)

# TODO

- 懒加载优化框架加载流程
- 性能测试和优化
- 变更Helper助手类的成员方法为框架函数,简化使用提高生产效率
- 提供更友善的开发api帮助
- 模块支持数据库nosql自定义配置
- 支持mysql主从配置
- ORM提供更多链式操作api
- 框架log行为进行级别分类
- 想办法解决上线部署是配置文件问题
- 性能测试和优化
- 基于phar文件和git webhook自动化打包部署
- ...
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Entry file ----> Register autoload function
----> View
```

In addition, unit test, nosql support, api documents and some auxiliary scripts, etc.The Easy PHP framework directory as follows:
In addition, unit test, nosql support, api documents and some auxiliary scripts, etc. Finnally, My framework directory as follows:

# Project Directory Structure

Expand Down Expand Up @@ -206,7 +206,7 @@ $this->get('v1/user/info', function (Framework\App $app) {

**micro monolith router**

What's the micro monolith router? There are a lot of teams are moving in the SOA service structure or micro service structure, I think it is difficult for a small team. But the micro monolith be born, what's this? In my opinion, this is a SOA process for a monolith application.For example:
What's the micro monolith router? There are a lot of teams are moving in the SOA service structure or micro service structure, I think it is difficult for a small team. So the micro monolith was born, what's this? In my opinion, this is a SOA process for a monolith application.For example:

```
app
Expand All @@ -219,15 +219,15 @@ app
└── CustomService [custom service module]
```

As above, we implemented a easy micro monolith structure.But how these module to communicate with each other? As follows:
As above, we implemented a easy micro monolith structure.But how these module to communicate with each other? As follows:

```
App::$app->get('demo/index/hello', [
'user' => 'TIGERB'
]);
```

So we can resolve this problem loose coupling. In the meantime, we can exchange our application to the SOA structure easily, beacuse we only need to change the method get implementing way in the App class. Such as, RPC, REST. etc.
So we can resolve this problem loose coupling. In the meantime, we can exchange our application to the SOA structure easily, beacuse we only need to change the method get implementing way in the App class, the way contain RPC, REST. etc.

[[file: framework/hanles/RouterHandle.php](https://github.com/TIGERB/easy-php/blob/master/framework/handles/RouterHandle.php)]

Expand Down Expand Up @@ -329,7 +329,7 @@ frontend [application frontend source code directory]
**Build Step**

```
npm install
yarn install
DOMAIN=http://yourdomain npm run dev
```
Expand All @@ -349,7 +349,7 @@ public [this is a resource directory to expose service

## ORM

What's the ORM(Object Relation Map)? In my opinion, ORM is a thought that build a relationship of object and the abstract things.The model is the database's table and the model's instance is a operation for the table."Why do you do that, use the sql directly is not good?", my answer:No, you can do what you like to do, everything is flexable, but it's not be suggested from a perspective of a framework's **reusable, maintainable and extensible**.
What's the ORM(Object Relation Map)? In my opinion, ORM is a thought that build a relationship of object and the abstract things.The model is the database's table and the model's instance is a operation for the table."Why do you do that, use the sql directly is not good?", my answer:you can do what you like to do, everything is flexable, but it's not be suggested from a perspective of a framework's **reusable, maintainable and extensible**.

On the market for the implemention of the ORM, such as: Active Record in thinkphp and yii, Eloquent in laravel, then we call the ORM here is "ORM" simply. The "ORM" structure in the framework as follows:

Expand Down Expand Up @@ -581,7 +581,7 @@ public function testDemo()

**cli script**

Run the framework with cli mode, detail as instruction.
Run the framework with cli mode, detail in the instruction.

**build script**

Expand Down Expand Up @@ -642,8 +642,11 @@ cp ./.git-hooks/* ./git/hooks
```
After that, launch a PR as usual.

project address: [https://github.com/TIGERB/easy-php](https://github.com/TIGERB/easy-php)

# TODO

- The performance test and optimize
- Use the lazy load thought to optimize the framework
- Change Helper's method to the framework's function
- Provide much friendly help for user
Expand All @@ -652,5 +655,5 @@ After that, launch a PR as usual.
- ORM provide more apis
- Make different rank for log
- Resolve config problem when publish our project
- The performance test and optimize
- implement auto deploy by used phar and git webhook
- ...
2 changes: 1 addition & 1 deletion framework/handles/LogHandle.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class LogHandle implements Handle
private $logFileName = 'easy-php-framework-run';

/**
* 延时注册Loger实例到容器
* 延时注册Logger实例到容器
*
* @param App $app 框架实例
* @return void
Expand Down
2 changes: 1 addition & 1 deletion public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* TIERGB *
* <https://github.com/TIGERB> *
* *
* Version: 0.3.6 *
* Version: 0.6.6 *
********************************************/

// 载入框架运行文件
Expand Down

0 comments on commit 4da8f90

Please sign in to comment.