protec/pot

此包已被废弃且不再维护。未建议替代包。

用于管理遍历文件夹中的文件并针对它们运行命令的工具。记录每个文件的文件名和运行时间戳到数据库中。

dev-master 2015-06-18 10:20 UTC

This package is not auto-updated.

Last update: 2022-04-12 09:19:46 UTC


README

    ______     _
    | ___ \   | |
    | |_/ /__ | |_
    |  __/ _ \| __|
    | | | (_) | |_
    \_|  \___/ \__|

用于管理遍历文件夹中的文件并针对它们运行命令的工具。记录每个文件的文件名和运行时间戳到数据库中。

可以通过传递命令行标志来运行,或者将从json配置文件中读取配置。

安装

克隆此存储库,或将以下内容添加到您的 composer.json 文件中:

"protec/pot": "dev-master"

用法

php pot.php [选项]

或者,将 pot.php 添加到您的 PATH 中,然后直接运行:

pot [选项]

选项

  --help          -h            Display help message
  --config <file> -c <file>     Use configuration from <file> instead of pot.json
  --db <database> -d <database> Override configuration file and use <database>
  --user <user>   -u <user>     Override configuration file and use database user <user>
  --pass <pass>   -p <pass>     Override configuration file and use database password <pass>
  --table <table> -t <table>    Override configuration file and use database password <pass>
  --files <dir>   -f <dir>      Override configuration file and use directory <dir> for transformations
  --kettle <dir>  -k <dir>      Override configuration file and use directory <dir> for kettle
  --version       -v            Display application version

配置

提供了一个示例 pot.json 文件(example.pot.json)。将此文件复制到您的项目目录中,并根据您的需求进行调整。如果不存在,将会创建使用 pot 的表格。要运行的命令必须尽可能完整,仅缺少要运行的文件(由 %s 表示),例如:

  • echo %s
  • chmod 775 %s
  • /usr/bin/kettle/pan.sh -file=%s

将运行列表中目录中的所有文件。建议给这些文件起一个数字文件名,因为 pot 会计算文件名的整数值以确定运行顺序。