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

Commit

Permalink
refactor(Framework): Resort Component folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed Mar 13, 2019
1 parent 2a48b4c commit 80c7608
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 69 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ So that tracker can record the peer's ip address.

## Development Help

Some rule or Docs May help you when you rebuild this project:
Some rule or Docs May help you when you rebuild this project,
Or you can join our chat group on Telegram -- [@ridpt](https://t.me/ridpt)

| Name | Used As | Repo | Docs |
| Name | Used As | Docs |
|:--|:--:|:--:|:--:|
| [MixPHP](https://github.com/mix-php/mix-framework/tree/v1) | Framework | https://www.kancloud.cn/onanying/mixphp1/379324 ( Chinese Version ) |
| [siriusphp/validation](https://github.com/siriusphp/validation) | Validator | http://www.sirius.ro/php/sirius/validation/ |
Expand Down
8 changes: 4 additions & 4 deletions apps/config/http_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@

// 日志
'log' => [
'class' => Rid\Log\Log::class, // 类路径
'class' => Rid\Component\Log::class, // 类路径
'dir' => 'logs', // 日志目录
'rotate' => Rid\Log\Log::ROTATE_DAY, // 日志轮转类型
'rotate' => Rid\Component\Log::ROTATE_DAY, // 日志轮转类型
'maxFileSize' => 0, // 最大文件尺寸
],

Expand Down Expand Up @@ -186,15 +186,15 @@
],

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

'user' => [
'class' => Rid\User\User::class,
],

'i18n' => [
'class' => Rid\I18n\I18n::class,
'class' => Rid\Component\I18n::class,
'fileNamespace' => 'apps\lang',
'fallbackLang' => 'en',
'mergeFallback' => true,
Expand Down
2 changes: 1 addition & 1 deletion apps/config/http_coroutine.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
],

'config' => [
'class' => Rid\Config\ConfigBySwoole::class,
'class' => Rid\Component\Config::class,
]
],
]);
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\DynamicConfig::class,
'class' => Rid\Component\Config::class,
]
],
]);
4 changes: 2 additions & 2 deletions apps/config/httpd.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
],

'log' => [
'class' => Rid\Log\Log::class,
'class' => Rid\Component\Log::class,
'level' => ['error', 'info', 'debug'],
'logDir' => 'logs',
'logRotate' => Rid\Log\Log::ROTATE_DAY,
'logRotate' => Rid\Component\Log::ROTATE_DAY,
'maxFileSize' => 1024, // bytes
],

Expand Down
2 changes: 1 addition & 1 deletion bin/rid-httpd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

require __DIR__ . '/../vendor/autoload.php';

Rid\Config\Env::load(__DIR__ . '/../.env');
Rid\Base\Env::load(__DIR__ . '/../.env');

$config = require __DIR__ . '/../apps/config/httpd.php';
$exitCode = (new Rid\Console\Application($config))->run();
Expand Down
6 changes: 3 additions & 3 deletions framework/Base/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Rid\Base;

/**
* @property \Rid\Log\Log $log
* @property \Rid\Component\Log $log
* @property \Rid\Console\Input $input
* @property \Rid\Http\Route $route
* @property \Rid\Http\Request $request
Expand All @@ -14,10 +14,10 @@
* @property \Rid\Http\Cookie $cookie
* @property \Rid\Database\PDOConnection $pdo
* @property \Rid\Redis\RedisConnection $redis
* @property \Rid\Config\DynamicConfig $config
* @property \Rid\Component\Config $config
* @property \Rid\Pool\ConnectionPool $connectionPool
* @property \Rid\User\User $user
* @property \Rid\I18n\I18n $i18n
* @property \Rid\Component\I18n $i18n
*/
class Application extends BaseObject
{
Expand Down
2 changes: 1 addition & 1 deletion framework/Config/Env.php → framework/Base/Env.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rid\Config;
namespace Rid\Base;

/**
* 环境类
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
* Time: 20:39
*/

namespace Rid\Config;
namespace Rid\Component;

use Rid\Base\Component;
use Rid\Exceptions\ConfigException;

class DynamicConfig extends Component implements DynamicConfigInterface
class Config extends Component
{
/** @var \swoole_table */
private $cacheTable;
Expand Down
2 changes: 1 addition & 1 deletion framework/I18n/I18n.php → framework/Component/I18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 19:55
*/

namespace Rid\I18n;
namespace Rid\Component;

use Rid\Base\Component;

Expand Down
2 changes: 1 addition & 1 deletion framework/Log/Log.php → framework/Component/Log.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rid\Log;
namespace Rid\Component;

use Psr\Log\LogLevel;
use Psr\Log\LoggerTrait;
Expand Down
49 changes: 0 additions & 49 deletions framework/Config/DynamicConfigInterface.php

This file was deleted.

2 changes: 1 addition & 1 deletion framework/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function app($prefix = null)
*/
function env($name = null, $default = '')
{
return \Rid\Config\Env::get($name, $default);
return \Rid\Base\Env::get($name, $default);
}
}

Expand Down

0 comments on commit 80c7608

Please sign in to comment.