diff --git a/ru/contributing/contributing-to-the-book.md b/ru/contributing/contributing-to-the-book.md new file mode 100644 index 00000000..77b4fd0a --- /dev/null +++ b/ru/contributing/contributing-to-the-book.md @@ -0,0 +1,24 @@ + +*This page is a meeting point for translators. If you're one, consider yourself invited to edit this page and state constancy of your opinions and your work* + +# Guide for translators # +If you would like to help in the translation of this book, consider yourself welcome. Please, keep in mind the following guidelines: + +* Be gender neutral. +* Code and examples should not be translated. +* Use a formal style. We prefer a formal tone. + +# Generar traducidos todos los comandos disponibles # +*Over time, DrupalConsole programmers add more and more commands, so it's possible some available commands weren't present in this book if they are not added to the book as they are added. +In order to solve this problem, with a single command is possible to generate (already translated) all the .md files belonging to all the available commands* + +##Comand for generating documentation of all available commands currently## +If you have cloned in your local machine both projects, DrupalConsole and this book, you should execute the following command from a directory where Drupal were installed (or using the *--root* option): + +``` drupal generate:doc:gitbook --path=/path/directorio/drupal-console-book/en ``` + +(Please, check you have DrupalConsole correctly configured previously in your local machine in your desired language in order to get all the commands in your language. +[Files will be generated in the language you have DrupalConsole configured]) + +___ +*Please, in case of doubt, dissent or just if you want to make a proposal, please file an issue on this repository or edit directly this page.* diff --git a/ru/contributing/getting-the-project.md b/ru/contributing/getting-the-project.md index a3692d41..2cd21043 100644 --- a/ru/contributing/getting-the-project.md +++ b/ru/contributing/getting-the-project.md @@ -1,18 +1,38 @@ # Getting the project +The Drupal Console is a modular project using multiple repositories. + +Main repositories: +* [drupal/console](https://github.com/hechoendrupal/drupal-console) +* [drupal/console-core](https://github.com/hechoendrupal/drupal-console-core) +* [drupal/console-extend-plugin](https://github.com/hechoendrupal/drupal-console-extend-plugin) +* [drupal-console-dotenv](https://github.com/weknowinc/drupal-console-dotenv) + +Additional projects: +* [drupal/console-develop](https://github.com/weknowinc/drupal-console-develop) +* [drupal-console-yaml](https://github.com/weknowinc/drupal-console-yaml) + +Languages are also managed into separated repositories: +* [drupal-console-en](https://github.com/hechoendrupal/drupal-console-en) +* [drupal-console-es](https://github.com/hechoendrupal/drupal-console-es) + ## Fork -Fork your own copy of the [Console](https://github.com/hechoendrupal/drupal-console/fork) repository to your account +You should fork the repositories that you want to contribute. For this task you can use the github GUI. ## Clone -Get a copy of your recently cloned version of console in your machine. +You need to define a directory where you will clone the repositories. i.e. `/Users/username/drupal-console-code` ``` -$ git clone git@github.com:[your-git-user-here]/drupal-console.git +cd /Users/username/drupal-console-code +git clone git@github.com:[your-github-user-here]/drupal-console.git +git clone git@github.com:[your-github-user-here]/drupal-console-core.git +git clone git@github.com:[your-github-user-here]/drupal-console-en.git ``` ## Install dependencies -Now that you have cloned the project, you need to download dependencies via Composer. - +Now that you have cloned the repositories, you need to download dependencies using Composer. ``` -$ cd /path/to/drupal-console -$ composer install +cd /Users/username/drupal-console-code/[cloned-repository] +composer install ``` + +Read the next step to learn how to link and test these repositories into a Drupal site. diff --git a/ru/contributing/project-requirements.md b/ru/contributing/project-requirements.md index e183ddce..b7b85271 100644 --- a/ru/contributing/project-requirements.md +++ b/ru/contributing/project-requirements.md @@ -17,32 +17,5 @@ This installer script will simply check some php.ini settings, warn you if they You can run this terminal command to make Composer easily accessible, from anywhere on your system: ``` -$ mv composer.phar /usr/local/bin/composer -``` - -## Download Drupal 8 -The Drupal Console project only supports Drupal 8; which you will need to download and install locally. -### Download Drupal -``` -$ drupal site:new drupal8.dev 8.0.0 -$ cd drupal8.dev -``` -### Install Drupal using MySQL: -``` -$ drupal site:install standard --langcode=en --db-type=mysql --db-host=127.0.0.1 - --db-name=drupal --db-user=root --db-pass=root --db-port=3306 - --site-name="Drupal 8 Site Install" --site-mail=admin@example.com - --account-name=admin --account-mail=admin@example.com --account-pass=admin -n -``` -### Install Drupal using SQLite: -``` -$ drupal site:install standard --langcode=en --db-type=sqlite - --db-file=sites/default/files/.ht.sqlite --site-name="Drupal 8 Site Install" - --site-mail=admin@example.com --account-name=admin --account-mail=admin@example.com - --account-pass=admin -n -``` -### Start the PHP's built in server -``` -$ drupal server -``` -**NOTE:** Make sure you use your own user and database credentials when running `site:install` and never user root on production. In this example code, we accept all interactive questions, i.e. answering *“yes”* when passing the `-y` argument. +mv composer.phar /usr/local/bin/composer +``` \ No newline at end of file diff --git a/ru/contributing/running-the-project.md b/ru/contributing/running-the-project.md index ff4e73e1..56a25a94 100644 --- a/ru/contributing/running-the-project.md +++ b/ru/contributing/running-the-project.md @@ -1,16 +1,70 @@ # Running the project -After using Composer to download dependencies, you can run the project by executing: +In order to contribute you will need a working Drupal site linked to the packages you cloned and forked. +## Execute the automated process +DrupalConsole provides you with a command to take care of all this process for you. ``` -$ bin/drupal +drupal develop:contribute \ +--drupal=/path/to/drupal8.dev \ +--code=/Users/username/drupal-console-code/ ``` -## Create a symbolic link +The option `--drupal` is the directory where the new drupal site will be created and the option `--code` is the parent directory where the different DrupalConsole repositories were cloned. -You can run this command to easily access the Drupal Console from anywhere on your system: +> NOTES: +> +> You must execute `drupal init` before in order to copy the `~/.console/chain/develop-contribute.yml` on your local system. +> +> Make sure you have the latest version of DrupalConsole. Get the latest version of DrupalConsole by following the instructions as mentioned [here](https://github.com/hechoendrupal/drupal-console-launcher/blob/master/README.md). +## Execute all the steps manually +If you want to execute all the steps manually you can follow the instructions below: + +### Download Drupal and DrupalConsole +``` +composer create-project \ +drupal-composer/drupal-project:8.x-dev \ +drupal8.dev \ +--prefer-dist \ +--no-progress \ +--no-interaction +``` + +### Install Drupal using SQLite +``` +drupal site:install standard --db-type="sqlite" --no-interaction ``` -$ sudo ln -s /path/to/drupal-console/bin/drupal /usr/local/bin/drupal +> NOTE: You can install drupal using MySQL by executing the `site:install` command and answering the questions from the interactive mode or passing the required options. + +### Download the Drupal Console Develop package ``` +composer require drupal/console-develop --dev +``` + +### Create a symbolic link between Drupal and forked repositories +``` +drupal develop:create:symlinks \ +--code-directory=/Users/username/drupal-console-code/ +``` + +## Downloading additional Drupal Console language or packages + +If you want to contribute translating Drupal Console to [Spanish](https://github.com/hechoendrupal/drupal-console-es) you should: + +1.- Download it on the drupal site by executing the following command. + +``` +composer require drupal/console-es +``` + +2.- Fork and clone the repo to your local directory. + +3.- Execute the `develop:create:symlinks` again, to create symlinks including the recently added package. + +This applies for additional languages and packages i.e [drupal/console-yaml](https://github.com/weknowinc/drupal-console-yaml). + +## Wrapping up + +Now you can do the required changes and start contributing, commit you changes, push code to your forked repositories and create a Pull Request to the respective repository. -**NOTE:** The name `drupal` is just an alias you can name it anything you like. +Happy coding ... thanks for contributing to Drupal Console. diff --git a/ru/using/how-to-copy-configuration-files.md b/ru/using/how-to-copy-configuration-files.md index 5ce1aca9..39e57452 100644 --- a/ru/using/how-to-copy-configuration-files.md +++ b/ru/using/how-to-copy-configuration-files.md @@ -1,20 +1,27 @@ -# How to copy configuration files -The first task you should do after installing Drupal Console is to execute the `init` command. Executing this command will copy the project configurations files to your `~/.console/` directory. Overriding values on these copied files is how you can change DrupalConsole behaviour. +# Как скопировать конфигурационные файлы +Команда `init` должна быть запущена сразу после установки Drupal Console. `init` скопирует конфигурационные файлы на вашу машину после чего их можно изменять для конретного результата. - ``` - $ drupal init [--override] - ``` - -### Which files are copied when executing the `init` command. ``` - ~/.console/ - ├── aliases.yml - ├── chain - │   ├── quick-start.yml - │   └── sample.yml - ├── config.yml - ├── console.rc - ├── drupal.fish - └── sites -    └── sample.yml -``` \ No newline at end of file +drupal init [--override] +``` + +В интерактивном режиме первый вопрос `Выбирите папку для конфигурационных файлов:` и варианты ответов будут различаться в зависимости от того, в какой папке была запущена команда. + +При запуске Drupal Console из папки без Drupal +``` + Выбирите папку для конфигурационных файлов: + [0] /etc/console/ + [1] /Users/username/.console/ + > +``` + +При запуске Drupal Console из папки с сайтом Drupal +``` + Выбирите папку для конфигурационных файлов: + [0] /etc/console/ + [1] /Users/username/.console/ + [2] /path/to/drupal8.dev + > +``` + +Оставшиеся вопросы одинаковые вне зависимости от папки запуска. diff --git a/ru/using/how-to-download-install-and-serve-drupal8.md b/ru/using/how-to-download-install-and-serve-drupal8.md index 165931d0..2c2ced14 100644 --- a/ru/using/how-to-download-install-and-serve-drupal8.md +++ b/ru/using/how-to-download-install-and-serve-drupal8.md @@ -1,37 +1,44 @@ # How to download, install and serve Drupal 8 -The easiest way to try Drupal 8 in your local machine is by executing the `chain` command and pass the option `--file=~/.console/chain/quick-start.yml` as shown on the following example. +The easiest way to try Drupal 8 in your local machine is by executing the `quick:start` command. ``` -$ drupal chain --file=~/.console/chain/quick-start.yml +drupal quick:start ``` -> NOTE: You must execute `drupal init` before in order to copy the `~/.console/chain/quick-start.yml` on your system. +> NOTE: You must execute `drupal init` before in order to copy the `~/.console/chain/quick-start.yml` on your local system. The `chain` command helps you to automate command execution, allowing you to define an external YAML file containing the definition name, option and arguments of several commands and execute that list based on the sequence defined in the file. The content of the provided `~/.console/chain/quick-start.yml` file is: ``` +# How to use +# quick:start --directory="/path/to/drupal-project/" +# quick:start --directory="/path/to/drupal-project/" --profile="minimal" +# quick:start --repository="acquia/lightning-project:^8.1" --directory="/path/to/drupal-project/" --profile="lightning" +command: + name: quick:start + description: 'Download, install and serve a new Drupal project' +vars: + repository: + - drupal-composer/drupal-project:8.x-dev + - acquia/lightning-project + - acquia/reservoir-project + profile: standard commands: - - command: site:new + # Create Drupal project using DrupalComposer + - command: exec arguments: - directory: drupal8.dev - version: 8.0.2 - - command: site:install - options: - langcode: en - db-type: sqlite - db-file: sites/default/files/.ht.sqlite - site-name: 'Drupal 8 Quick Start' - site-mail: admin@example.com - account-name: admin - account-mail: admin@example.com - account-pass: admin - generate-inline: true + bin: composer create-project %{{repository}} %{{directory}} --prefer-dist --no-progress --no-interaction + # Install Drupal + - command: exec arguments: - profile: standard - - command: server + bin: drupal site:install %{{profile}} --root=%{{directory}} --db-type="sqlite" --no-interaction + # Start PHP built-in server + - command: exec + arguments: + bin: drupal server --root=%{{directory}}ß ``` The previous configuration will execute several commands, in this case commands that will download and install Drupal using SQLite, and finally start the PHP's built in server, now you only need to open your browser and point it to 127.0.0.1:8088. -You can duplicate or make changes on the provided YAML file, to add commands for download modules `module:download`, install modules `module:install` , import configurations `config:import` and restore your database `database:restore` or any other command provided by DrupalConsole or a custom command by your own module. +You can duplicate or make changes on the provided YAML file, to add commands for download modules `module:download`, install modules `module:install`, import configurations `config:import` and restore your database `database:restore` or any other command provided by DrupalConsole or a custom command by your own module. diff --git a/ru/using/how-to-use-drupal-console-in-a-multisite-installation.md b/ru/using/how-to-use-drupal-console-in-a-multisite-installation.md index d3ce4fe0..39711837 100644 --- a/ru/using/how-to-use-drupal-console-in-a-multisite-installation.md +++ b/ru/using/how-to-use-drupal-console-in-a-multisite-installation.md @@ -1,10 +1,11 @@ -# How to use Drupal Console in a multi-site installation - +# How to use Drupal Console in a multi-site installation + Drupal Console provides support for Drupal multi-site installations. This project provides the `multisite:debug` command to debug multi-site installations and the `--uri` option to interact with multi-site installations. - + ### How to list all known multi sites +Drupal Console uses the sites/sites.php file to determine the multi site configuration. See sites/example.site.php how to configure this file. ``` -$ drupal multisite:debug +drupal multisite:debug +---------------------+--------------------------------+ | Site | Directory | @@ -18,5 +19,6 @@ $ drupal multisite:debug ### How to execute a command against a multi-site installation ``` -$ drupal --uri=http://drupal8.multi.dev cr all +drupal --uri=http://drupal8.multi.dev cr all +drupal --uri=drupal8.multi.dev cr all ``` diff --git a/ru/using/how-to-use-drupal-console-in-a-remote-installation.md b/ru/using/how-to-use-drupal-console-in-a-remote-installation.md index 580071c9..73a674db 100644 --- a/ru/using/how-to-use-drupal-console-in-a-remote-installation.md +++ b/ru/using/how-to-use-drupal-console-in-a-remote-installation.md @@ -4,7 +4,7 @@ Drupal Console allows you to run commands on your local server but actually exec You can take advantage of this feature, using the `--target` option and passing the remote site name you want to interact with. ``` -$ drupal --target=sample.dev cr all +drupal --target=sample.dev cr all ``` Setting up your local computer to use a remote site requires a little configuration. @@ -27,7 +27,7 @@ application: ``` ### Edit specific site configuration -You can provide specific site configuration by duplicating the copied site file at `~/.console/sites/sample.yml` with a new same at `~/.console/sites/`. +You can provide specific site configuration by duplicating the copied site file at `~/.console/sites/sample.yml` with a new name at `~/.console/sites/`. ``` local: @@ -47,7 +47,7 @@ prod: ### Debug sites. You can list all known local and remote sites by executing the `site:debug` command. ``` -$ drupal site:debug +drupal site:debug +--------------------+-----------------+------------------------+ | Site | Host | Root | @@ -60,7 +60,7 @@ $ drupal site:debug You can show the site configuration details by passing the site name as argument to the `site:debug` command. ``` -$ drupal site:debug sample.dev +drupal site:debug sample.dev user: drupal port: 22 diff --git a/ru/using/project.md b/ru/using/project.md index 2a14bd2d..c0146852 100644 --- a/ru/using/project.md +++ b/ru/using/project.md @@ -1,23 +1,25 @@ -# Using the project +# Использование проекта -Drupal Console provides two types of commands, `stand alone` and `container aware` commands. +Два типа команд Drupal Console -**Stand alone commands:** -These commands can run outside of a Drupal 8 site root. - -**Container aware commands:** -These commands must be run within a Drupal 8 site root. +1. **Доступные глобально:** Команды, которые можено запустить из любой папки. +2. **Доступные отдельному сайту:** Команды, которые можено запустить только из папки с Drupal. + +### Запуск Drupal Console из любой папки + +Drupal Console можно запустить из любой папки используя опцию `--root` option to define the Drupal root to be use in the command execution. -### Executing Drupal Console outside a Drupal site root -You can run Drupal Console form any directory on your system by using the `--root` option to define the Drupal root to be use in the command execution. ``` -$ drupal --root=/var/www/drupal8.dev cr all +drupal --root=/var/www/drupal8.dev cr all ``` +**ВНИМАНИЕ:** При запуске Drupal Console из папки без Drupal без опции `--root` можно увидеть следующие сообщения: -**NOTE:** Possible messages when executing Drupal Console outside a Drupal site root and no `--root` option provided. - -When running the project outside of a Drupal 8 site root, the following message will be shown. +Сообщение при запуске Drupal Console из папки без Drupal +> Перейдите в папку с Drupal, чтобы увидеть список всех комманд > In order to list all of the available commands, you should run this inside a drupal root directory. -When running the project within of a Drupal 8 site root, but site is not yet installed, the following message will be shown. -> In order to list all of the available commands you should install drupal first. \ No newline at end of file +Сообщение при запуске Drupal Console из папки с неустановленным Drupal +> Установите Drupal, чтобы увидеть список всех комманд +> In order to list all of the available commands you should install drupal first. + +Помните, что вам все еще нужно уствновить Drupal Console при сайте следуя иструкции [2.1](../getting/composer.md) при установленном сайте Drupal 8 и глобальном пусковом файле Drupal Console по иструкции [2.2](../getting/launcher.md).