CakePHP
  • 文档
    • 书籍
    • API
    • 视频
    • 报告安全问题
    • 隐私政策
    • 徽标和商标
  • 商业解决方案
  • 纪念品
  • 公路旅行
  • 团队
  • 社区
    • 社区
    • 参与
    • 问题 (Github)
    • 面包店
    • 特色资源
    • 培训
    • 聚会
    • 我的 CakePHP
    • CakeFest
    • 时事通讯
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • 帮助和支持
    • 论坛
    • Stack Overflow
    • IRC
    • Slack
    • 付费支持
CakePHP

C Queue 2.x API

  • 项目
    • Queue
      • CakePHP
      • Chronos
      • Elastic Search
      • Queue
  • 版本
    • 2.x
      • 2.x
      • 1.x

命名空间

  • Cake\Queue
    • Command
    • Consumption
    • Job
    • Listener
    • Mailer
    • Model
    • Queue

插件 Class

Queue 的插件

命名空间: Cake\Queue

常量

  • list<string>
    VALID_HOOKS ¶
    ['bootstrap', 'console', 'middleware', 'routes', 'services', 'events']

    有效的钩子列表。

属性摘要

  • $bootstrapEnabled protected
    bool

    是否执行引导

  • $classPath protected
    string|null

    此插件的类路径。

  • $configPath protected
    string|null

    此插件的配置路径。

  • $consoleEnabled protected
    bool

    控制台中间件

  • $eventsEnabled protected
    bool

    是否加载事件

  • $middlewareEnabled protected
    bool

    启用中间件

  • $name protected
    string|null

    插件名称。

  • $path protected
    string|null

    此插件的路径。

  • $routesEnabled protected
    bool

    是否加载路由

  • $servicesEnabled protected
    bool

    注册容器服务

  • $templatePath protected
    string|null

    此插件的模板路径。

方法摘要

  • __construct() public

    构造函数

  • bootstrap() public

    加载 Queue 配置

  • checkHook() protected

    检查钩子名称是否有效

  • console() public

    为插件添加控制台命令。

  • disable() public

    禁用指定的钩子

  • enable() public

    启用指定的钩子

  • events() public

    注册应用程序事件。

  • getClassPath() public

    获取此插件配置的目录路径

  • getConfigPath() public

    获取此插件配置的目录路径

  • getName() public

    获取此插件的名称。

  • getPath() public

    获取此插件的目录路径

  • getTemplatePath() public

    获取此插件模板的目录路径

  • initialize() public

    从构造函数调用的初始化钩子。

  • isEnabled() public

    检查指定的钩子是否已启用

  • middleware() public

    为插件添加中间件。

  • routes() public

    为插件添加路由。

  • services() public

    将 DI 容器添加到 Worker 命令

方法详情

__construct() ¶ public

__construct(array<string, mixed> $options = [])

构造函数

参数
array<string, mixed> $options optional

选项

bootstrap() ¶ public

bootstrap(Cake\Core\PluginApplicationInterface $app): void

加载 Queue 配置

此方法的默认实现将在插件中包含 config/bootstrap.php(如果存在)。您可以覆盖此方法来替换该行为。

主机应用程序作为参数提供。这使您可以加载额外的插件依赖项,或附加事件。

参数
Cake\Core\PluginApplicationInterface $app

主机应用程序

返回
void

checkHook() ¶ protected

checkHook(string $hook): void

检查钩子名称是否有效

参数
string $hook

要检查的钩子名称

返回
void
抛出
InvalidArgumentException
在无效的钩子上

console() ¶ public

console(Cake\Console\CommandCollection $commands): Cake\Console\CommandCollection

为插件添加控制台命令。

参数
Cake\Console\CommandCollection $commands

要更新的命令集合

返回
Cake\Console\CommandCollection

disable() ¶ public

disable(string $hook): $this

禁用指定的钩子

参数
string $hook
返回
$this

enable() ¶ public

enable(string $hook): $this

启用指定的钩子

参数
string $hook
返回
$this

events() ¶ public

events(Cake\Event\EventManagerInterface $eventManager): Cake\Event\EventManagerInterface

注册应用程序事件。

参数
Cake\Event\EventManagerInterface $eventManager

要注册监听器的全局事件管理器

返回
Cake\Event\EventManagerInterface

getClassPath() ¶ public

getClassPath(): string

获取此插件配置的目录路径

返回
string

getConfigPath() ¶ public

getConfigPath(): string

获取此插件配置的目录路径

返回
string

getName() ¶ public

getName(): string

获取此插件的名称。

返回
string

getPath() ¶ public

getPath(): string

获取此插件的目录路径

返回
string

getTemplatePath() ¶ public

getTemplatePath(): string

获取此插件模板的目录路径

返回
string

initialize() ¶ public

initialize(): void

从构造函数调用的初始化钩子。

返回
void

isEnabled() ¶ public

isEnabled(string $hook): bool

检查指定的钩子是否已启用

参数
string $hook
返回
bool

middleware() ¶ public

middleware(Cake\Http\MiddlewareQueue $middlewareQueue): Cake\Http\MiddlewareQueue

为插件添加中间件。

参数
Cake\Http\MiddlewareQueue $middlewareQueue
返回
Cake\Http\MiddlewareQueue

routes() ¶ public

routes(Cake\Routing\RouteBuilder $routes): void

为插件添加路由。

此方法的默认实现将在插件中包含 config/routes.php(如果存在)。您可以覆盖此方法来替换该行为。

参数
Cake\Routing\RouteBuilder $routes
返回
void

services() ¶ public

services(Cake\Core\ContainerInterface $container): void

将 DI 容器添加到 Worker 命令

参数
Cake\Core\ContainerInterface $container

DI 容器

返回
void

属性详情

$bootstrapEnabled ¶ protected

是否执行引导

类型
bool

$classPath ¶ protected

此插件的类路径。

类型
string|null

$configPath ¶ protected

此插件的配置路径。

类型
string|null

$consoleEnabled ¶ protected

控制台中间件

类型
bool

$eventsEnabled ¶ protected

是否加载事件

类型
bool

$middlewareEnabled ¶ protected

启用中间件

类型
bool

$name ¶ protected

插件名称。

类型
string|null

$path ¶ protected

此插件的路径。

类型
string|null

$routesEnabled ¶ protected

是否加载路由

类型
bool

$servicesEnabled ¶ protected

注册容器服务

类型
bool

$templatePath ¶ protected

此插件的模板路径。

类型
string|null
OpenHub
Pingping
Linode
  • 商业解决方案
  • 展示
  • 文档
  • 书籍
  • API
  • 视频
  • 报告安全问题
  • 隐私政策
  • 徽标和商标
  • 社区
  • 参与
  • 问题 (Github)
  • 面包店
  • 特色资源
  • 培训
  • 聚会
  • 我的 CakePHP
  • CakeFest
  • 时事通讯
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • 帮助和支持
  • 论坛
  • Stack Overflow
  • IRC
  • Slack
  • 付费支持

使用 CakePHP API 文档 生成