visualmind              Sun Nov 18 09:30:58 2001 EDT

  Added files:                 
    /phpdoc/ar/pear     about.xml pear.xml 
  Log:
  Translated to Arabic
  

Index: phpdoc/ar/pear/about.xml
+++ phpdoc/ar/pear/about.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
 <chapter id="pear.about">
  <title>��� PEAR</title>
  <simpara>   PEAR ���� ��� Malin Bakken,
   ���� �� 1999-11-21 (��� ���� ���� ����� PEAR ���� ��� ������
   �� ������).
  </simpara>

  <sect1 id="pear-whatis">
   <title>�� �� PEAR?</title>
   <simpara>    PEAR �� ���� ���� ��� ������� �������� �� ��� �� ������ ���� 
    ������� ������ TeX's CTAN � Perl's CPAN.
   </simpara>
   <para>    ����� �� PEAR ��:
    <itemizedlist>
     <listitem>
      <simpara>       ����� ����� ������� ������ ������� �������� ���� ���� �������
       ��������� �� �������� �������
      </simpara>
     </listitem>
     <listitem>
      <simpara>       ����� ����� ���� ��� ��  ���� ����� ������� �������� ��������
      </simpara>
     </listitem>
     <listitem>
      <simpara>       ������� �������� ���� ����� �������� ������ ������� ���� ����� 
������ ���������
      </simpara>
     </listitem>
     <listitem>
      <simpara>       ������� ������� ������ ��������� ������      </simpara>
     </listitem>
    </itemizedlist>
   </para>
  </sect1>
 </chapter>
<!-- 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
sgml-parent-document:nil
sgml-default-dtd-file:"../../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
-->

Index: phpdoc/ar/pear/pear.xml
+++ phpdoc/ar/pear/pear.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
 <reference id="pear.reference">

  <title>���� PEAR ������� </title>
  <titleabbrev>PEAR</titleabbrev>
  <partintro>
   <simpara>    ��� ����� ����� ��� ����� ������ ���� �������� PEAR 
    ����� �� ����� �� �� ��� ��.  �� ������� �� ���� �������<link 
linkend="language.oop">objects �
    classes</link>������� ���� .
   </simpara>
  </partintro>
  <refentry id="class.pear">
   <refnamediv>
    <refname>PEAR</refname>
    <refpurpose>PEAR base class</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <synopsis>require_once "PEAR.php";</synopsis>
    <synopsis>class <replaceable>classname</replaceable> extends 
<classname>PEAR</classname> { ... }</synopsis>
   </refsynopsisdiv>
   <refsect1>
    <title>�����</title>
    <simpara>     ����� PEAR base class ���� ����� ������ ������
     �� ���� ���� ������ PEAR (classes).  �� ������ �� ���� ���� ��� PEAR ������� 
, �� ��� ������� �� ���� ������� �������/������  (subclassing).
    </simpara>
    <para>     ������� �������� :
     <itemizedlist>
      <listitem>
       <simpara>��� �������"destructors"</simpara>
      </listitem>
      <listitem>
       <simpara>������ �����</simpara>
      </listitem>
     </itemizedlist>
    </para>
   </refsect1>
   <refsect1 id="pear.destructors">
    <title>PEAR "destructors"</title>
    <simpara>
     ��� �������<classname>PEAR</classname> �� ��� ���� �����     
<replaceable>ClassName</replaceable>, ������ �� ���� ����� ���
     ���� _<replaceable>ClassName</replaceable> (��� �����
     class ��������� ��� ������ ������� '_' ) ����� ��� ������
     ����� ����� �����.  ��� ������� �� ������ ����
     ������ �� ���� "delete" ���� object ���� ��������,
     �� ��� ���� PHP ������ �� ��� ������      ����� ����� PHP �� �������.  ���� <link
     linkend="example.pear.destructors">������</link>������</simpara>
    <para>
     <warning id="pear.destructors.warning">
      <title>���!</title>
      <para>       ��� ���� ��� ��������� ���� ����, ��� �� 
       ���� ����� ����� ���� ���� ������� ����  "=&amp; new" ����� � ��� 
