neos / timeable-node-visibility
在特定时间启用和禁用节点。
9.0.0-beta13
2024-07-29 11:16 UTC
Requires
- php: ^8.2
- neos/contentrepository-core: 9.0.0-beta13
- neos/flow: *
- neos/neos: 9.0.0-beta13
This package is auto-updated.
Last update: 2024-09-06 22:49:50 UTC
README
注意
此存储库是 Neos 项目(更多了解请访问 www.neos.io)中包的一部分的只读 subsplit。
如果您想使用 Neos,请参阅 Neos 文档
文档
Timeable Node Visibility 包允许您在特定时间激活或停用节点。
将 Neos.TimeableNodeVisibility:Timeable
nodetype 混合类型作为超类型添加到您的 nodetype 定义中,将为您的 nodetype 启用此功能。混合类型将添加两个属性 enableAfterDateTime
和 disableAfterDateTime
以配置 nodetype 应何时启用或停用。
- nodetype 混合类型
Neos.TimeableNodeVisibility:Timeable
- 属性
enableAfterDateTime
(DateTime)disableAfterDateTime
(DateTime)
- 默认情况下,混合类型已经应用到以下 nodetype 上
Neos.Neos:Document
Neos.Neos:Content
后台异步作业(见:运行后台作业)会检查节点是否需要启用或停用,并将该操作作为命令在 ContentRepository 中执行。
安装包
您可以使用 composer 安装此包。
composer require neos/timeable-node-visibility
运行后台作业
有两种方式运行后台作业。每种方式都使用由包提供的专用命令。
1. 以 cronjob 的形式定期运行,每分钟/每五分钟。命令在每次运行后停止,需要重新在您喜欢的时段执行。
COMMAND: neos.timeablenodevisibility:timeablenodevisibility:execute USAGE: ./flow timeablenodevisibility:execute [<options>] OPTIONS: --content-repository contentRepository --quiet quiet
2. 作为守护进程运行,持续更长时间。命令将在给定时间 (--ttl) 内持续运行,并检查每个间隔 (--interval) 是否有新的节点需要启用或停用。
COMMAND: neos.timeablenodevisibility:timeablenodevisibility:rundaemon USAGE: ./flow timeablenodevisibility:rundaemon [<options>] OPTIONS: --content-repository The content repository identifier. (Default: 'default') --ttl The time to live for the daemon in seconds. Set to '0' for infinite. (Default: '900') --interval Interval in seconds, when the command has to get executed. (Default: '60') --quiet Set to false if you need a more verbose output. (Default: 'true')
贡献
如果您想为 Neos 贡献,请访问 https://github.com/neos/neos-development-collection - 这是开发存储库,所有拉取请求都应提交至此。