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

Commit

Permalink
fix(View): Fix View Don't change after service reload
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed Mar 13, 2019
1 parent e2f1bbb commit 2119c2c
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ Some rule or Docs May help you when you rebuild this project:
| Name | Used As | Repo | Docs |
|:--|:--:|:--:|:--:|
| MixPHP | Framework | https://github.com/mix-php/mix-framework/tree/v1 | https://www.kancloud.cn/onanying/mixphp1/379324 ( Chinese Version ) |
| siriusphp/validation | Validator | https://github.com/siriusphp/validation | http://www.sirius.ro/php/sirius/validation/ |
| league/plates | Template system | https://github.com/thephpleague/plates | http://platesphp.com/ |
| [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/ |
| [league/plates](https://github.com/thephpleague/plates) | Template system | http://platesphp.com/ |
1 change: 0 additions & 1 deletion apps/controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ public function actionLogout()
{
// TODO add CSRF protect
app()->user->deleteUserThisSession();
// TODO update this session status (set it expired) in database
return app()->response->redirect('/auth/login');
}
}
2 changes: 1 addition & 1 deletion apps/views/rss_feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<rss version="2.0">
<channel>
<title><?= addslashes($site_name . ' Torrents') ?></title>
<link><?= $url ?></link>
<link><?= $url ?></link>
<description><![CDATA[<?= addslashes('Latest torrents from ' . $site_name ) ?>]]></description>
<language>en</language>
<copyright><?= $copyright ?></copyright>
Expand Down
3 changes: 1 addition & 2 deletions framework/Console/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ class Input extends Component
// 初始化事件
public function onInitialize()
{
parent::onInitialize(); // TODO: Change the autogenerated stub
// 初始化
parent::onInitialize();
$this->initialize();
}

Expand Down
5 changes: 2 additions & 3 deletions framework/Database/BasePDOConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ class BasePDOConnection extends Component
// 初始化事件
public function onInitialize()
{
parent::onInitialize(); // TODO: Change the autogenerated stub
// 设置驱动连接选项
$this->_driverOptions = $this->driverOptions + $this->_defaultDriverOptions;
parent::onInitialize();
$this->_driverOptions = $this->driverOptions + $this->_defaultDriverOptions; // 设置驱动连接选项
}

public function onRequestAfter()
Expand Down
7 changes: 7 additions & 0 deletions framework/Http/HttpServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,19 @@ protected function onManagerStart()
protected function onWorkerStart()
{
$this->_server->on('WorkerStart', function (\swoole_server $server,int $workerId) {
// 刷新OpCode缓存,防止reload重载入时受到影响
foreach (['apc_clear_cache', 'opcache_reset'] as $func) {
if (function_exists($func)) /** @noinspection PhpComposerExtensionStubsInspection */
$func();
}

// 进程命名
if ($workerId < $server->setting['worker_num']) {
ProcessHelper::setTitle("rid-httpd: worker #{$workerId}");
} else {
ProcessHelper::setTitle("rid-httpd: task #{$workerId}");
}

// 实例化App
$config = require $this->virtualHost['configFile'];
$app = new Application($config);
Expand Down
5 changes: 2 additions & 3 deletions framework/Log/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ class Log extends Component implements LoggerInterface
// 初始化事件
public function onInitialize()
{
parent::onInitialize(); // TODO: Change the autogenerated stub
// 设置协程模式
$this->setCoroutineMode(Component::COROUTINE_MODE_REFERENCE);
parent::onInitialize();
$this->setCoroutineMode(Component::COROUTINE_MODE_REFERENCE); // 设置协程模式
}

// 记录日志
Expand Down
5 changes: 2 additions & 3 deletions framework/Redis/BaseRedisConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,8 @@ class BaseRedisConnection extends Component
// 初始化事件
public function onInitialize()
{
parent::onInitialize(); // TODO: Change the autogenerated stub
// 设置驱动连接选项
$this->_driverOptions = $this->driverOptions + $this->_defaultDriverOptions;
parent::onInitialize();
$this->_driverOptions = $this->driverOptions + $this->_defaultDriverOptions; // 设置驱动连接选项
}

public function onRequestAfter()
Expand Down
5 changes: 2 additions & 3 deletions framework/Redis/Coroutine/RedisConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ class RedisConnection extends \Rid\Redis\Persistent\RedisConnection
// 初始化事件
public function onInitialize()
{
parent::onInitialize(); // TODO: Change the autogenerated stub
// 开启协程
CoroutineHelper::enableCoroutine();
parent::onInitialize();
CoroutineHelper::enableCoroutine(); // 开启协程
}

// 析构事件
Expand Down

0 comments on commit 2119c2c

Please sign in to comment.