:<programlisting role="php">$obj =&amp; new MyClass();
</programlisting>
      </para>
      <simpara>       ��� ������� "= new" ���, ������ ������ �� ����� ������� ������ � 
PEAR
       ��� ���� ���� �� ��� ������ ����� ������� ������� , ���� ��� ���������
       ����� ��� ��� �������.
      </simpara>
     </warning>
    </para>
   </refsect1>
   <refsect1 id="pear.error-handling">
    <title>������ ����� - PEAR</title>
    <simpara>     ��� PEAR base class ���� ����� ����� ������
     ����� ��� ���� ������� �� ��� ������ ������true/false �� ����� �������.  
     ����� ��� PEAR 'PEAR error' ���� ��� ���� ��� �� ���� ����
     <classname>PEAR_Error</classname>, �� ���� ���� ��� ���� 
   <classname>PEAR_Error</classname>.
    </simpara>
    <simpara>     ���� �� ����� ����� ����� PEAR 'PEAR's errors' ��� �� ���
     �� ���� �������� ��� ������� ��� ��� �� ��������, ��� �� ���� �� ������
     ������ ������� ���� �� ������ ������ 
     ��� ��� ��� �������.  ��� ���� �� ������ ������ ������� ���� ����,
     ����� �� ��� ��� ������ ��� �� ���� HTML (��� ���� ������
     WML �� �� �� ����� XML).
    </simpara>
    <simpara>     ���� �� ���� ���� ����� 'error object' ����� ����� �� ������� �����
     ��� ������, ��� ����� ����� ���,      
�������, �� ����� ����� �� ���� ����  PHP 
     <function>trigger_error</function> , ��� ������ ����������,
     �� �� �� ���� �����.  ��� ���� ���� ������ �� ������� 
     <classname>PEAR_Error</classname>, ��� �� ��������
     ��������, ������� �� ��� ���������� ���������� �������
     �������� �� �� ���� ���� ��� ���
     <classname>PEAR</classname>.  ����<link
     linkend="example.pear.error1">����� PEAR error</link> ����� ���
     ��� ������ � ����� ���� <classname>PEAR_Error</classname>  ����� �� 
��������.</simpara>
   </refsect1>
   <refsect1>
    <title>�������</title>
    <para>     ������ ������ ���� ��� ������ PEAR's "poor man's kinda
     emulated destructors" ������ ��� ���� 
     CLASS ������ ������� ���, ������ ���� ������ ��� ������ �
     ������� ��� ����� �� ������� :
     <example id="example.pear.destructors">
      <title>PEAR: emulated destructors</title>
      <programlisting role="php">require_once "PEAR.php";

class FileContainer extends PEAR
{
    var $file = '';
    var $contents = '';
    var $modified = 0;
    
    function FileContainer($file)
    {
        $this->PEAR(); // ������� ������� ����
        $fp = fopen($file, "r");
        if (!is_resource($fp)) {
            return;
        }
        while (!empty($data = fread($fp, 2048))) {
            $this->contents .= $data;
        }
        fclose($fp);
    }

    function append($str)
    {
        $this->contents .= $str;
        $this->modified++;
    }

    // ����� ������� ������� 
    // �������� ���� ����� �� �������.
    function _FileContainer()
    {
        if ($this->modified) {
            $fp = fopen($this->file, "w");
            if (!is_resource($fp)) {
                return;
            }
            fwrite($fp, $this->contents);
            fclose($fp);
        }
    }
}

$fileobj =&amp; new FileContainer("testfile");
$fileobj->append("���� ��� ������� �� ����� �� ����� �������\n");

// ����� ����� ����� ����� ��������
// ������� "destructor" ������ .
// �������� ���� �������� �� ����� ������

