From 2c228294fbe6e25984317eee4f23c8605c631b8c Mon Sep 17 00:00:00 2001 From: Yuri Salimovskiy Date: Fri, 10 Mar 2023 11:03:55 +0200 Subject: [PATCH 1/7] addon management CLI --- docs/cli/built-in-commands/addons.md | 53 +++++++++++++++++++++++ docs/toc_sections/_advanced_usage_toc.yml | 2 + 2 files changed, 55 insertions(+) create mode 100644 docs/cli/built-in-commands/addons.md diff --git a/docs/cli/built-in-commands/addons.md b/docs/cli/built-in-commands/addons.md new file mode 100644 index 000000000..80f9383f0 --- /dev/null +++ b/docs/cli/built-in-commands/addons.md @@ -0,0 +1,53 @@ +# Addons Management + +Set of CLI commands that allows listing, installing, updating and uninstalling add-ons + +[TOC] + +## `addons:list` + +List all add-on available in the system + + php eecli.php addons:list + +List add-ons that can be installed + + php eecli.php addons:list i +or + php eecli.php addons:list installed + +List add-ons that can be updated + + php eecli.php addons:list a +or + php eecli.php addons:list update-available + +List add-ons that can be uninstalled + + php eecli.php addons:list u +or + php eecli.php addons:list uninstalled + +## `addons:install` + +Installs an add-on. Add-on name can be selected (typed) in dialog or provided with `--addon` or `-a` option + + php eecli.php addons:install +or + php eecli.php addons:install --addon block_and_allow + +## `addons:update` + +Updates an add-on. Add-on name can be selected (typed) in dialog or provided with `--addon` or `-a` option + + php eecli.php addons:update +or + php eecli.php addons:update --addon block_and_allow + +## `addons:uninstall` + +Uninstalls an add-on. Add-on name can be selected (typed) in dialog or provided with `--addon` or `-a` option + + php eecli.php addons:uninstall +or + php eecli.php addons:uninstall --addon block_and_allow diff --git a/docs/toc_sections/_advanced_usage_toc.yml b/docs/toc_sections/_advanced_usage_toc.yml index 3b7bf38f7..b947e2972 100644 --- a/docs/toc_sections/_advanced_usage_toc.yml +++ b/docs/toc_sections/_advanced_usage_toc.yml @@ -638,6 +638,8 @@ href: cli/usage.md - name: Built In Commands items: + - name: Addon Management + href: cli/built-in-commands/addons.md - name: Addon Generator href: cli/built-in-commands/make-addon.md - name: Clear Cache From 9d13583f85b372ab6e0aa7ad3e222ffc5ae5cf19 Mon Sep 17 00:00:00 2001 From: Yuri Salimovskiy Date: Wed, 22 Mar 2023 11:27:11 +0200 Subject: [PATCH 2/7] addons:update --all --- docs/cli/built-in-commands/addons.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/cli/built-in-commands/addons.md b/docs/cli/built-in-commands/addons.md index 80f9383f0..a9b275ff7 100644 --- a/docs/cli/built-in-commands/addons.md +++ b/docs/cli/built-in-commands/addons.md @@ -38,11 +38,14 @@ or ## `addons:update` -Updates an add-on. Add-on name can be selected (typed) in dialog or provided with `--addon` or `-a` option +Updates an add-on. Add-on name can be selected (typed) in dialog or provided with `--addon` or `-a` option. +You can also set `--all` flag to run all add-on updates that are available. php eecli.php addons:update or php eecli.php addons:update --addon block_and_allow +or + php eecli.php addons:update --all ## `addons:uninstall` From a896d446968b5b0ed15d74c8ec6a322bc21e46b8 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Tue, 30 May 2023 09:56:19 -0700 Subject: [PATCH 3/7] Update add-on management docs --- docs/cli/built-in-commands/addons.md | 28 ++++++++++++++++------- docs/toc_sections/_advanced_usage_toc.yml | 26 ++++++++++----------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/docs/cli/built-in-commands/addons.md b/docs/cli/built-in-commands/addons.md index a9b275ff7..5ff6e2d95 100644 --- a/docs/cli/built-in-commands/addons.md +++ b/docs/cli/built-in-commands/addons.md @@ -1,39 +1,46 @@ -# Addons Management +# Add-on Management -Set of CLI commands that allows listing, installing, updating and uninstalling add-ons +Set of CLI commands that allows listing, installing, updating and uninstalling add-ons. [TOC] ## `addons:list` -List all add-on available in the system +Lists all add-ons available in the system. php eecli.php addons:list -List add-ons that can be installed +List add-ons that can be installed: php eecli.php addons:list i + or + php eecli.php addons:list installed -List add-ons that can be updated +List add-ons that have an update available: php eecli.php addons:list a + or + php eecli.php addons:list update-available List add-ons that can be uninstalled php eecli.php addons:list u or - php eecli.php addons:list uninstalled + + php eecli.php addons:list uninstalled: ## `addons:install` -Installs an add-on. Add-on name can be selected (typed) in dialog or provided with `--addon` or `-a` option +Installs an add-on. Add-on name can be selected (typed) in dialog or provided with `--addon` or `-a` option. php eecli.php addons:install + or + php eecli.php addons:install --addon block_and_allow ## `addons:update` @@ -42,15 +49,20 @@ Updates an add-on. Add-on name can be selected (typed) in dialog or provided wit You can also set `--all` flag to run all add-on updates that are available. php eecli.php addons:update + or + php eecli.php addons:update --addon block_and_allow + or + php eecli.php addons:update --all ## `addons:uninstall` -Uninstalls an add-on. Add-on name can be selected (typed) in dialog or provided with `--addon` or `-a` option +Uninstalls an add-on. Add-on name can be selected (typed) in dialog or provided with `--addon` or `-a` option. php eecli.php addons:uninstall or + php eecli.php addons:uninstall --addon block_and_allow diff --git a/docs/toc_sections/_advanced_usage_toc.yml b/docs/toc_sections/_advanced_usage_toc.yml index 9ba8c6209..f807f786d 100644 --- a/docs/toc_sections/_advanced_usage_toc.yml +++ b/docs/toc_sections/_advanced_usage_toc.yml @@ -70,7 +70,7 @@ - name: Find and Replace href: add-ons/pro-search/find-and-replace.md - name: Upgrade from Low Search - href: add-ons/pro-search/upgrade-from-low-search.md + href: add-ons/pro-search/upgrade-from-low-search.md - name: Development items: - name: Creating your own Filter @@ -98,7 +98,7 @@ - name: Fieldtype href: add-ons/pro-variables/fieldtype.md - name: Upgrade from Low Variables - href: add-ons/pro-variables/upgrade-from-low-variables.md + href: add-ons/pro-variables/upgrade-from-low-variables.md - name: Development items: - name: Fieldtype Bridge @@ -315,7 +315,7 @@ href: development/architecture.md - name: Services items: - - name: Addon Service + - name: Add-on Service href: development/services/addon.md - name: CP/Alert Service href: development/services/alert.md @@ -399,15 +399,15 @@ items: - name: Working with Models href: development/models/working-with-models.md - - name: Addon Action Model + - name: Add-on Action Model href: development/models/addon-action.md - - name: Addon Module Model + - name: Add-on Module Model href: development/models/addon-module.md - - name: Addon Extension Model + - name: Add-on Extension Model href: development/models/addon-extension.md - - name: Addon Fieldtype Model + - name: Add-on Fieldtype Model href: development/models/addon-fieldtype.md - - name: Addon Plugin Model + - name: Add-on Plugin Model href: development/models/addon-plugin.md - name: Category Model href: development/models/category.md @@ -630,7 +630,7 @@ href: development/v6-add-on-migration.md - name: Automated Upgrading href: development/automated-upgrading.md - + - name: Command Line Interface (CLI) items: - name: Introduction @@ -639,9 +639,9 @@ href: cli/usage.md - name: Built In Commands items: - - name: Addon Management + - name: Add-on Management href: cli/built-in-commands/addons.md - - name: Addon Generator + - name: Add-on Generator href: cli/built-in-commands/make-addon.md - name: Clear Cache href: cli/built-in-commands/cache-clear.md @@ -665,7 +665,7 @@ - name: Entry Cloning href: channels/entry_cloning.md - + - name: Front-end Content Management items: - name: Overview @@ -680,4 +680,4 @@ - name: Overview href: msm/overview.md - name: Variables and Parameter - href: msm/code.md \ No newline at end of file + href: msm/code.md From 00a3e375b87156e7c6011094952eacda1bd984b6 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Tue, 30 May 2023 11:22:28 -0700 Subject: [PATCH 4/7] Add backup:database documentation, as well as config and env command docs --- docs/cli/built-in-commands/addons.md | 4 +- docs/cli/built-in-commands/backup-database.md | 39 ++++++++++++ .../built-in-commands/config-management.md | 63 +++++++++++++++++++ docs/cli/built-in-commands/make-action.md | 2 +- docs/toc_sections/_advanced_usage_toc.yml | 4 ++ 5 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 docs/cli/built-in-commands/backup-database.md create mode 100644 docs/cli/built-in-commands/config-management.md diff --git a/docs/cli/built-in-commands/addons.md b/docs/cli/built-in-commands/addons.md index 5ff6e2d95..9f35a4fb4 100644 --- a/docs/cli/built-in-commands/addons.md +++ b/docs/cli/built-in-commands/addons.md @@ -26,12 +26,12 @@ or php eecli.php addons:list update-available -List add-ons that can be uninstalled +List add-ons that can be uninstalled: php eecli.php addons:list u or - php eecli.php addons:list uninstalled: + php eecli.php addons:list uninstalled ## `addons:install` diff --git a/docs/cli/built-in-commands/backup-database.md b/docs/cli/built-in-commands/backup-database.md new file mode 100644 index 000000000..309f0bd69 --- /dev/null +++ b/docs/cli/built-in-commands/backup-database.md @@ -0,0 +1,39 @@ +# backup:database + +Database backups + +## Options list: + + --relative_path= + -p + Path to database backup, relative to the cache folder + + --absolute_path= + -a + Absolute path to database backup + + --file_name= + -f + Name of sql file to be saved + + --speed= + -s + Speed of database backup (between 1-10). Setting a lower speed allows for more time between database commands. Default speed is 5. + + +## Examples: + +### Backup the database to the default path, at the default speed + + php eecli.php backup:database + + # Example backup path and filename: + system/user/cache/eedatabase_2023-05-30_18h05m39sUTC.sql + +### Backup the database to the to an absolute path, with a custom filename + + php eecli.php backup:database --file_name=deploy_backup.sql --absolute_path='/home/forge/backups' + +### Backup the database at a slow speed, to help with the potential to lock up the database. + + php eecli.php backup:database --speed=1 diff --git a/docs/cli/built-in-commands/config-management.md b/docs/cli/built-in-commands/config-management.md new file mode 100644 index 000000000..7800ec24c --- /dev/null +++ b/docs/cli/built-in-commands/config-management.md @@ -0,0 +1,63 @@ +# Config Management + +Set of CLI commands that updates the config file values, as well as ENV values. These are commonly use to provision a site or as part of a deploy script. + +[TOC] + +## `config:config` + +Updates values in the config.php file. + +### Options list + --config-variable= + -c + The config item to modify + + --value= + -v + The value to set the config item to + +### Examples + +Set system to offline: + + php eecli.php config:config -c is_system_on -v n + +Set system to online: + + php eecli.php config:config -c is_system_on -v y + + +Set debug to 1: + + php eecli.php config:config -c debug -v 1 + + +## `config:env` + +Updates values in the .env.php file. + +### Options list + --env-variable= + -e + The env item to set/modify + + --value= + -v + The value to set the env item to + +### Examples + +Set system to offline: + + php eecli.php config:env -e IS_SYSTEM_ON -v n + +Set system to online: + + php eecli.php config:env -e IS_SYSTEM_ON -v y + +Set EE_INSTALL_MODE to false + + php eecli.php config:env -e EE_INSTALL_MODE -v FALSE + + diff --git a/docs/cli/built-in-commands/make-action.md b/docs/cli/built-in-commands/make-action.md index 610c92a43..436c17f09 100644 --- a/docs/cli/built-in-commands/make-action.md +++ b/docs/cli/built-in-commands/make-action.md @@ -1,6 +1,6 @@ # make:action -Action Generator -- Creates a new action for an add-on +Action Generator -- Creates a new action for an add-on ## Options list: diff --git a/docs/toc_sections/_advanced_usage_toc.yml b/docs/toc_sections/_advanced_usage_toc.yml index f807f786d..38909588d 100644 --- a/docs/toc_sections/_advanced_usage_toc.yml +++ b/docs/toc_sections/_advanced_usage_toc.yml @@ -643,10 +643,14 @@ href: cli/built-in-commands/addons.md - name: Add-on Generator href: cli/built-in-commands/make-addon.md + - name: Backup Database + href: cli/built-in-commands/backup-database.md - name: Clear Cache href: cli/built-in-commands/cache-clear.md - name: Command Generator href: cli/built-in-commands/make-command.md + - name: Config Management + href: cli/built-in-commands/config-management.md - name: Migrations href: cli/built-in-commands/migrate.md - name: List From 300e0ef8363e49db5655c4b61df86f2447759725 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Fri, 2 Jun 2023 12:36:49 -0500 Subject: [PATCH 5/7] Update addon docs --- docs/cli/built-in-commands/addons.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cli/built-in-commands/addons.md b/docs/cli/built-in-commands/addons.md index 9f35a4fb4..0046ec5db 100644 --- a/docs/cli/built-in-commands/addons.md +++ b/docs/cli/built-in-commands/addons.md @@ -10,7 +10,7 @@ Lists all add-ons available in the system. php eecli.php addons:list -List add-ons that can be installed: +List add-ons that are currently installed: php eecli.php addons:list i @@ -26,7 +26,7 @@ or php eecli.php addons:list update-available -List add-ons that can be uninstalled: +List add-ons that can currently be uninstalled: php eecli.php addons:list u or From 8567734210105ac65190b19af5591cbfd8a856e9 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Fri, 2 Jun 2023 12:45:33 -0500 Subject: [PATCH 6/7] Update addons.md --- docs/cli/built-in-commands/addons.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cli/built-in-commands/addons.md b/docs/cli/built-in-commands/addons.md index 0046ec5db..9811f3c3f 100644 --- a/docs/cli/built-in-commands/addons.md +++ b/docs/cli/built-in-commands/addons.md @@ -26,7 +26,7 @@ or php eecli.php addons:list update-available -List add-ons that can currently be uninstalled: +List add-ons that are currently uninstalled: php eecli.php addons:list u or From 79a8fa1a2d6a41d5a821bd31a2e1338673ed20ef Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Fri, 2 Jun 2023 12:47:36 -0500 Subject: [PATCH 7/7] Update backup database wording on absolute path --- docs/cli/built-in-commands/backup-database.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cli/built-in-commands/backup-database.md b/docs/cli/built-in-commands/backup-database.md index 309f0bd69..dd90d3e27 100644 --- a/docs/cli/built-in-commands/backup-database.md +++ b/docs/cli/built-in-commands/backup-database.md @@ -10,7 +10,7 @@ Database backups --absolute_path= -a - Absolute path to database backup + Absolute path to the directory the database backup will be stored --file_name= -f