mine/Helperfunctions.php

MineAdmin is committed to providing solutions for quickly building web applications Please view the LICENSE file that was distributed with this source code, For the full copyright and license information.

Thank you very much for using MineAdmin.

Functions

container()

container() : \Psr\Container\ContainerInterface

获取容器实例

Returns

\Psr\Container\ContainerInterface

redis()

redis() : \Hyperf\Redis\Redis

获取Redis实例

Throws

\Psr\Container\ContainerExceptionInterface
\Psr\Container\NotFoundExceptionInterface

Returns

\Hyperf\Redis\Redis

console()

console() : \Hyperf\Contract\StdoutLoggerInterface

获取控制台输出实例

Throws

\Psr\Container\ContainerExceptionInterface
\Psr\Container\NotFoundExceptionInterface

Returns

\Hyperf\Contract\StdoutLoggerInterface

logger()

logger(string  $name = 'Log') : \Psr\Log\LoggerInterface

获取日志实例

Parameters

string $name

Throws

\Psr\Container\ContainerExceptionInterface
\Psr\Container\NotFoundExceptionInterface

Returns

\Psr\Log\LoggerInterface

user()

user(string  $scene = 'default') : \Mine\Helper\LoginUser

获取当前登录用户实例

Parameters

string $scene

Returns

\Mine\Helper\LoginUser

format_size()

format_size(integer  $size) : string

格式化大小

Parameters

integer $size

Returns

string

t()

t(string  $key, array  $replace = array()) : string

多语言函数

Parameters

string $key
array $replace

Throws

\Psr\Container\ContainerExceptionInterface
\Psr\Container\NotFoundExceptionInterface

Returns

string

mine_collect()

mine_collect(null|mixed  $value = null) : \Mine\MineCollection

创建一个Mine的集合类

Parameters

null|mixed $value

Returns

\Mine\MineCollection

context_set()

context_set(string  $key,   $data) : boolean

设置上下文数据

Parameters

string $key
$data

Returns

boolean

context_get()

context_get(string  $key) : mixed

获取上下文数据

Parameters

string $key

Returns

mixed

app_verify()

app_verify(string  $scene = 'api') : \Mine\Helper\AppVerify

获取APP应用请求实例

Parameters

string $scene

Returns

\Mine\Helper\AppVerify

snowflake_id()

snowflake_id() : String

生成雪花ID

Throws

\Exception

Returns

String