</programlisting>
     </example>
     <note>
      <simpara>       ������� PEAR "destructors" ������ 
       (<function>register_shutdown_function</function>), ��� ������
       �� ���� ��� �� ������ �� ��� ����� ������ PHP ����� ��� ����
       ���.  ���� ��� �� ��� ���� �� ��� ������� ���� ���
       ����� ������ PHP ���� ��� "command-line mode" .      </simpara>
      <simpara>
       ���� � ���� �����<link
       linkend="pear.destructors.warning">�����!</link> ��� �����
       ��� ����� ������ ��� ���� ������� �������.
      </simpara>
     </note>
    </para>
    <simpara>     ������� ������� ������ ��� ������ �� ������� ���� ������ ����� �� 
���� PEAR .</simpara>
    <para>
     <example id="example.pear.error1">
      <title>PEAR error example (1)</title>
      <programlisting role="php">function mysockopen($host = "localhost", $port = 8090)
{
    $fp = fsockopen($host, $port, $errno, $errstr);
    if (!is_resource($fp)) {
        return new PEAR_Error($errstr, $errno);
    }
    return $fp;
}

$sock = mysockopen();
if (PEAR::isError($sock)) {
    print "mysockopen error: ".$sock->getMessage()."&lt;BR>\n"
}
</programlisting>
     </example>
    </para>
    <simpara>
     ��� ������ ���� ����� ������ <function>fsockopen</function>     ������ ����� 
������� (�� ����) �� ����
     fsockopen �� ���� ���� "PEAR error".  ���� ��
     <function>PEAR::isError</function> ������� ������ �� ��� ���� ������
     ������� �� ��� �� ��� PEAR.
    </simpara>
    <simpara>     ����� PEAR_Error �� ��� ������ �� ������
     ����� ���� ����� ����� ���� ������ ��������
     (�������).  ���� �� ������� ���������.
    </simpara>
    <simpara>     �� ������ ������ ���� ��� ������ ������ ����� ���������� :
    </simpara>
    <para>
     <example id="example.pear.error2">
      <title>PEAR error example (2)</title>
      <programlisting role="php">class TCP_Socket extends PEAR
{
    var $sock;

    function TCP_Socket()
    {
        $this->PEAR();
    }

    function connect($host, $port)
    {
        $sock = fsockopen($host, $port, $errno, $errstr);
        if (!is_resource($sock)) {
            return $this->raiseError($errstr, $errno);
        }
    }
}

$sock = new TCP_Socket;
$sock->setErrorHandling(PEAR_ERROR_DIE);
$sock->connect("localhost", 8090);
print "�������� ����� ���!&lt;BR>\n";
</programlisting>
     </example>
    </para>
    <simpara>     ���, ���� ����� ����� ��������� ��������
     <constant>PEAR_ERROR_DIE</constant>, �� ���� �� ����
     �� ����� ��� �� "raiseError" (������ ������), 
���� "raiseError" ������� ���������� ������ 
     ��� ���� fsockopen .
    </simpara>
   </refsect1>
   <refsect1>
    <title>��������� ��������� - ������� ����</title>
    <para>     ������ ����� PEAR ��� ��������� ������  ������ ���������� ������
     , ������ �������� ��������� �� ���� ��������� "destructors".  
     �� ��������� ��������� �������� ���� PEAR ����� ����� ���� �� ��� 
     <literal>_PEAR_</literal>.    </para>
    <para>
     <variablelist>
      <varlistentry>
       <term>$_PEAR_default_error_mode</term>
       <listitem>
        <simpara>        ��� �� ���� ����� ������� ����� �� ����, ��� ������� ��� 
������
         .  ����� ��     <constant>PEAR_ERROR_RETURN</constant>,
         <constant>PEAR_ERROR_PRINT</constant>,
         <constant>PEAR_ERROR_TRIGGER</constant>,
         <constant>PEAR_ERROR_DIE</constant> ��  
<constant>PEAR_ERROR_CALLBACK</constant>.
        </simpara>
        <para>   �� ���� ���� ��� ������� ������ , �� ��������   
<function>PEAR::setErrorHandling</function> ������ ����
         ��� �� ������:
         <informalexample>
          <programlisting role="php">PEAR::setErrorHandling(PEAR_ERROR_DIE);
