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

Commit

Permalink
chore(User): Make User component as Part of App but not framework
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed Mar 17, 2019
1 parent ada223c commit 233e62d
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion framework/User/User.php → apps/components/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 19:30
*/

namespace Rid\User;
namespace apps\components\User;

use Rid\Base\Component;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 11:39
*/

namespace Rid\User;
namespace apps\components\User;

interface UserInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 20:24
*/

namespace Rid\User;
namespace apps\components\User;

use Rid\Exceptions\NotFoundException;
use Rid\Utils\AttributesImportUtils;
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 @@ -196,17 +196,17 @@
'class' => Rid\Component\Config::class,
],

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

'i18n' => [
'class' => Rid\Component\I18n::class,
'fileNamespace' => 'apps\lang',
'fallbackLang' => 'en',
'forcedLang' => null,
'allowedLangSet' => ['en', 'zh-CN']
],

'user' => [
'class' => apps\components\User\User::class,
],
],

// 类库配置
Expand Down
2 changes: 1 addition & 1 deletion apps/controllers/TrackerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace apps\controllers;

use Rid\User\UserInterface;
use apps\components\User\UserInterface;
use Rid\Utils\IpUtils;
use Rid\Bencode\Bencode;

Expand Down
4 changes: 2 additions & 2 deletions apps/models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace apps\models;

use \Rid\User\UserInterface;
use \Rid\User\UserTrait;
use \apps\components\User\UserInterface;
use \apps\components\User\UserTrait;

class User implements UserInterface
{
Expand Down
2 changes: 1 addition & 1 deletion apps/models/form/UserConfirmForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace apps\models\form;

use Rid\User\UserInterface;
use apps\components\User\UserInterface;
use Rid\Validators\Validator;


Expand Down
2 changes: 1 addition & 1 deletion apps/models/form/UserLoginForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace apps\models\form;

use Rid\Helpers\StringHelper;
use Rid\User\UserInterface;
use apps\components\User\UserInterface;

use Rid\Validators\CaptchaTrait;
use Rid\Validators\Validator;
Expand Down
2 changes: 1 addition & 1 deletion apps/views/layout/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<div class="pull-left">
Welcome Back, <a href="/user" data-user-id="<?= app()->user->getId() ?>"><?= app()->user->getUsername() ?></a>&nbsp;
<span data-item="logout"><!--suppress HtmlUnknownTarget --><a href="/auth/logout">[Logout]</a></span>&nbsp;
<?php if (app()->user->getClass(true) > \Rid\User\UserInterface::ROLE_FORUM_MODERATOR): ?>
<?php if (app()->user->getClass(true) > \apps\components\User\UserInterface::ROLE_FORUM_MODERATOR): ?>
<span><!--suppress HtmlUnknownTarget --><a href="/admin">[Admin Panel]</a></span>&nbsp;
<?php endif; ?>
<span data-item="favour"><!--suppress HtmlUnknownTarget --><a href="/torrents/favour">[Favour]</a></span>&nbsp;
Expand Down
2 changes: 1 addition & 1 deletion apps/views/user/panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Date: 2019/2/22
* Time: 17:13
*
* @var \Rid\User\UserTrait $user
* @var \apps\components\User\UserTrait $user
*/
?>

Expand Down
2 changes: 1 addition & 1 deletion framework/Base/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* @property \Rid\Redis\RedisConnection $redis
* @property \Rid\Component\Config $config
* @property \Rid\Pool\ConnectionPool $connectionPool
* @property \Rid\User\User $user
* @property \Rid\Component\I18n $i18n
* @property \apps\components\User\User $user
*/
class Application extends BaseObject
{
Expand Down

0 comments on commit 233e62d

Please sign in to comment.