esimonetti/toothpaste

CLI 工具,用于分析、优化并为您提供 Sugar 系统的附加功能

安装: 939

依赖项: 0

建议者: 0

安全: 0

星标: 10

关注者: 6

分支: 18

公开问题: 1

类型:

0.2.4 2023-01-31 01:41 UTC

This package is auto-updated.

Last update: 2024-09-10 01:34:12 UTC


README

此工具提供“现状”且可能存在缺陷。请帮助我们创建并提供错误修复!

捐赠

如果您认为此软件有用,请考虑支持投入其中的工作,每月捐赠一定金额。谢谢!

描述

CLI 工具,用于分析、优化并为您提供 Sugar 系统的附加功能。由于它仅是一个 CLI 工具,因此无法在 Sugar Cloud 中执行。
此工具允许执行各种 CLI 动作,包括修复、有用的持续维护、识别可能的问题以及从 Sugar 安装中提取数据。

要求

  • Linux 或 Macintosh
  • PHP >= 7.1
  • Composer
  • 目前某些命令仅在 MySQL 上运行

安装

在您的安装目录内(例如:~/toothpaste),运行以下命令

composer require esimonetti/toothpaste dev-master

Composer 会下载 toothpaste 及其所有依赖项,使您准备就绪。
要能够执行本地命令,toothpaste 必须能够访问本地 Sugar 安装,位于同一服务器上,并且具有可用的 php CLI。

SugarDockerized 上的安装

由于从容器外部运行安装命令存在问题,以下安装步骤将进入 sugar-cron 容器以执行安装。

docker exec -it sugar-cron bash
mkdir ../toothpaste
cd ../toothpaste
composer require esimonetti/toothpaste dev-master
exit

SugarDockerized 上运行 toothpaste

要执行 toothpaste,请利用 SugarDockerized 提供的 bash 脚本。

./utilities/runcli.sh "cd ../toothpaste && ./vendor/bin/toothpaste list"

示例用法

列表

要显示可用命令的列表,请运行以下命令

./vendor/bin/toothpaste list

修复

要修复系统(位于 /var/www/html/sugar),请运行以下命令

./vendor/bin/toothpaste local:system:repair --instance /var/www/html/sugar
Toothpaste vX.X.X
Executing Repair command...
Entering /var/www/html/sugar...
Setting up instance...
Executing simple repair...
Clearing cache...
Executing basic instance warm-up...
Execution completed in 6.01 seconds.

维护模式开启/关闭

要为系统(位于 /var/www/html/sugar)设置维护模式开启/关闭,请运行以下命令

./vendor/bin/toothpaste local:maintenance:on --instance /var/www/html/sugar
Toothpaste vX.X.X
Setting maintenance mode on...
Entering /var/www/html/sugar...
Setting up instance...
The configuration setting maintenanceMode is now set to: on
The system is ONLY accessible via the UI by ADMINISTRATOR users
Execution completed in 0.19 seconds.
./vendor/bin/toothpaste local:maintenance:off --instance /var/www/html/sugar
Toothpaste vX.X.X
Setting maintenance mode off...
Entering /var/www/html/sugar...
Setting up instance...
The configuration setting maintenanceMode is now set to: off
The system is accessible via the UI by all users
Execution completed in 0.17 seconds.