Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
refactor(DynamicConfig): Remove DynamicConfig provider by Redis
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed Feb 22, 2019
1 parent ec68e4a commit d644d0b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 186 deletions.
33 changes: 13 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,34 +56,27 @@ edit in Admin Panel.

```bash
root@ridpt:/data/wwwroot/ridpt.rhilip.info# php bin/rid-httpd service start

────────────────────────────────────────────────────────────────────────────
─████████████████───██████████─████████████───██████████████─██████████████─
─██░░░░░░░░░░░░██───██░░░░░░██─██░░░░░░░░████─██░░░░░░░░░░██─██░░░░░░░░░░██─
─██░░████████░░██───████░░████─██░░████░░░░██─██░░██████░░██─██████░░██████─
─██░░██────██░░██─────██░░██───██░░██──██░░██─██░░██──██░░██─────██░░██─────
─██░░████████░░██─────██░░██───██░░██──██░░██─██░░██████░░██─────██░░██─────
─██░░░░░░░░░░░░██─────██░░██───██░░██──██░░██─██░░░░░░░░░░██─────██░░██─────
─██░░██████░░████─────██░░██───██░░██──██░░██─██░░██████████─────██░░██─────
─██░░██──██░░██───────██░░██───██░░██──██░░██─██░░██─────────────██░░██─────
─██░░██──██░░██████─████░░████─██░░████░░░░██─██░░██─────────────██░░██─────
─██░░██──██░░░░░░██─██░░░░░░██─██░░░░░░░░████─██░░██─────────────██░░██─────
─██████──██████████─██████████─████████████───██████─────────────██████─────
────────────────────────────────────────────────────────────────────────────

____ __ ____ ______
/\ _`\ __ /\ \/\ _`\ /\__ _\
\ \ \L\ \/\_\ \_\ \ \ \L\ \/_/\ \/
\ \ , /\/\ \ /'_` \ \ ,__/ \ \ \
\ \ \ \ \ \/\ \L\ \ \ \/ \ \ \
\ \_\ \_\ \_\ \___,_\ \_\ \ \_\
\/_/\/ /\/_/\/__,_ /\/_/ \/_/
───────────────────────────────────────
Server Name: rid-httpd
System Name: linux
Framework Version: v0.1.2-alpha
PHP Version: 7.2.14
PHP Version: 7.3.1
Swoole Version: 4.2.12
Listen Addr: 127.0.0.1
Listen Port: 9501
Reactor Num: 8
Worker Num: 8
Hot Update: disabled
Reactor Num: 1
Worker Num: 20
Hot Update: enabled
Coroutine Mode: disabled
Config File: /data/wwwroot/ridpt.rhilip.info/apps/config/http_permanent.php

───────────────────────────────────────
```
6. Then you can safely add Nginx reserve proxy config like `migration/nginx.conf`.And Notice :
Expand Down
2 changes: 1 addition & 1 deletion apps/config/http_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
],

'config' => [
'class' => Rid\Config\ConfigByRedis::class,
'class' => Rid\Config\DynamicConfig::class,
],

'user' => [
Expand Down
2 changes: 1 addition & 1 deletion apps/config/http_permanent.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],

'config' => [
'class' => Rid\Config\ConfigBySwoole::class,
'class' => Rid\Config\DynamicConfig::class,
]
],
]);
6 changes: 3 additions & 3 deletions framework/Base/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* @property \Rid\Log\Log $log
* @property \Rid\Console\Input $input
* @property \Rid\Http\Route $route
* @property \Rid\Http\Request|\Rid\Http\Compatible\Request $request
* @property \Rid\Http\Response|\Rid\Http\Compatible\Response $response
* @property \Rid\Http\Request $request
* @property \Rid\Http\Response $response
* @property \Rid\Http\Error|\Rid\Console\Error $error
* @property \Rid\Http\Token $token
* @property \Rid\Http\Session $session
* @property \Rid\Http\Cookie $cookie
* @property \Rid\Database\PDOConnection $pdo
* @property \Rid\Redis\RedisConnection $redis
* @property \Rid\Config\ConfigBySwoole|\Rid\Config\ConfigByRedis $config
* @property \Rid\Config\DynamicConfig $config
* @property \Rid\Pool\ConnectionPool $connectionPool
* @property \Rid\User\User $user
*/
Expand Down
83 changes: 0 additions & 83 deletions framework/Config/ConfigByRedis.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Rid\Base\Component;
use Rid\Exceptions\ConfigException;

class ConfigBySwoole extends Component implements DynamicConfigInterface
class DynamicConfig extends Component implements DynamicConfigInterface
{
/** @var \swoole_table */
private $cacheTable;
Expand All @@ -32,7 +32,7 @@ public function onInitialize(array $config = [])
}
}

public function get(string $name,bool $throw = true)
public function get(string $name, bool $throw = true)
{
$setting = $this->cacheTable->get($name, $this->valueField);
// First Check config stored in RedisConnection Cache, If it exist , then just return the cached key
Expand Down
76 changes: 0 additions & 76 deletions framework/Redis/Async/RedisConnection.php

This file was deleted.

0 comments on commit d644d0b

Please sign in to comment.