</programlisting>
         </informalexample>
        </para>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>$_PEAR_default_error_options</term>
       <listitem>
        <simpara>
         ��� �� ������� �������  <constant>PEAR_ERROR_TRIGGER</constant>,
         ��� �� ����� ����� (���� �� 
         <constant>E_USER_NOTICE</constant>,
         <constant>E_USER_WARNING</constant> ��  <constant>E_USER_ERROR</constant>).
        </simpara>
        <para>   �� ���� ���� ��� ������� ������ , �� ��������   
<function>PEAR::setErrorHandling</function> ������ ����
         ��� �� ������:
         <informalexample>
          <programlisting role="php">PEAR::setErrorHandling(PEAR_ERROR_TRIGGER, 
E_USER_ERROR);
</programlisting>
         </informalexample>
        </para>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>$_PEAR_default_error_callback</term>
       <listitem>
        <simpara>
 ���� <replaceable>options</replaceable> ������
         ����� ���� �� ��� ������ ����� �� 
         <constant>PEAR_ERROR_CALLBACK</constant>, ���� ���
         ������� ������ ����� ������.  ��� ���� ���
         ������ ����� ����� ����� ������ ������� ���� ����� ���� ������ call back 
function  ��� ����
         .  ���� 
         ���� ���� ����, ������� ��� ������ ��
         ���� �� ������ index 0 ������ ���� �� ������ index 1 ����
         �����.
        </simpara>
        <para>   ��� ����,       �� ���� ���� ��� ������� ������ , �� ��������   
<function>PEAR::setErrorHandling</function> ������ ����
         ��� �� ������:
         <informalexample>
          <programlisting role="php">PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 
"my_error_handler");
</programlisting>
         </informalexample>
        </para>
        <para>   ���� ��� ���� ������ ������� �������
         ���� ����� ���� ������ ��� ����:
         <informalexample>
          <programlisting role="php">PEAR::setErrorMode(PEAR_ERROR_CALLBACK, 
"my_function_handler");
do_some_stuff();
PEAR::setErrorMode(PEAR_ERROR_DIE);
do_some_critical_stuff();
PEAR::setErrorMode(PEAR_ERROR_CALLBACK);
// ���� ���� �������� 
// my_function_handler 
// ��� ����</programlisting>
         </informalexample>
        </para>
       </listitem>
      </varlistentry>
     </variablelist>
    </para>
   </refsect1>
   <refsect1>
    <title>���������</title>
    <refsect2 id="function.pear.pear">
     <title>PEAR::PEAR</title>
     <funcsynopsis>
      <funcprototype>
       <funcdef>PEAR()</funcdef>
       <void/>
      </funcprototype>
     </funcsynopsis>
     <para>      ��� �� ������� PEAR class constructor.  ���� ��������
      �� �� ��� "class" ���� ������� �� PEAR class.
      <example>
       <title>���� "PEAR Class Constructor"</title>
       <programlisting role="php">class MyClass extends PEAR
{
    var $foo, $bar;
    function MyClass($foo, $bar)
    {
        $this->PEAR();
        $this->foo = $foo;
        $this->bar = $bar;
    }
}
</programlisting>
      </example>
     </para>
    </refsect2>
    <refsect2 id="function.pear.-pear">
     <title>PEAR::_PEAR</title>
     <funcsynopsis>
      <funcprototype>
       <funcdef>_PEAR()</funcdef>
       <void/>
      </funcprototype>
     </funcsynopsis>
     <para>      ��� ������� ������ ���� ��� ������� (shutdown request).
     </para>
    </refsect2>
   </refsect1>
  </refentry>
  <refentry id="class.pear-error">
   <refnamediv>
    <refname>PEAR_Error</refname>
    <refpurpose>PEAR error mechanism base class</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <synopsis>$err = new <classname>PEAR_Error</classname>($msg);</synopsis>
   </refsynopsisdiv>
   <refsect1>
    <title>������ �����  Error Modes</title>
    <para>     ���� ����� ���� ����� ���� ����� ����� �  
     ���� ������ ��� ��� �������:
     <variablelist id="pear.error-modes">
      <varlistentry id="constant.pear-error-return">
       <term>PEAR_ERROR_RETURN</term>
       <listitem>
        <simpara>        ��� ��� ���� ����� �����, �� ���� �� ��� ���.  </simpara>
       </listitem>
      </varlistentry>
      <varlistentry id="constant.pear-error-print">
       <term>PEAR_ERROR_PRINT</term>
       <listitem>
        <simpara>        ���� ����� ����� �� �������.  
         �� ��� ����� �������.
        </simpara>
       </listitem>
      </varlistentry>
      <varlistentry id="constant.pear-error-trigger">
       <term>PEAR_ERROR_TRIGGER</term>
       <listitem>
        <simpara>
