g4b0/sitetree-walk
Composer 安装命令:
composer require g4b0/sitetree-walk
包简介
Walk through the SiteTree, and hooks implementors of SiteTreeWalkListener interface letting them doing things over each page.
README 文档
README
Implementation of the annoying task to walk through the entire SiteTree in order to do things over the pages.
Introduction
This module by itself does not do anything, it just iterate recursively through the SiteTree and hooks every implementor of SiteTreeWalkListener interface letting them doing things over each page.
Requirements
- SilverStripe >= 4.1 < 5.0
For 3.x installations refer to the 1.x version
Installation
Install the module through composer:
composer require --no-update g4b0/sitetree-walk
composer update --no-dev g4b0/sitetree-walk
Running the task.
Before running the task you need to implement your logic extending SiteTreeWalkListener interface. An example is provided
with SiteTreeWalkPrint, that simply prints out the page title. To enable it set its member variable SiteTreeWalkPrint::$enabled to true.
SiteTreeWalkListener implementor's run() method should return true for the processed pages, false for the excluded ones.
Following the output of the sample:
#sake dev/tasks/SiteTreeWalk "flush=all" Running Task SiteTreeWalk Following SiteTreeWalkListener Implementors will be executed: * SiteTreeWalkPrint Continue? [y|n]y Home Test Test 2 Test 3 Chi siamo Contattaci Pagina non trovata *** Excluded from processing Errore server *** Excluded from processing My Page ################################################ Traversed Pages: 9 Processed Pages: SiteTreeWalkPrint: 9 ################################################
统计信息
- 总下载量: 1.67k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-only
- 更新时间: 2018-05-10