kitzberger / cli-browser
通过CLI浏览内容元素和其他记录
1.0.6
2021-03-18 09:16 UTC
Requires
- typo3/cms-core: ^9.5 || ^10.4
README
此扩展提供了一个简单的方式来通过CLI浏览数据库记录。
命令
浏览内容元素
$ bin/typo3 database:browse-contents --help
Options:
--CType=CTYPE What CType are you looking for?
--list_type=LIST_TYPE What list_type are you looking for?
--url Render the URL?
--site Render the site?
--with-deleted Include deleted records?
--without-hidden Include hidden records?
--without-past Include past records?
--without-future Include future records?
--limit=LIMIT How many records? [default: 5]
--order-by=ORDER-BY Order by which column(s)? [default: "tstamp:DESC"]
--columns[=COLUMNS] Which columns should be display?
浏览记录
$ bin/typo3 database:browse-records --help
Options:
--table=TABLE What table are you looking for?
--type[=TYPE] What type are you looking for?
--site Render the site?
--group-by-pid Group by pid?
--with-deleted Include deleted records?
--without-hidden Include hidden records?
--without-past Include past records?
--without-future Include future records?
--limit=LIMIT How many records? [default: 5]
--order-by=ORDER-BY Order by which column(s)? [default: "tstamp:DESC"]
--columns[=COLUMNS] Which columns should be display?
示例
示例 1:查找5个新闻插件(包括URL)
bin/typo3 database:browse-contents --CType list --list_type news_pi1 --limit 5 --url
示例 2:查找5条新闻记录(包括网站标识符)
bin/typo3 database:browse-records --table tx_news_domain_model_news --limit 5 --site
示例 3:查找5条新闻记录(包括已删除)
如果您想将搜索扩展到已删除的记录,请使用选项
--with-deleted
bin/typo3 database:browse-records --table tx_news_domain_model_news --limit 5 --with-deleted
示例 4:查找5条新闻记录(不包含隐藏/未来/过去的记录)
如果您想从搜索中排除隐藏或定时记录,请使用以下选项
--without-hidden
--without-future
--without-past
bin/typo3 database:browse-records --table tx_news_domain_model_news --limit 5 --without-hidden --without-future --without-past
示例 5:指定列
如果您对打印的表格及其列不满意,可以使用选项--columns
根据需要指定列
- 对于包含太多文本并干扰美观ASCII表的列,可以指定最大长度。
- 对于包含Unix时间戳的列,可以将它们渲染为
date
或datetime
,甚至提供自定义格式。
bin/typo3 database:browse-records --table tx_news_domain_model_news --columns="uid,path_segment,title:40,crdate:date,tstamp:datetime:Y-m-d H:i"