�������� ���� PHP <function>trigger_error</function> ��� �������
         ���� ��� ����� �� ����.  ��� ����� ������� ���
         ���� ����� ����� ����� �� �� ��� ���� ����
         error severity = E_USER_ERROR.
        </simpara>
       </listitem>
      </varlistentry>
      <varlistentry id="constant.pear-error-die">
       <term>PEAR_ERROR_DIE</term>
       <listitem>
        <simpara>        ���� ����� ��� �����.  
         ��� ����� ������� �������� .
        </simpara>
       </listitem>
      </varlistentry>
      <varlistentry id="constant.pear-error-callback">
       <term>PEAR_ERROR_CALLBACK</term>
       <listitem>
        <simpara>        ������ ���� ������ �� ����� ������� �����.
         ��� ����� �������.
        </simpara>
       </listitem>
      </varlistentry>
     </variablelist>
    </para>
   </refsect1>
   <refsect1>
    <title>�������</title>
    <simpara></simpara>
   </refsect1>
   <refsect1>
    <title>���������</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef><function>PEAR_Error::PEAR_Error</function></funcdef>
      <paramdef>
       <parameter><optional>message</optional></parameter>
       <parameter><optional>code</optional></parameter>
       <parameter><optional>mode</optional></parameter>
       <parameter><optional>options</optional></parameter>
       <parameter><optional>userinfo</optional></parameter>
      </paramdef>
     </funcprototype>
    </funcsynopsis>
    <refsect2>
     <title>�����</title>
     <para>      ����� PEAR_Error constructor.  ��������:
      <variablelist>
       <varlistentry>
        <term>message</term>
        <listitem>
         <simpara>        ����� ���, ������ ���������� "unknown error"
         </simpara>
        </listitem>
       </varlistentry>
       <varlistentry>
        <term>code</term>
        <listitem>
         <simpara>       ��� ��� (�������)
         </simpara>
        </listitem>
       </varlistentry>
       <varlistentry>
        <term>mode</term>
        <listitem>
         <simpara>
          ����� �����.  ���� ���<link
          linkend="pear.error-modes"> ������ ����� error modes</link>  ��������.
         </simpara>
        </listitem>
       </varlistentry>
       <varlistentry>
        <term>options</term>
        <listitem>
         <simpara>        ��� ��� ������� ������ ����� ������ ������ , ������ 
          ��� ��������.  ������ ������ "trigger" � ����� ������ "callback" ���
          ��� ����� �������� ���� �������� options.  �� ����� ������,
          ��� ������ �� ���� ��  <constant>E_USER_NOTICE</constant>,
          <constant>E_USER_WARNING</constant> ��          
<constant>E_USER_ERROR</constant>.  �� ����� ������ "callback", ��� 
          ������ ��� �� ����� ��� ��� ���� ������  
          (�����), �� ������ ��� ������ (����, ��) 
          ���� ������ �������� ���� ��� �������� �� ������.
         </simpara>
        </listitem>
       </varlistentry>
      </variablelist>
     </para>
    </refsect2>
   </refsect1>
  </refentry>
 </reference>
<!-- 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
sgml-parent-document:nil
sgml-default-dtd-file:"../../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
-->

Reply via email to