\think\addonsService

Summary

Methods
Properties
Constants
install()
uninstall()
enable()
disable()
local()
refresh()
runSQL()
noconflict()
getGlobalFiles()
getAddonsBackupDir()
getExtraAddonsFile()
getBootstrapFile()
getTestdataFile()
getAddonDir()
check()
No public properties found
No constants found
getInfoIni()
getCheckDirs()
getSourceAssetsDir()
getDestAssetsDir()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

install()

install(string  $name, bool  $force = false) : bool

安装插件.

Parameters

string $name

插件名称

bool $force

是否覆盖

Throws

\think\Exception

Returns

bool —

uninstall()

uninstall(string  $name, bool  $force = false) : bool

卸载插件.

Parameters

string $name
bool $force

是否强制卸载

Throws

\think\Exception

Returns

bool —

enable()

enable(string  $name, bool  $force = false) : bool

启用.

Parameters

string $name

插件名称

bool $force

是否强制覆盖

Returns

bool —

disable()

disable(string  $name, bool  $force = false) : bool

禁用.

Parameters

string $name

插件名称

bool $force

是否强制禁用

Throws

\think\Exception

Returns

bool —

local()

local(string  $file) : mixed

离线安装

Parameters

string $file

插件压缩包

Returns

mixed —

refresh()

refresh() : bool

刷新插件缓存文件.

Throws

\think\Exception

Returns

bool —

runSQL()

runSQL(\think\addons\type  $name = '', mixed  $Dir = 'install') : bool

执行安装数据库脚本

Parameters

\think\addons\type $name

模块名(目录名)

mixed $Dir

Returns

bool —

noconflict()

noconflict(string  $name) : bool

是否有冲突

Parameters

string $name

插件名称

Throws

\think\addons\AddonException

Returns

bool —

getGlobalFiles()

getGlobalFiles(string  $name, bool  $onlyconflict = false) : array

获取插件在全局的文件

Parameters

string $name

插件名称

bool $onlyconflict

是否只返回冲突文件

Returns

array —

getAddonsBackupDir()

getAddonsBackupDir() : mixed

获取插件备份目录

Returns

mixed —

getExtraAddonsFile()

getExtraAddonsFile() : string

获取插件行为、路由配置文件

Returns

string —

getBootstrapFile()

getBootstrapFile(mixed  $name) : string

获取bootstrap.js路径

Parameters

mixed $name

Returns

string —

getTestdataFile()

getTestdataFile(mixed  $name) : string

获取testdata.sql路径

Parameters

mixed $name

Returns

string —

getAddonDir()

getAddonDir(mixed  $name) : mixed

获取指定插件的目录

Parameters

mixed $name

Returns

mixed —

check()

check(string  $name) : bool

检测插件是否完整.

Parameters

string $name

插件名称

Throws

\think\Exception

Returns

bool —

getInfoIni()

getInfoIni(\PhpZip\ZipFile  $zip) : array|false

匹配配置文件中info信息

Parameters

\PhpZip\ZipFile $zip

Throws

\think\Exception

Returns

array|false —

getCheckDirs()

getCheckDirs() : array

获取检测的全局文件夹目录

Returns

array —

getSourceAssetsDir()

getSourceAssetsDir(string  $name) : string

获取插件源资源文件夹

Parameters

string $name

插件名称

Returns

string —

getDestAssetsDir()

getDestAssetsDir(string  $name) : string

获取插件目标资源文件夹

Parameters

string $name

插件名称

Returns

string —