Linha de comando¶
Novo na versão 1.1.4.
O Galette agora oferece uma interface de linha de comando para gerenciar algumas tarefas. Ela pode ser acessada através do script bin/console no diretório raiz do Galette:
$ cd /var/www/html/galette
$ php bin/console
Galette v1.1.3
Usage:
command [options] [arguments]
Options:
-h, --help Display help for the given command. When no command is given display help for the list command
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Available commands:
completion Dump the shell completion script
help Display help for a command
list List commands
galette
galette:checks Check Galette requirements
galette:install Install Galette
galette:plugins:disable Disable Galette plugins
galette:plugins:enable Enable Galette plugins
galette:plugins:install-db Install Galette plugins database
galette:plugins:list List existing Galette plugins
Você pode obter ajuda para um comando específico usando o comando help:
Verificar¶
Esta verificação apenas atende aos pré-requisitos da Galette e não possui argumentos específicos.
Nota
Em alguns sistemas, a configuração do PHP pode ser diferente entre a interface de linha de comando (CLI) e a interface web; portanto, recomenda-se verificar os requisitos no script web galette_compat.php.
Instalar¶
Este comando obviamente instala o Galette :)
$ php bin/console help galette:install
Description:
Install Galette
Usage:
galette:install [options]
Options:
--dbtype=DBTYPE Database type (mysql, pgsql)
--dbhost=DBHOST Database hostname or IP address
--dbport=DBPORT Database port
--dbname=DBNAME Database schema name
--dbprefix[=DBPREFIX] Database table prefix
--dbuser=DBUSER Database user
--dbpass[=DBPASS] Database password
--admin=ADMIN Administrator username
--password=PASSWORD Administrator password
--ignore-config Ignore existing configuration file
-h, --help Display help for the given command. When no command is given display help for the list command
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Por padrão, o script verificará se já existe um arquivo de configuração; você pode ignorar isso usando a opção ``–ignore-config`.
As opções obrigatórias que não forem fornecidas durante a chamada do script serão solicitadas interativamente.
$ php bin/console galette:install -vvv
Welcome to Galette installer!
=============================
Using existing configuration for database type
Using existing configuration for database name
Using existing configuration for database prefix
Using existing configuration for database host
Using existing configuration for database port
Using existing configuration for database user
Database password:
>
Superadmin name [admin]:
>
Superadmin password:
>
------------- --------------
Database information
Type mysql
Name galette
Prefix galette_
Host localhost
Port 3306
User galette
Password ********
------------- --------------
Superadmin information
Name admin
Password *****
------------- --------------
[WARNING] Configuration file already exists and matches the provided database information.
All existing data will be lost if you continue.
Do you want to continue? (yes/no) [no]:
>
Super administrator password¶
Novo na versão 1.3.0.
The super administrator password is normally changed from the preferences, or from the advanced configuration page. Both require to be logged in, which is of little help the day the password is lost: the super administrator is not a member, so it cannot use the forgotten password form either.
This command is the way back in. It runs on the machine hosting Galette, and that access stands as the authentication.
$ php bin/console help galette:superadmin:password
Description:
Change the super administrator password
Usage:
galette:superadmin:password
Options:
-h, --help Display help for the given command. When no command is given display help for the list command
--silent Do not output any message
-q, --quiet Only errors are displayed. All other output is suppressed
-V, --version Display this application version
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
There is no option to pass the password with: it is only ever read from a hidden prompt, so that it does not end up in your shell history nor in the process list of the machine. It is asked twice, and the two answers must match.
$ php bin/console galette:superadmin:password
Change the super administrator password
=======================================
Super administrator login: admin
New password:
>
Confirm new password:
>
[OK] Super administrator password has been changed.
The login is displayed so you know which account you just changed, but the command does not touch it. Change it from the preferences, as usual.
The new password must satisfy the password rules of your instance, exactly as it would from the preferences page: too short a password, or one that does not reach the required strength, is refused and nothing is stored.
Nota
A terminal is needed. Called with --no-interaction, or with its input piped from a file or another command, the command refuses to run rather than silently doing nothing.
Aviso
The command is disabled when Galette runs in DEMO mode.
Comandos de plugins¶
Você pode listar os plugins existentes usando o comando galette:plugins:list:
$ php bin/console galette:plugins:list
Galette plugins
===============
* Galette Activities (1.0.3)
* Galette Auto (2.1.1)
* Galette Events (2.1.2)
* Galette Maps (2.1.0)
* Galette OAuth2 (3.0.0)
* plugin-fullcard (disabled)
* plugin-paypal (disabled)
* plugin-objectslend (disabled)
Os comandos disponíveis são:
galette:plugin:disable: desativa um plugingalette:plugin:enable: habilita um plugingalette:plugin:install-db: instala um banco de dados de plugins
Aviso
A instalação do banco de dados de plugins removerá todas as tabelas de plugins existentes!
Para cada comando relacionado a plugins, você pode especificar quais plugins deseja utilizar, usar a flag --all ou recorrer ao modo interativo:
$ php bin/console galette:plugins:disable
Galette plugins management
==========================
Which plugins do you want to select?
[* ] All plugins
[plugin-activities] Galette Activities
[plugin-auto ] Galette Auto
[plugin-events ] Galette Events
[plugin-maps ] Galette Maps
[plugin-oauth2 ] Galette OAuth2