PluginsController
extends BcAdminAppController
in package
Class PluginsController
Table of Contents
Properties
- $Authentication : AuthenticationComponent
- $Authentication : AuthenticationComponent
- $BcMessage : BcMessageComponent
- $BcMessage : BcMessageComponent
- $_View : View
- View
Methods
- __construct() : void|ResponseInterface
- AppController constructor.
- _blackHoleCallback() : void
- Securityコンポーネントのブラックホールからのコールバック
- add() : mixed
- プラグインをアップロードする
- ajaxError() : void
- Ajax用のエラーを出力する
- beforeFilter() : Response|void
- Before Filter
- beforeRender() : Response|void|null
- Before Render
- detach() : mixed
- 無効化
- dispatchLayerEvent() : bool|Event
- イベントを発火
- get_core_update() : Response|null
- コアアップデートを取得する
- get_market_plugins() : void
- baserマーケットのプラグインデータを取得する
- getService() : array<string|int, mixed>|mixed|object
- Get Service
- hasService() : bool
- Has Service
- index() : mixed
- プラグインの一覧を表示する
- initialize() : void
- Initialize
- install() : Response|void|null
- インストール
- notFound() : void
- NOT FOUNDページを出力する
- redirectIfIsNotSameSite() : Response|void|null
- siteUrlや、cmsUrlと現在のURLが違う場合には、そちらのURLにリダイレクトを行う setting.php にて、cmsUrlとして、cmsUrlを定義した場合にはそちらを優先する
- redirectIfIsRequireMaintenance() : Response|void|null
- メンテナンス画面へのリダイレクトが必要な場合にリダイレクトする
- reset_db() : void
- データベースをリセットする
- setTitle() : void
- Set Title
- setupFrontView() : void
- フロント用のViewクラスをセットアップする
- uninstall() : Response|void
- アンインストール
- update() : void|Response
- プラグインアップデート実行
- update_core() : void|Response
- コアアップデート実行
- _checkReferer() : bool
- リファラチェックを行う
- loadViewConditions() : void
- 画面の情報をセッションから読み込む
- saveDblog() : EntityInterface
- データベースログを記録する
- saveViewConditions() : void
- 画面の情報をセッションに保存する
- setAdminTheme() : void
- 管理画面用テーマをセットする
- setHelp() : void
- Set Help
- setSearch() : void
- Set Search
- setViewConditions() : void
- 画面の情報をセットする
- __cleanupQueryParams() : void
- クエリーパラメーターの調整 環境によって?キーにamp;が付加されてしまうため
- __updateFirstAccess() : void
- 初回アクセスメッセージ用のフラグを更新する
- checkPermission() : bool
- アクセスルールの権限を確認する
Properties
$Authentication
public
AuthenticationComponent
$Authentication
$Authentication
public
AuthenticationComponent
$Authentication
$BcMessage
public
BcMessageComponent
$BcMessage
$BcMessage
public
BcMessageComponent
$BcMessage
$_View
View
protected
View
$_View
Methods
__construct()
AppController constructor.
public
__construct([ServerRequest|null $request = null ][, Response|null $response = null ][, string|null $name = null ][, EventManagerInterface|null $eventManager = null ][, ComponentRegistry|null $components = null ]) : void|ResponseInterface
Parameters
- $request : ServerRequest|null = null
- $response : Response|null = null
- $name : string|null = null
- $eventManager : EventManagerInterface|null = null
- $components : ComponentRegistry|null = null
Tags
Return values
void|ResponseInterface_blackHoleCallback()
Securityコンポーネントのブラックホールからのコールバック
public
_blackHoleCallback(string $err, mixed $exception) : void
フォーム改ざん対策・CSRF対策・SSL制限・HTTPメソッド制限などへの違反が原因で Securityコンポーネントに"ブラックホールされた"場合の動作を指定する
Parameters
- $err : string
-
エラーの種類
- $exception : mixed
Tags
add()
プラグインをアップロードする
public
add(PluginsAdminServiceInterface|PluginsAdminService $service) : mixed
POSTデータで、キーfile
を使って zipファイルを送信する。
送信が完了したら一覧画面にリダイレクトする。
Parameters
- $service : PluginsAdminServiceInterface|PluginsAdminService
Tags
ajaxError()
Ajax用のエラーを出力する
public
ajaxError([int $errorNo = 500 ][, mixed $message = '' ]) : void
since 5.0.5 このメソッドは非推奨です。
Parameters
- $errorNo : int = 500
-
エラーのステータスコード
- $message : mixed = ''
-
エラーメッセージ
Tags
beforeFilter()
Before Filter
public
beforeFilter(EventInterface $event) : Response|void
Parameters
- $event : EventInterface
-
An Event instance
Tags
Return values
Response|voidbeforeRender()
Before Render
public
beforeRender(EventInterface $event) : Response|void|null
Parameters
- $event : EventInterface
Tags
Return values
Response|void|nulldetach()
無効化
public
detach(PluginsServiceInterface $service, string $name) : mixed
Parameters
- $service : PluginsServiceInterface
- $name : string
-
プラグイン名
Tags
dispatchLayerEvent()
イベントを発火
public
dispatchLayerEvent(string $name[, array<string|int, mixed> $data = [] ][, mixed $options = [] ]) : bool|Event
Parameters
- $name : string
- $data : array<string|int, mixed> = []
- $options : mixed = []
Tags
Return values
bool|Eventget_core_update()
コアアップデートを取得する
public
get_core_update(PluginsAdminServiceInterface $service) : Response|null
Parameters
- $service : PluginsAdminServiceInterface
Tags
Return values
Response|nullget_market_plugins()
baserマーケットのプラグインデータを取得する
public
get_market_plugins(PluginsServiceInterface $service) : void
Parameters
- $service : PluginsServiceInterface
Tags
getService()
Get Service
public
getService(mixed $service) : array<string|int, mixed>|mixed|object
Parameters
- $service : mixed
Tags
Return values
array<string|int, mixed>|mixed|objecthasService()
Has Service
public
hasService(mixed $service) : bool
Parameters
- $service : mixed
Tags
Return values
boolindex()
プラグインの一覧を表示する
public
index(PluginsServiceInterface $service) : mixed
Parameters
- $service : PluginsServiceInterface
Tags
initialize()
Initialize
public
initialize() : void
Tags
install()
インストール
public
install(PluginsAdminServiceInterface $service, string $name) : Response|void|null
Parameters
- $service : PluginsAdminServiceInterface
- $name : string
-
プラグイン名
Tags
Return values
Response|void|nullnotFound()
NOT FOUNDページを出力する
public
notFound() : void
Tags
redirectIfIsNotSameSite()
siteUrlや、cmsUrlと現在のURLが違う場合には、そちらのURLにリダイレクトを行う setting.php にて、cmsUrlとして、cmsUrlを定義した場合にはそちらを優先する
public
redirectIfIsNotSameSite() : Response|void|null
Tags
Return values
Response|void|nullredirectIfIsRequireMaintenance()
メンテナンス画面へのリダイレクトが必要な場合にリダイレクトする
public
redirectIfIsRequireMaintenance() : Response|void|null
Tags
Return values
Response|void|nullreset_db()
データベースをリセットする
public
reset_db(PluginsServiceInterface $service, UsersServiceInterface $usersService) : void
Parameters
- $service : PluginsServiceInterface
- $usersService : UsersServiceInterface
Tags
setTitle()
Set Title
public
setTitle(string $title) : void
Parameters
- $title : string
Tags
setupFrontView()
フロント用のViewクラスをセットアップする
public
setupFrontView() : void
Tags
uninstall()
アンインストール
public
uninstall(PluginsServiceInterface $service, string $name) : Response|void
- プラグインのテーブルを削除
- プラグインのディレクトリを削除
Parameters
- $service : PluginsServiceInterface
- $name : string
-
プラグイン名
Tags
Return values
Response|voidupdate()
プラグインアップデート実行
public
update(PluginsAdminServiceInterface|PluginsAdminService $service[, string $name = '' ]) : void|Response
Parameters
- $service : PluginsAdminServiceInterface|PluginsAdminService
- $name : string = ''
Tags
Return values
void|Responseupdate_core()
コアアップデート実行
public
update_core(PluginsAdminServiceInterface|PluginsAdminService $service) : void|Response
Parameters
- $service : PluginsAdminServiceInterface|PluginsAdminService
Tags
Return values
void|Response_checkReferer()
リファラチェックを行う
protected
_checkReferer() : bool
Tags
Return values
boolloadViewConditions()
画面の情報をセッションから読み込む
protected
loadViewConditions([array<string|int, mixed> $targetModel = [] ][, array<string|int, mixed>|string $options = [] ]) : void
初期値が設定されている場合は初期値を設定した上で、セッションで上書きし、 ServerRequestに設定する。
Parameters
- $targetModel : array<string|int, mixed> = []
- $options : array<string|int, mixed>|string = []
-
オプション
-
default
: 読み出す初期値(初期値:[]) -
group
: 保存するグループ名(初期値:'') -
post
: POSTデータを保存するかどうか(初期値:true) -
get
: GETデータを保存するかどうか(初期値:false)
-
Tags
saveDblog()
データベースログを記録する
protected
saveDblog(string $message) : EntityInterface
Parameters
- $message : string
Tags
Return values
EntityInterfacesaveViewConditions()
画面の情報をセッションに保存する
protected
saveViewConditions([array<string|int, mixed> $targetModel = [] ][, array<string|int, mixed> $options = [] ]) : void
次のセッション名に保存。
- POSTデータ: BcApp.viewConditions.{$contentsName}.data.{$model}
- クエリパラメーター: BcApp.viewConditions.{$contentsName}.query
$contentsNameは次の形式となる。 {$controllerName}{$actionName}.{$group}
ただし、ページネーションにおいて、1ページ目はクエリパラメーターpage
を付けない仕様となっているため
page
は保存しない。
Parameters
- $targetModel : array<string|int, mixed> = []
- $options : array<string|int, mixed> = []
-
オプション
-
group
: 保存するグループ名(初期値:'') -
post
: POSTデータを保存するかどうか(初期値:true) -
get
: GETデータを保存するかどうか(初期値:false)
-
Tags
setAdminTheme()
管理画面用テーマをセットする
protected
setAdminTheme() : void
優先順位 BcSiteConfig::get('admin_theme') > Configure::read('BcApp.adminTheme')
Tags
setHelp()
Set Help
protected
setHelp(string $template) : void
Parameters
- $template : string
Tags
setSearch()
Set Search
protected
setSearch(string $template) : void
Parameters
- $template : string
Tags
setViewConditions()
画面の情報をセットする
protected
setViewConditions([array<string|int, mixed> $targetModel = [] ][, array<string|int, mixed> $options = [] ]) : void
POSTデータとクエリパラメーターをセッションに保存した上で、 指定されたデフォルト値も含めて ServerRequest に設定する。
$this->setViewConditions(['Content'], [
'group' => 'index',
'default' => [
'query' => ['limit' => 10],
'data' => ['title' => 'default']
],
'get' => true
]);
Parameters
- $targetModel : array<string|int, mixed> = []
-
ターゲットとなるモデル
- $options : array<string|int, mixed> = []
-
オプション
-
default
: 読み出す初期値(初期値:[]) -
group
: 保存するグループ名(初期値:'') -
post
: POSTデータを保存するかどうか(初期値:true) -
get
: GETデータを保存するかどうか(初期値:false)
-
Tags
__cleanupQueryParams()
クエリーパラメーターの調整 環境によって?キーにamp;が付加されてしまうため
private
__cleanupQueryParams() : void
Tags
__updateFirstAccess()
初回アクセスメッセージ用のフラグを更新する
private
__updateFirstAccess() : void
Tags
checkPermission()
アクセスルールの権限を確認する
private
checkPermission() : bool
現在アクセスしているURLについて権限があるかどうかを確認する。