baserCMS クラスリファレンス

PluginsAdminService extends PluginsService
in package
implements PluginsAdminServiceInterface

PluginsAdminService

Table of Contents

Interfaces

PluginsAdminServiceInterface
PluginsAdminServiceInterface

Properties

$Plugins  : PluginsTable|Table
Plugins Table
$Plugins  : PluginsTable

Methods

__construct()  : mixed
PluginsService constructor.
add()  : string
プラグインをアップロードする
attach()  : bool
プラグインを有効にする
attachAllFromIds()  : mixed
複数のIDからプラグインを有効化する
batch()  : bool
一括処理
changePriority()  : bool
優先度を変更する
detach()  : bool
プラグインを無効にする
detachAll()  : array<string|int, mixed>
プラグインを全て無効化する
get()  : EntityInterface
プラグインを取得する
getAvailableCoreVersion()  : bool|mixed|string
利用可能なコアの最新のバーションを取得
getAvailableCoreVersionInfo()  : array<string|int, mixed>
取得可能なコアのバージョン情報を取得
getByName()  : array<string|int, mixed>|EntityInterface|null
プラグイン名からプラグインエンティティを取得
getIndex()  : array<string|int, mixed>
プラグイン一覧を取得
getInstallStatusMessage()  : string
インストールに関するメッセージを取得する
getMarketPlugins()  : array<string|int, mixed>|mixed
baserマーケットのプラグイン一覧を取得する
getNamesById()  : array<string|int, mixed>
IDを指定して名前リストを取得する
getService()  : array<string|int, mixed>|mixed|object
Get Service
getUpdateLog()  : string
アップデートログを取得する
getVersion()  : mixed|string
バージョンを取得する
getViewVarsForInstall()  : array<string|int, mixed>
インストール画面用のデータを取得
getViewVarsForUpdate()  : array<string|int, mixed>
アップデート画面用のデータを取得
hasService()  : bool
Has Service
install()  : bool|null
プラグインをインストールする
isAvailableCoreUpdates()  : array<string|int, mixed>|mixed
利用可能なコアのバージョン群を取得
isRequireUpdate()  : bool
アップデートが必要がどうか
resetDb()  : void
データベースをリセットする
uninstall()  : void
プラグインを削除する
update()  : bool
プラグインをアップデートする
updateCore()  : mixed
BaserCoreをアップデートする
whichPhp()  : mixed|string
CLI版PHPのパスを取得する

Properties

Methods

__construct()

PluginsService constructor.

public __construct() : mixed
Tags
checked
noTodo
unitTest

add()

プラグインをアップロードする

public add(array<string|int, mixed> $postData) : string

POSTデータにて キーfile で Zipファイルをアップロードとすると、 /plugins/ 内に、Zipファイルを展開して配置する。

エラー

post_max_size を超えた場合、サーバーに設定されているサイズ制限を超えた場合、 Zipファイルの展開に失敗した場合は、Exception を発生。

リネーム処理

展開後のフォルダー名はアッパーキャメルケースにリネームする。 既に /plugins/ 内に同名のプラグインが存在する場合には、数字付きのディレクトリ名(PluginName2)にリネームする。 数字付きのディレクトリ名にリネームする際、プラグイン内の Plugin クラスの namespace もリネームする。

Parameters
$postData : array<string|int, mixed>
Tags
checked
noTodo
unitTest
throws
BcException
Return values
string

Zip を展開したフォルダ名

attach()

プラグインを有効にする

public attach(string $name) : bool
Parameters
$name : string
Tags
checked
noTodo
unitTest

PluginsTable::attach() のテストに委ねる

Return values
bool

attachAllFromIds()

複数のIDからプラグインを有効化する

public attachAllFromIds( $ids) : mixed
Parameters
$ids :
Tags
checked
noTodo
unitTest

batch()

一括処理

public batch(string $method, array<string|int, mixed> $ids) : bool
Parameters
$method : string
$ids : array<string|int, mixed>
Tags
checked
unitTest
noTodo
Return values
bool

changePriority()

優先度を変更する

public changePriority(int $id, int $offset[, array<string|int, mixed> $conditions = [] ]) : bool
Parameters
$id : int
$offset : int
$conditions : array<string|int, mixed> = []
Tags
checked
noTodo
unitTest
Return values
bool

detach()

プラグインを無効にする

public detach(string $name) : bool
Parameters
$name : string
Tags
checked
noTodo
unitTest
Return values
bool

detachAll()

プラグインを全て無効化する

public detachAll() : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

無効化したIDのリスト

get()

プラグインを取得する

public get(int $id) : EntityInterface
Parameters
$id : int
Tags
checked
noTodo
unitTest
Return values
EntityInterface

getAvailableCoreVersion()

利用可能なコアの最新のバーションを取得

public getAvailableCoreVersion() : bool|mixed|string
Tags
checked
noTodo
Return values
bool|mixed|string

