Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #989 from MatheusRibak/master
Browse files Browse the repository at this point in the history
Translations into Portuguese.
  • Loading branch information
sergeyklay committed Apr 29, 2017
2 parents a4621d3 + 4a68c0e commit b398610
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions pt/reference/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ Aplicações de Linha de Comando

Aplicações CLI são executadas pela linha de comando. Elas são usadas para criar tarefas agendadas (Cron Jobs), scripts, comandos úteis e muito mais.

Structure
Estrutura
---------
A minimal structure of a CLI application will look like this:
Uma estrutura mínima de um aplicativo CLI será semelhante a esta:

* app/config/config.php
* app/tasks/MainTask.php
* app/cli.php <-- main bootstrap file

Criando um Bootstrap
--------------------
Como nas aplicações MVC, o bootstrap também é disponível. Instead of the index.php bootstrapper in web applications, we use a cli.php file for bootstrapping the application.
Como nas aplicações MVC, o bootstrap também é disponível. Em vez do index.php bootstrapper em aplicações web, usamos um arquivo cli.php para inicializar o aplicativo.

Below is a sample bootstrap that is being used for this example.
Abaixo está um exemplo de bootstrap que está sendo usado para este exemplo.

.. code-block:: php
Expand Down Expand Up @@ -92,7 +92,7 @@ Below is a sample bootstrap that is being used for this example.
exit(255);
}
This piece of code can be run using:
Este pedaço de código pode ser executado usando:

.. code-block:: bash
Expand All @@ -102,9 +102,9 @@ This piece of code can be run using:
Tarefas (Tasks)
---------------
Tarefas são similares aos controladores. Any CLI application needs at least a MainTask and a mainAction and every task needs to have a mainAction which will run if no action is given explicitly.
Tarefas são similares aos controladores. Qualquer aplicativo CLI precisa de pelo menos um MainTask e um mainAction e cada tarefa precisa ter um mainAction que será executado se nenhuma ação é dada explicitamente.

Below is an example of the app/tasks/MainTask.php file:
Abaixo está um exemplo do arquivo app/tasks/MainTask.php:

.. code-block:: php
Expand All @@ -120,11 +120,11 @@ Below is an example of the app/tasks/MainTask.php file:
}
}
Processing action parameters
----------------------------
It's possible to pass parameters to actions, the code for this is already present in the sample bootstrap.
Processando parâmetros de ação
------------------------------
É possível passar parâmetros para ações, o código para isso já está presente no bootstrap de amostra.

If you run the application with the following parameters and action:
Se você executar o aplicativo com os seguintes parâmetros e ação:

.. code-block:: php
Expand Down Expand Up @@ -160,7 +160,7 @@ If you run the application with the following parameters and action:
}
}
We can then run the following command:
Podemos então executar o seguinte comando:

.. code-block:: bash
Expand All @@ -169,9 +169,9 @@ We can then run the following command:
hello world
best regards, universe
Running tasks in a chain
------------------------
It's also possible to run tasks in a chain if it's required. To accomplish this you must add the console itself to the DI:
Executando tarefas em cadeia
----------------------------
Também é possível executar tarefas em uma cadeia, se for necessário. Para fazer isso, você deve adicionar o próprio console ao DI:

.. code-block:: php
Expand All @@ -188,7 +188,7 @@ It's also possible to run tasks in a chain if it's required. To accomplish this
exit(255);
}
Then you can use the console inside of any task. Below is an example of a modified MainTask.php:
Então você pode usar o console dentro de qualquer tarefa. Abaixo está um exemplo de um MainTask.php modificado:

.. code-block:: php
Expand All @@ -215,5 +215,5 @@ Then you can use the console inside of any task. Below is an example of a modifi
echo "I will get printed too!" . PHP_EOL;
}
}
However, it's a better idea to extend :doc:`Phalcon\\Cli\\Task <../api/Phalcon_Cli_Task>` and implement this kind of logic there.
No entanto, é melhor ter uma extensão :doc:`Phalcon\\Cli\\Task <../api/Phalcon_Cli_Task>` e implementar esse tipo de lógica lá.
2 changes: 1 addition & 1 deletion pt/reference/wintools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Estas medidas irão guiá-lo através do processo de instalação da Phalcon Dev
Pré-requisitos
--------------

A extensão Phalcon PHP é necessário para executar Phalcon Tools. Se você não tiver instalado ainda, por favor consulte o: doc:`Instalação <install>` seção para obter instruções.
A extensão Phalcon PHP é necessário para executar Phalcon Tools. Se você não tiver instalado ainda, por favor consulte a seção: :doc:`Installation <install>` para obter instruções.

Download
--------
Expand Down

0 comments on commit b398610

Please sign in to comment.