Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
TODO整理、不要なコードを削除
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuring committed Apr 16, 2023
1 parent 250c887 commit 6af1265
Show file tree
Hide file tree
Showing 20 changed files with 2 additions and 1,219 deletions.
2 changes: 0 additions & 2 deletions plugins/baser-core/config/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,6 @@
'title' => __d('baser_core', 'ログメンテナンス'),
'url' => ['prefix' => 'Admin', 'plugin' => 'BaserCore', 'controller' => 'utilities', 'action' => 'log_maintenance']
],
// 'UtilitiesWriteSchema' => ['title' => __d('baser_core', 'スキーマファイル生成'), 'url' => ['prefix' => 'Admin', 'plugin' => 'BaserCore', 'controller' => 'utilities', 'action' => 'write_schema']],
// 'UtilitiesLoadSchema' => ['title' => __d('baser_core', 'スキーマファイル読込'), 'url' => ['prefix' => 'Admin', 'plugin' => 'BaserCore', 'controller' => 'utilities', 'action' => 'load_schema']],
]
]
]
Expand Down
10 changes: 0 additions & 10 deletions plugins/baser-core/src/Controller/Admin/SiteConfigsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@
class SiteConfigsController extends BcAdminAppController
{

/**
* コンポーネント
*
* @var array
*/
// TODO ucmitz 未実装のため代替措置
/* >>>
public $components = ['BcManager'];
<<< */

/**
* 基本設定
* @param SiteConfigsAdminServiceInterface $service
Expand Down
7 changes: 0 additions & 7 deletions plugins/baser-core/src/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,6 @@ public function redirectIfIsRequireMaintenance()
if ($this->getRequest()->is('admin')) return;
if (BcUtil::isAdminUser()) return;

// TODO ucmitz 削除検討要
// CakePHP4 から requestAction がなくなっているので不要の可能性が高い
// cell 機能で呼び出された場合のスルーの処理を書いたら削除する
if (!empty($this->getRequest()->getParam('return')) && !empty($this->getRequest()->getParam('requested'))) {
return $this->getResponse();
}

$redirectUrl = '/maintenance';
if ($this->getRequest()->getAttribute('currentSite')->alias) {
$redirectUrl = '/' . $this->getRequest()->getAttribute('currentSite')->alias . $redirectUrl;
Expand Down
54 changes: 1 addition & 53 deletions plugins/baser-core/src/Controller/BcAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class BcAppController extends AppController
*
* @checked
* @note(value="マイルストーン2が終わってから確認する")
* @todo ucmitz 未確認
*/
public function beforeFilter(EventInterface $event)
{
Expand Down Expand Up @@ -166,27 +167,9 @@ public function beforeFilter(EventInterface $event)
public function beforeRender(EventInterface $event): void
{
parent::beforeRender($event);

// TODO ucmitz 未確認
return;
// テンプレートの拡張子
// RSSの場合、RequestHandlerのstartupで強制的に拡張子を.ctpに切り替えられてしまう為、
// beforeRenderでも再設定する仕様にした
$this->ext = Configure::read('BcApp.templateExt');

// モバイルでは、mobileHelper::afterLayout をフックしてSJISへの変換が必要だが、
// エラーが発生した場合には、afterLayoutでは、エラー用のビューを持ったviewクラスを取得できない。
// 原因は、エラーが発生する前のcontrollerがviewを登録してしまっている為。
// エラー時のview登録にフックする場所はここしかないのでここでviewの登録を削除する
if ($this->name === 'CakeError') {
ClassRegistry::removeObject('view');
$this->response->disableCache();
}

$this->__loadDataToView();
$this->set('isSSL', $this->request->is('ssl'));
$this->set('safeModeOn', ini_get('safe_mode'));
$this->set('baserVersion', BcUtil::getVersion());
}

/**
Expand Down Expand Up @@ -227,13 +210,6 @@ private function __loadDataToView()
$currentUserAuthPrefixes = explode(',', $this->Session->read('Auth.' . $sessionKey . '.UserGroup.auth_prefix'));
}
$this->set('currentUserAuthPrefixes', $currentUserAuthPrefixes);

/* 携帯用絵文字データの読込 */
// TODO 実装するかどうか検討する
/* if (isset($this->request->getParam('prefix')) && $this->request->getParam('prefix') == 'mobile' && !empty($this->EmojiData)) {
$emojiData = $this->EmojiData->find('all');
$this->set('emoji',$this->Emoji->EmojiData($emojiData));
} */
}

/**
Expand Down Expand Up @@ -628,34 +604,6 @@ protected function getUserModel()
return $this->BcAuth->authenticate['Form']['userModel'];
}

/**
* Redirects to given $url, after turning off $this->autoRender.
* Script execution is halted after the redirect.
*
* @param mixed $url A string or array-based URL pointing to another location within the app, or an absolute URL
* @param int $status Optional HTTP status code (eg: 404)
* @param bool $exit If true, exit() will be called after the redirect
* @return void if $exit = false. Terminates script if $exit = true
*/
public function redirect($url, int $status = 302): ?Response
{
// TODO 未確認のため代替措置
/* >>>
$url = addSessionId($url, true);
<<< */

// 管理システムでのURLの生成が CakePHP の標準仕様と違っていたので調整
// ※ Routing.admin を変更した場合
if (is_array($url)) {
if (!isset($url['admin']) && $this->request->getParam('prefix') === "Admin") {
$url['admin'] = true;
} elseif (isset($url['admin']) && !$url['admin']) {
unset($url['admin']);
}
}
return parent::redirect($url, $status);
}

/**
* Calls a controller's method from any location.
*
Expand Down
84 changes: 0 additions & 84 deletions plugins/baser-core/src/Middleware/BcAssetDispatcher.php

This file was deleted.

0 comments on commit 6af1265

Please sign in to comment.