Skip to content

Commit

Permalink
initial translation in yaf_application
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardolara committed Dec 6, 2024
1 parent 23975bc commit 752471c
Show file tree
Hide file tree
Showing 14 changed files with 1,282 additions and 0 deletions.
65 changes: 65 additions & 0 deletions reference/yaf/yaf_application/app.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: cf91547d76c5656ac2fb2c8e4e0efe47c52cf332 Maintainer: leonardolara Status: ready -->

<refentry xml:id="yaf-application.app" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Yaf_Application::app</refname>
<refpurpose>Obtém uma instância da aplicação</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <modifier>static</modifier> <type>mixed</type><methodname>Yaf_Application::app</methodname>
<void />
</methodsynopsis>
<para>
Obtém a instância de <classname>Yaf_Application</classname>.
Alternativamente, pode ser usado o método
<methodname>Yaf_Dispatcher::getApplication</methodname>.
</para>

</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Uma instância de Yaf_Application. Se nenhuma Yaf_Application foi inicializada anteriormente,
retorna &null;.
</para>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><methodname>Yaf_Dispatcher::getApplication</methodname></member>
</simplelist>
</refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
93 changes: 93 additions & 0 deletions reference/yaf/yaf_application/clearlasterror.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: a023d0b2477a34b665318759194f64e4eeaa2262 Maintainer: leonardolara Status: ready -->

<refentry xml:id="yaf-application.clearlasterror" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Yaf_Application::clearLastError</refname>
<refpurpose>Limpa a última informação de erro</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>Yaf_Application</type><methodname>Yaf_Application::clearLastError</methodname>
<void />
</methodsynopsis>
<para>

</para>



</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>

</para>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<example>
<title>Exemplo de <function>Yaf_Application::clearLastError</function></title>
<programlisting role="php">
<![CDATA[
<?php
function error_handler($errno, $errstr, $errfile, $errline) {
Yaf_Application::app()->clearLastError();
var_dump(Yaf_Application::app()->getLastErrorNo());
}
$config = array(
"application" => array(
"directory" => "/tmp/nao_existe",
"dispatcher" => array(
"throwException" => 0, // emite um erro ao invés de lançar uma exceção quando um erro ocorrer
),
),
);
$app = new Yaf_Application($config);
$app->getDispatcher()->setErrorHandler("error_handler", E_RECOVERABLE_ERROR);
$app->run();
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
int(0)
]]>
</screen>
</example>
</refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
174 changes: 174 additions & 0 deletions reference/yaf/yaf_application/construct.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 8bf3b3f0732d2b5c635f950e04e27a44b36f0cb0 Maintainer: leonardolara Status: ready -->

<refentry xml:id="yaf-application.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Yaf_Application::__construct</refname>
<refpurpose>Construtor de Yaf_Application</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<constructorsynopsis>
<modifier>public</modifier> <methodname>Yaf_Application::__construct</methodname>
<methodparam><type>mixed</type><parameter>config</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>envrion</parameter></methodparam>
</constructorsynopsis>
<para>
Instancia uma <classname>Yaf_Application</classname>.
</para>



</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>config</parameter></term>
<listitem>
<para>
Um caminho para o arquivo de configuração, ou um array de configurações.
</para>
<para>
Se for um arquivo de configuração, deve haver uma seção com o nome
definido por <link linkend="ini.yaf.environ">yaf.environ</link>, que
é "product" por padrão.
<note>
<para>
Se for usado um arquivo como o contêiner de configuração
da aplicação, pode-se usar <link
linkend="ini.yaf.cache-config">yaf.cache_config</link> para melhorar o
desempenho.
</para>
</note>
</para>
<para>
As entradas de configuração (e seus valores padrão) listadas abaixo:
<example>
<title>Um exemplo de arquivo INI de configuração</title>
<programlisting role="ini" xml:id="yaf.application.ini">
<![CDATA[
[product]
;este deve estar sempre definido e não tem valor padrão
application.directory=APPLICATION_PATH
;as configurações a seguir têm valor padrão, pode não ser necessário defini-las
application.library = APPLICATION_PATH . "/library"
application.dispatcher.throwException=1
application.dispatcher.catchException=1
application.baseUri=""
;o nome da extensão do script PHP
ap.ext=php
;o nome da extensão do modelo de visualização
ap.view.ext=phtml
ap.dispatcher.defaultModule=Index
ap.dispatcher.defaultController=Index
ap.dispatcher.defaultAction=index
;módulos definidos
ap.modules=Index
]]>
</programlisting>
</example>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>envrion</parameter></term>
<listitem>
<para>
Define que seção será carregada como a configuração final
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>

</para>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<example>
<title>Exemplo de <function>Yaf_Application::__construct</function></title>
<programlisting role="php">
<![CDATA[
<?php
defined('APPLICATION_PATH') // APPLICATION_PATH será usada no arquivo INI de configuração
|| define('APPLICATION_PATH', __DIR__));
$application = new Yaf_Application(APPLICATION_PATH.'/conf/application.ini');
$application->bootstrap()->run();
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
]]>
</screen>
</example>
<example>
<title>Exemplo de <function>Yaf_Application::__construct</function></title>
<programlisting role="php">
<![CDATA[
<?php
$config = array(
"application" => array(
"directory" => realpath(dirname(__FILE__)) . "/application",
),
);
/** Yaf_Application */
$application = new Yaf_Application($config);
$application->bootstrap()->run();
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
]]>
</screen>
</example>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><classname>Yaf_Config_Ini</classname></member>
</simplelist>
</refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
58 changes: 58 additions & 0 deletions reference/yaf/yaf_application/destruct.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: ecaa2146429a7f88de40dfce14718afc896b74c5 Maintainer: leonardolara Status: ready -->

<refentry xml:id="yaf-application.destruct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Yaf_Application::__destruct</refname>
<refpurpose>__destruct</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<destructorsynopsis>
<modifier>public</modifier> <methodname>Yaf_Application::__destruct</methodname>
<void />
</destructorsynopsis>
<para>

</para>



</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>

</para>
</refsect1>


</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
Loading

0 comments on commit 752471c

Please sign in to comment.