赛亚人/selim

此软件包已被废弃,不再维护。没有推荐替代包。

selim

dev-feature/templating-implementation 2017-05-11 09:30 UTC

This package is auto-updated.

Last update: 2024-02-21 08:15:31 UTC


README

用于扫描Silverstripe-CMS安装的CLI工具

Build Status Code Climate Scrutinizer Code Quality Dependency Status

要求

  • composer
  • symfony/yaml: v2.6.1
  • pear/console_table: 1.2.1

安装

git clone https://github.com/Saiyan/selim.git
cd selim
composer install

或者

命令

php bin/selim.php  command [options] [arguments]

在您开始使用selim之前,您必须告诉它Silverstripe文件夹的位置。为此,您可以使用“find”和“add”两个命令。

find

php bin/selim.php find PATH

此命令搜索所有可能的silverstripe项目文件夹路径。之后,selim将提示您为每个找到的文件夹指定名称。

add

php bin/selim.php add <NAME> </PATH/TO/MYSITE/>

您站点的名称只是一个字符串,因此您可以稍后识别您的站点,而路径则需要指向您的silverstripe实例的“项目”文件夹。如果您在安装Silverstripe后不更改它,它应该是“mysite”文件夹。

rm

如果您想从配置中删除页面“NAME”,则只需使用

php bin/selim.php rm NAME

security

此命令读取站点“NAME”的版本并显示此版本已知的所有安全漏洞

php bin/selim.php security NAME

start

这是使用selim的主要命令。“start”列出您添加的所有站点及其属性。

php bin/selim.php start [OPTIONS]

选项

--html

要生成HTML并将其输出发送到HTML文件,可以这样做。

php bin/selim.php start --html > htmloutput.html
--template

默认

{% for page in pages %}

Site:            {{ page.getName }}
Root:            {{ page.getRootPath }}
Version:         {{ page.getVersion }}
DefaultAdmin:    {{ page.hasDefaultAdmin }}
EmailLogging:    {{ page.hasEmailLogging }}
EnvironmentType: {{ page.getEnvironmentType }}
Modules:         {% for module in page.getModules %}{{ module }} {% endfor %}

{% endfor %}

示例

 #List the names of all sites and the path to their _config.php
php bin/selim.php start --template=my_own_template.twig
--filter-name

如果您不想看到所有站点的列表,您可以使用--filter-name=参数过滤显示给您的结果。参数名之后的所有内容将被解释为正则表达式,并将与站点的名称进行比较。

一些示例

//list every site which starts with the string "site"
--filter-name=^site

//list every site which name ends with the string "site"
--filter-name=site$

//list only sites which have only characters in their name  
--filter-name=\w+
--filter-module
//list only sites with userforms module  
--filter-module=userforms
--filter-da
//list only sites which use Security::setDefaultAdmin   
--filter-da
--filter-env
//list only sites which have a specific environment type set (dev,live or test)   
--filter-env=dev

全局选项

--config=

当然,selim使用/生成其自己目录中的config.json文件。如果您想使用另一个配置文件,您可以使用--config参数

--config=/home/user/temp/my-selim-config-file

构建

为selim构建phar文件很简单。获取代码仓库。使用composer安装所有依赖。让Box完成所有工作。(http://box-project.org/

git clone https://github.com/Saiyan/selim.git selim-build
cd selim-build
composer global require "kherge/box:~2.0"
~/.composer/vendor/kherge/box/bin/box build -v
#Composer under Windows uses the following path 
#~\AppData\Roaming\Composer\vendor\kherge\box\bin\box