getAvailableCoreVersionInfo()

取得可能なコアのバージョン情報を取得

public getAvailableCoreVersionInfo() : array<string|int, mixed>

BcApp.coreReleaseUrl で、Packagist よりリリース情報を取得し、 キャッシュ _bc_update_coreReleaseInfo として保存する。

アップデート対象バージョンの取得条件

  • 同じメジャーバージョンであること
  • 現在のパッケージののバージョンが開発版でないこと
  • アップデートバージョンが現在のパッケージのバージョンより大きいこと
Tags
checked
noTodo
Return values
array<string|int, mixed>
  • latest: 最新バージョン
  • versions: 取得可能なコアのバージョンリスト

getByName()

プラグイン名からプラグインエンティティを取得

public getByName(string $name) : array<string|int, mixed>|EntityInterface|null
Parameters
$name : string
Tags
checked
unitTest
noTodo
Return values
array<string|int, mixed>|EntityInterface|null

getIndex()

プラグイン一覧を取得

public getIndex(string $sortMode) : array<string|int, mixed>
Parameters
$sortMode : string
Tags
checked
unitTest
noTodo
Return values
array<string|int, mixed>

$plugins

getInstallStatusMessage()

インストールに関するメッセージを取得する

public getInstallStatusMessage(string $pluginName) : string
Parameters
$pluginName : string
Tags
checked
unitTest
noTodo
Return values
string

getMarketPlugins()

baserマーケットのプラグイン一覧を取得する

public getMarketPlugins() : array<string|int, mixed>|mixed
Tags
checked
unitTest
noTodo
Return values
array<string|int, mixed>|mixed

getNamesById()

IDを指定して名前リストを取得する

public getNamesById( $ids) : array<string|int, mixed>
Parameters
$ids :
Tags
checked
unitTest
noTodo
Return values
array<string|int, mixed>

getService()

Get Service

public getService( $service) : array<string|int, mixed>|mixed|object
Parameters
$service :
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>|mixed|object

getUpdateLog()

アップデートログを取得する

public getUpdateLog() : string
Tags
checked
noTodo
unitTest
Return values
string

getVersion()

バージョンを取得する

public getVersion( $name) : mixed|string
Parameters
$name :
Tags
checked
noTodo
unitTest
Return values
mixed|string

getViewVarsForInstall()

インストール画面用のデータを取得

public getViewVarsForInstall(EntityInterface $plugin) : array<string|int, mixed>
Parameters
$plugin : EntityInterface
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

getViewVarsForUpdate()

アップデート画面用のデータを取得

public getViewVarsForUpdate(EntityInterface $entity) : array<string|int, mixed>
Parameters
$entity : EntityInterface
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

hasService()

Has Service

public hasService( $service) : bool
Parameters
$service :
Tags
checked
noTodo
unitTest
Return values
bool

install()

プラグインをインストールする

public install(string $name[, bool $permission = true ][, string $connection = 'default' ]) : bool|null
Parameters
$name : string

プラグイン名

$permission : bool = true

アクセスルールを作るか作らないか

$connection : string = 'default'

test connection指定用

Tags
throws
Exception
checked
noTodo
unitTest
Return values
bool|null

isAvailableCoreUpdates()

利用可能なコアのバージョン群を取得

public isAvailableCoreUpdates() : array<string|int, mixed>|mixed
Tags
checked
noTodo
Return values
array<string|int, mixed>|mixed

isRequireUpdate()

アップデートが必要がどうか

public isRequireUpdate(string $programVersion, string $dbVersion, string $availableVersion, int|false $scriptNum) : bool
Parameters
$programVersion : string
$dbVersion : string
$availableVersion : string
$scriptNum : int|false
Tags
checked
noTodo
Return values
bool

resetDb()

データベースをリセットする

public resetDb(string $name[, string $connection = 'default' ]) : void
Parameters
$name : string
$connection : string = 'default'
Tags
throws
Exception
checked
noTodo
unitTest

uninstall()

プラグインを削除する

public uninstall(string $name[, array<string|int, mixed> $connection = 'default' ]) : void
Parameters
$name : string
$connection : array<string|int, mixed> = 'default'
Tags
checked
noTodo
unitTest

update()

プラグインをアップデートする

public update(string $pluginName[, string $connection = 'default' ]) : bool
Parameters
$pluginName : string

プラグイン名

$connection : string = 'default'

コネクション名

Tags
checked
noTodo
unitTest
Return values
bool

updateCore()

BaserCoreをアップデートする

public updateCore(string $currentVersion, string $targetVersion, string $php[, string $connection = 'default' ]) : mixed
Parameters
$currentVersion : string
$targetVersion : string
$php : string
$connection : string = 'default'
Tags
checked
noTodo

whichPhp()

CLI版PHPのパスを取得する

public whichPhp() : mixed|string
Tags
checked
noTodo
Return values
mixed|string

        
On this page

Search results