mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
WS, prepare for new doc style
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@237703 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
57cd821db5
commit
16fe2685e8
114 changed files with 4579 additions and 4674 deletions
|
@ -1,52 +1,52 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/regex.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.ereg-replace">
|
||||
<refnamediv>
|
||||
<refname>ereg_replace</refname>
|
||||
<refpurpose>Replace regular expression</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>ereg_replace</methodname>
|
||||
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>replacement</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
This function scans <parameter>string</parameter> for matches to
|
||||
<parameter>pattern</parameter>, then replaces the matched text
|
||||
with <parameter>replacement</parameter>.
|
||||
</simpara>
|
||||
<simpara>
|
||||
The modified string is returned. (Which may mean that the
|
||||
original string is returned if there are no matches to be
|
||||
replaced.)
|
||||
</simpara>
|
||||
<simpara>
|
||||
If <parameter>pattern</parameter> contains parenthesized
|
||||
substrings, <parameter>replacement</parameter> may contain
|
||||
substrings of the form
|
||||
<literal>\\<replaceable>digit</replaceable></literal>, which will
|
||||
be replaced by the text matching the digit'th parenthesized
|
||||
substring; <literal>\\0</literal> will produce the entire
|
||||
contents of string. Up to nine substrings may be used.
|
||||
Parentheses may be nested, in which case they are counted by the
|
||||
opening parenthesis.
|
||||
</simpara>
|
||||
<simpara>
|
||||
If no matches are found in <parameter>string</parameter>, then
|
||||
<parameter>string</parameter> will be returned unchanged.
|
||||
</simpara>
|
||||
<para>
|
||||
For example, the following code snippet prints "This was a test"
|
||||
three times:
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>ereg_replace</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.ereg-replace">
|
||||
<refnamediv>
|
||||
<refname>ereg_replace</refname>
|
||||
<refpurpose>Replace regular expression</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>ereg_replace</methodname>
|
||||
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>replacement</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
This function scans <parameter>string</parameter> for matches to
|
||||
<parameter>pattern</parameter>, then replaces the matched text
|
||||
with <parameter>replacement</parameter>.
|
||||
</simpara>
|
||||
<simpara>
|
||||
The modified string is returned. (Which may mean that the
|
||||
original string is returned if there are no matches to be
|
||||
replaced.)
|
||||
</simpara>
|
||||
<simpara>
|
||||
If <parameter>pattern</parameter> contains parenthesized
|
||||
substrings, <parameter>replacement</parameter> may contain
|
||||
substrings of the form
|
||||
<literal>\\<replaceable>digit</replaceable></literal>, which will
|
||||
be replaced by the text matching the digit'th parenthesized
|
||||
substring; <literal>\\0</literal> will produce the entire
|
||||
contents of string. Up to nine substrings may be used.
|
||||
Parentheses may be nested, in which case they are counted by the
|
||||
opening parenthesis.
|
||||
</simpara>
|
||||
<simpara>
|
||||
If no matches are found in <parameter>string</parameter>, then
|
||||
<parameter>string</parameter> will be returned unchanged.
|
||||
</simpara>
|
||||
<para>
|
||||
For example, the following code snippet prints "This was a test"
|
||||
three times:
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>ereg_replace</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
|
@ -57,20 +57,20 @@ echo ereg_replace("(( )is)", "\\2was", $string);
|
|||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
One thing to take note of is that if you use an integer value as
|
||||
the <parameter>replacement</parameter> parameter, you may not get
|
||||
the results you expect. This is because
|
||||
<function>ereg_replace</function> will interpret the number as
|
||||
the ordinal value of a character, and apply that. For instance:
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>ereg_replace</function> example</title>
|
||||
<programlisting role="php">
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
One thing to take note of is that if you use an integer value as
|
||||
the <parameter>replacement</parameter> parameter, you may not get
|
||||
the results you expect. This is because
|
||||
<function>ereg_replace</function> will interpret the number as
|
||||
the ordinal value of a character, and apply that. For instance:
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>ereg_replace</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* This will not work as expected. */
|
||||
|
@ -86,36 +86,36 @@ $string = ereg_replace('four', $num, $string);
|
|||
echo $string; /* Output: 'This string has 4 words.' */
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Replace URLs with links</title>
|
||||
<programlisting role="php">
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Replace URLs with links</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",
|
||||
"<a href=\"\\0\">\\0</a>", $text);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<tip>
|
||||
<para>
|
||||
<function>preg_replace</function>, which uses a Perl-compatible
|
||||
regular expression syntax, is often a faster alternative to
|
||||
<function>ereg_replace</function>.
|
||||
</para>
|
||||
</tip>
|
||||
<para>
|
||||
See also <function>ereg</function>, <function>eregi</function>,
|
||||
<function>eregi_replace</function>, <function>str_replace</function>, and
|
||||
<function>preg_match</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<tip>
|
||||
<para>
|
||||
<function>preg_replace</function>, which uses a Perl-compatible
|
||||
regular expression syntax, is often a faster alternative to
|
||||
<function>ereg_replace</function>.
|
||||
</para>
|
||||
</tip>
|
||||
<para>
|
||||
See also <function>ereg</function>, <function>eregi</function>,
|
||||
<function>eregi_replace</function>, <function>str_replace</function>, and
|
||||
<function>preg_match</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
|
@ -1,66 +1,66 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<!-- splitted from ./en/functions/regex.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.ereg">
|
||||
<refnamediv>
|
||||
<refname>ereg</refname>
|
||||
<refpurpose>Regular expression match</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>ereg</methodname>
|
||||
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter role="reference">regs</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<note>
|
||||
<para>
|
||||
<function>preg_match</function>, which uses a Perl-compatible
|
||||
regular expression syntax, is often a faster alternative to
|
||||
<function>ereg</function>.
|
||||
</para>
|
||||
</note>
|
||||
<simpara>
|
||||
Searches a <parameter>string</parameter> for matches to the regular
|
||||
expression given in <parameter>pattern</parameter> in a case-sensitive
|
||||
way.
|
||||
</simpara>
|
||||
<simpara>
|
||||
If matches are found for parenthesized substrings of
|
||||
<parameter>pattern</parameter> and the function is called with
|
||||
the third argument <parameter>regs</parameter>, the matches will
|
||||
be stored in the elements of the array
|
||||
<parameter>regs</parameter>. $regs[1] will contain the substring
|
||||
which starts at the first left parenthesis; $regs[2] will contain
|
||||
the substring starting at the second, and so on. $regs[0] will
|
||||
contain a copy of the complete string matched.
|
||||
</simpara>
|
||||
<note>
|
||||
<simpara>
|
||||
Up to (and including) PHP 4.1.0 <varname>$regs</varname> will be
|
||||
filled with exactly ten elements, even though more or fewer than
|
||||
ten parenthesized substrings may actually have matched. This has
|
||||
no effect on <function>ereg</function>'s ability to match more
|
||||
substrings. If no matches are found, <literal>$regs</literal>
|
||||
will not be altered by <function>ereg</function>.
|
||||
</simpara>
|
||||
</note>
|
||||
<simpara>
|
||||
Returns the length of the matched string if a match for <parameter>pattern</parameter> was
|
||||
found in <parameter>string</parameter>, or &false; if no matches
|
||||
were found or an error occurred.
|
||||
If the optional parameter <parameter>regs</parameter> was not passed or
|
||||
the length of the matched string is 0, this function returns 1.
|
||||
</simpara>
|
||||
<para>
|
||||
The following code snippet takes a date in ISO format
|
||||
(YYYY-MM-DD) and prints it in DD.MM.YYYY format:
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>ereg</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.ereg">
|
||||
<refnamediv>
|
||||
<refname>ereg</refname>
|
||||
<refpurpose>Regular expression match</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>ereg</methodname>
|
||||
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter role="reference">regs</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<note>
|
||||
<para>
|
||||
<function>preg_match</function>, which uses a Perl-compatible
|
||||
regular expression syntax, is often a faster alternative to
|
||||
<function>ereg</function>.
|
||||
</para>
|
||||
</note>
|
||||
<simpara>
|
||||
Searches a <parameter>string</parameter> for matches to the regular
|
||||
expression given in <parameter>pattern</parameter> in a case-sensitive
|
||||
way.
|
||||
</simpara>
|
||||
<simpara>
|
||||
If matches are found for parenthesized substrings of
|
||||
<parameter>pattern</parameter> and the function is called with
|
||||
the third argument <parameter>regs</parameter>, the matches will
|
||||
be stored in the elements of the array
|
||||
<parameter>regs</parameter>. $regs[1] will contain the substring
|
||||
which starts at the first left parenthesis; $regs[2] will contain
|
||||
the substring starting at the second, and so on. $regs[0] will
|
||||
contain a copy of the complete string matched.
|
||||
</simpara>
|
||||
<note>
|
||||
<simpara>
|
||||
Up to (and including) PHP 4.1.0 <varname>$regs</varname> will be
|
||||
filled with exactly ten elements, even though more or fewer than
|
||||
ten parenthesized substrings may actually have matched. This has
|
||||
no effect on <function>ereg</function>'s ability to match more
|
||||
substrings. If no matches are found, <literal>$regs</literal>
|
||||
will not be altered by <function>ereg</function>.
|
||||
</simpara>
|
||||
</note>
|
||||
<simpara>
|
||||
Returns the length of the matched string if a match for <parameter>pattern</parameter> was
|
||||
found in <parameter>string</parameter>, or &false; if no matches
|
||||
were found or an error occurred.
|
||||
If the optional parameter <parameter>regs</parameter> was not passed or
|
||||
the length of the matched string is 0, this function returns 1.
|
||||
</simpara>
|
||||
<para>
|
||||
The following code snippet takes a date in ISO format
|
||||
(YYYY-MM-DD) and prints it in DD.MM.YYYY format:
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>ereg</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs)) {
|
||||
|
@ -70,16 +70,16 @@ if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs)) {
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>eregi</function>, <function>ereg_replace</function>,
|
||||
<function>eregi_replace</function>, <function>preg_match</function>,
|
||||
<function>strpos</function>, and <function>strstr</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>eregi</function>, <function>ereg_replace</function>,
|
||||
<function>eregi_replace</function>, <function>preg_match</function>,
|
||||
<function>strpos</function>, and <function>strstr</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/regex.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.eregi-replace">
|
||||
<refnamediv>
|
||||
<refname>eregi_replace</refname>
|
||||
<refpurpose>Replace regular expression case insensitive</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>eregi_replace</methodname>
|
||||
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>replacement</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function is identical to <function>ereg_replace</function>
|
||||
except that this ignores case distinction when matching
|
||||
alphabetic characters.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Highlight search results</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.eregi-replace">
|
||||
<refnamediv>
|
||||
<refname>eregi_replace</refname>
|
||||
<refpurpose>Replace regular expression case insensitive</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>eregi_replace</methodname>
|
||||
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>replacement</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function is identical to <function>ereg_replace</function>
|
||||
except that this ignores case distinction when matching
|
||||
alphabetic characters.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Highlight search results</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$pattern = '(>[^<]*)('. quotemeta($_GET['search']) .')';
|
||||
|
@ -30,15 +30,15 @@ $replacement = '\\1<span class="search">\\2</span>';
|
|||
$body = eregi_replace($pattern, $replacement, $body);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>ereg</function>, <function>eregi</function>,
|
||||
and <function>ereg_replace</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>ereg</function>, <function>eregi</function>,
|
||||
and <function>ereg_replace</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- splitted from ./en/functions/regex.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.eregi">
|
||||
<refnamediv>
|
||||
<refname>eregi</refname>
|
||||
<refpurpose>Case insensitive regular expression match</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>eregi</methodname>
|
||||
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter role="reference">regs</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function is identical to <function>ereg</function> except
|
||||
that this ignores case distinction when matching alphabetic
|
||||
characters.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>eregi</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.eregi">
|
||||
<refnamediv>
|
||||
<refname>eregi</refname>
|
||||
<refpurpose>Case insensitive regular expression match</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>eregi</methodname>
|
||||
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter role="reference">regs</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function is identical to <function>ereg</function> except
|
||||
that this ignores case distinction when matching alphabetic
|
||||
characters.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>eregi</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$string = 'XYZ';
|
||||
|
@ -31,16 +31,16 @@ if (eregi('z', $string)) {
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>ereg</function>, <function>ereg_replace</function>,
|
||||
<function>eregi_replace</function>, <function>stripos</function>, and
|
||||
<function>stristr</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>ereg</function>, <function>ereg_replace</function>,
|
||||
<function>eregi_replace</function>, <function>stripos</function>, and
|
||||
<function>stristr</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
|
@ -1,71 +1,71 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/regex.xml, last change in rev 1.7 -->
|
||||
<refentry id="function.split">
|
||||
<refnamediv>
|
||||
<refname>split</refname>
|
||||
<refpurpose>Split string into array by regular expression</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>split</methodname>
|
||||
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>limit</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<tip>
|
||||
<para>
|
||||
<function>preg_split</function>, which uses a Perl-compatible regular
|
||||
expression syntax, is often a faster alternative to
|
||||
<function>split</function>. If you don't require the power of regular
|
||||
expressions, it is faster to use <function>explode</function>, which
|
||||
doesn't incur the overhead of the regular expression engine.
|
||||
</para>
|
||||
</tip>
|
||||
<para>
|
||||
Returns an array of strings, each of which is a substring of
|
||||
<parameter>string</parameter> formed by splitting it on
|
||||
boundaries formed by the case-sensitive regular expression
|
||||
<parameter>pattern</parameter>. If <parameter>limit</parameter>
|
||||
is set, the returned array will contain a maximum of
|
||||
<parameter>limit</parameter> elements with the last element
|
||||
containing the whole rest of <parameter>string</parameter>. If
|
||||
an error occurs, <function>split</function> returns &false;.
|
||||
</para>
|
||||
<para>
|
||||
To split off the first four fields from a line from
|
||||
<filename>/etc/passwd</filename>:
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>split</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.split">
|
||||
<refnamediv>
|
||||
<refname>split</refname>
|
||||
<refpurpose>Split string into array by regular expression</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>split</methodname>
|
||||
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>limit</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<tip>
|
||||
<para>
|
||||
<function>preg_split</function>, which uses a Perl-compatible regular
|
||||
expression syntax, is often a faster alternative to
|
||||
<function>split</function>. If you don't require the power of regular
|
||||
expressions, it is faster to use <function>explode</function>, which
|
||||
doesn't incur the overhead of the regular expression engine.
|
||||
</para>
|
||||
</tip>
|
||||
<para>
|
||||
Returns an array of strings, each of which is a substring of
|
||||
<parameter>string</parameter> formed by splitting it on
|
||||
boundaries formed by the case-sensitive regular expression
|
||||
<parameter>pattern</parameter>. If <parameter>limit</parameter>
|
||||
is set, the returned array will contain a maximum of
|
||||
<parameter>limit</parameter> elements with the last element
|
||||
containing the whole rest of <parameter>string</parameter>. If
|
||||
an error occurs, <function>split</function> returns &false;.
|
||||
</para>
|
||||
<para>
|
||||
To split off the first four fields from a line from
|
||||
<filename>/etc/passwd</filename>:
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>split</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
list($user, $pass, $uid, $gid, $extra) =
|
||||
split(":", $passwd_line, 5);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<simpara>
|
||||
If there are <replaceable>n</replaceable> occurrences of
|
||||
<parameter>pattern</parameter>, the returned array will contain
|
||||
<literal><replaceable>n</replaceable>+1</literal> items. For example, if
|
||||
there is no occurrence of <parameter>pattern</parameter>, an array with
|
||||
only one element will be returned. Of course, this is also true if
|
||||
<parameter>string</parameter> is empty.
|
||||
</simpara>
|
||||
<para>
|
||||
To parse a date which may be delimited with slashes, dots, or
|
||||
hyphens:
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>split</function> example</title>
|
||||
<programlisting role="php">
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<simpara>
|
||||
If there are <replaceable>n</replaceable> occurrences of
|
||||
<parameter>pattern</parameter>, the returned array will contain
|
||||
<literal><replaceable>n</replaceable>+1</literal> items. For example, if
|
||||
there is no occurrence of <parameter>pattern</parameter>, an array with
|
||||
only one element will be returned. Of course, this is also true if
|
||||
<parameter>string</parameter> is empty.
|
||||
</simpara>
|
||||
<para>
|
||||
To parse a date which may be delimited with slashes, dots, or
|
||||
hyphens:
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>split</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Delimiters may be slash, dot, or hyphen
|
||||
|
@ -74,38 +74,38 @@ list($month, $day, $year) = split('[/.-]', $date);
|
|||
echo "Month: $month; Day: $day; Year: $year<br />\n";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For users looking for a way to emulate Perl's <command>@chars =
|
||||
split('', $str)</command> behaviour, please see the examples for
|
||||
<function>preg_split</function> or <function>str_split</function>.
|
||||
</para>
|
||||
<para>
|
||||
For users looking for a way to emulate Perl's <command>@chars =
|
||||
split('', $str)</command> behaviour, please see the examples for
|
||||
<function>preg_split</function> or <function>str_split</function>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Please note that <parameter>pattern</parameter> is a regular
|
||||
expression. If you want to split on any of the characters which
|
||||
are considered special by regular expressions, you'll need to
|
||||
escape them first. If you think <function>split</function> (or
|
||||
any other regex function, for that matter) is doing something
|
||||
weird, please read the file <filename>regex.7</filename>,
|
||||
included in the <filename>regex/</filename> subdirectory of the
|
||||
PHP distribution. It's in manpage format, so you'll want to do
|
||||
something along the lines of <command>man
|
||||
/usr/local/src/regex/regex.7</command> in order to read it.
|
||||
</para>
|
||||
<para>
|
||||
Please note that <parameter>pattern</parameter> is a regular
|
||||
expression. If you want to split on any of the characters which
|
||||
are considered special by regular expressions, you'll need to
|
||||
escape them first. If you think <function>split</function> (or
|
||||
any other regex function, for that matter) is doing something
|
||||
weird, please read the file <filename>regex.7</filename>,
|
||||
included in the <filename>regex/</filename> subdirectory of the
|
||||
PHP distribution. It's in manpage format, so you'll want to do
|
||||
something along the lines of <command>man
|
||||
/usr/local/src/regex/regex.7</command> in order to read it.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See also: <function>preg_split</function>, <function>spliti</function>,
|
||||
<function>str_split</function>,
|
||||
<function>explode</function>, <function>implode</function>,
|
||||
<function>chunk_split</function>, and <function>wordwrap</function>.
|
||||
</para>
|
||||
<para>
|
||||
See also: <function>preg_split</function>, <function>spliti</function>,
|
||||
<function>str_split</function>,
|
||||
<function>explode</function>, <function>implode</function>,
|
||||
<function>chunk_split</function>, and <function>wordwrap</function>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/regex.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.spliti">
|
||||
<refnamediv>
|
||||
<refname>spliti</refname>
|
||||
<refpurpose>
|
||||
Split string into array by regular expression case insensitive
|
||||
</refpurpose>
|
||||
<refpurpose>Split string into array by regular expression case insensitive</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
@ -39,7 +37,7 @@ print_r($chunks);
|
|||
<![CDATA[
|
||||
Array
|
||||
(
|
||||
[0] =>
|
||||
[0] =>
|
||||
[1] => BBB
|
||||
[2] => CCC
|
||||
[3] => DDD
|
||||
|
@ -48,7 +46,7 @@ Array
|
|||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>preg_split</function>, <function>split</function>,
|
||||
<function>explode</function>, and <function>implode</function>.
|
||||
|
|
|
@ -1,50 +1,48 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/regex.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.sql-regcase">
|
||||
<refnamediv>
|
||||
<refname>sql_regcase</refname>
|
||||
<refpurpose>
|
||||
Make regular expression for case insensitive match
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>sql_regcase</methodname>
|
||||
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns a valid regular expression which will match
|
||||
<parameter>string</parameter>, ignoring case. This expression is
|
||||
<parameter>string</parameter> with each alphabetic character converted to a
|
||||
bracket expression; this bracket expression contains that
|
||||
character's uppercase and lowercase form. Other characters remain unchanged.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>sql_regcase</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.sql-regcase">
|
||||
<refnamediv>
|
||||
<refname>sql_regcase</refname>
|
||||
<refpurpose>Make regular expression for case insensitive match</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>sql_regcase</methodname>
|
||||
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns a valid regular expression which will match
|
||||
<parameter>string</parameter>, ignoring case. This expression is
|
||||
<parameter>string</parameter> with each alphabetic character converted to a
|
||||
bracket expression; this bracket expression contains that
|
||||
character's uppercase and lowercase form. Other characters remain unchanged.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>sql_regcase</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
echo sql_regcase("Foo - bar.");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
[Ff][Oo][Oo] - [Bb][Aa][Rr].
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
This can be used to achieve case insensitive pattern matching in
|
||||
products which support only case sensitive regular expressions.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
This can be used to achieve case insensitive pattern matching in
|
||||
products which support only case sensitive regular expressions.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
|
@ -1,37 +1,35 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sem.xml, last change in rev 1.2 -->
|
||||
<refentry id='function.ftok'>
|
||||
<refnamediv>
|
||||
<refname>ftok</refname>
|
||||
<refpurpose>
|
||||
Convert a pathname and a project identifier to a System V IPC key
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>ftok</methodname>
|
||||
<methodparam><type>string</type><parameter>pathname</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>proj</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The function converts the <parameter>pathname</parameter> of an existing
|
||||
accessible file and a project identifier (<parameter>proj</parameter>)
|
||||
into a
|
||||
<literal>integer</literal> for use with for example
|
||||
<function>shmop_open</function> and other System V IPC keys. The
|
||||
<parameter>proj</parameter> parameter must be a one character string.
|
||||
</para>
|
||||
<para>
|
||||
On success the return value will be the created key value, otherwise
|
||||
<literal>-1</literal> is returned.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>shmop_open</function> and <function>sem_get</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id='function.ftok'>
|
||||
<refnamediv>
|
||||
<refname>ftok</refname>
|
||||
<refpurpose>Convert a pathname and a project identifier to a System V IPC key</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>ftok</methodname>
|
||||
<methodparam><type>string</type><parameter>pathname</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>proj</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The function converts the <parameter>pathname</parameter> of an existing
|
||||
accessible file and a project identifier (<parameter>proj</parameter>)
|
||||
into a
|
||||
<literal>integer</literal> for use with for example
|
||||
<function>shmop_open</function> and other System V IPC keys. The
|
||||
<parameter>proj</parameter> parameter must be a one character string.
|
||||
</para>
|
||||
<para>
|
||||
On success the return value will be the created key value, otherwise
|
||||
<literal>-1</literal> is returned.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>shmop_open</function> and <function>sem_get</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,39 +1,37 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id="function.msg-get-queue">
|
||||
<refnamediv>
|
||||
<refname>msg_get_queue</refname>
|
||||
<refpurpose>
|
||||
Create or attach to a message queue
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>msg_get_queue</methodname>
|
||||
<methodparam><type>int</type><parameter>key</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>perms</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>msg_get_queue</function> returns an id that can be used to
|
||||
access the System V message queue with the given
|
||||
<parameter>key</parameter>. The first call creates the message queue with
|
||||
the optional <parameter>perms</parameter> (default: 0666).
|
||||
A second call to <function>msg_get_queue</function> for the same
|
||||
<parameter>key</parameter> will return a different message queue
|
||||
identifier, but both identifiers access the same underlying message
|
||||
queue.
|
||||
If the message queue already exists, the <parameter>perms</parameter>
|
||||
will be ignored.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>msg_remove_queue</function>,
|
||||
<function>msg_receive</function>, <function>msg_send</function>,
|
||||
<function>msg_stat_queue</function> and
|
||||
<function>msg_set_queue</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<refentry id="function.msg-get-queue">
|
||||
<refnamediv>
|
||||
<refname>msg_get_queue</refname>
|
||||
<refpurpose>Create or attach to a message queue</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>msg_get_queue</methodname>
|
||||
<methodparam><type>int</type><parameter>key</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>perms</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>msg_get_queue</function> returns an id that can be used to
|
||||
access the System V message queue with the given
|
||||
<parameter>key</parameter>. The first call creates the message queue with
|
||||
the optional <parameter>perms</parameter> (default: 0666).
|
||||
A second call to <function>msg_get_queue</function> for the same
|
||||
<parameter>key</parameter> will return a different message queue
|
||||
identifier, but both identifiers access the same underlying message
|
||||
queue.
|
||||
If the message queue already exists, the <parameter>perms</parameter>
|
||||
will be ignored.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>msg_remove_queue</function>,
|
||||
<function>msg_receive</function>, <function>msg_send</function>,
|
||||
<function>msg_stat_queue</function> and
|
||||
<function>msg_set_queue</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,117 +1,115 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<refentry id="function.msg-receive">
|
||||
<refnamediv>
|
||||
<refname>msg_receive</refname>
|
||||
<refpurpose>
|
||||
Receive a message from a message queue
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>msg_receive</methodname>
|
||||
<methodparam><type>resource</type><parameter>queue</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>desiredmsgtype</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter role="reference">msgtype</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>maxsize</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter role="reference">message</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>unserialize</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">errorcode</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>msg_receive</function> will receive the first message from the
|
||||
specified <parameter>queue</parameter> of the type specified by
|
||||
<parameter>desiredmsgtype</parameter>.
|
||||
The type of the message that was received will be stored in
|
||||
<parameter>msgtype</parameter>.
|
||||
The maximum size of message to be accepted is specified by the
|
||||
<parameter>maxsize</parameter>; if the message in the queue is larger
|
||||
than this size the function will fail (unless you set
|
||||
<parameter>flags</parameter> as described below).
|
||||
The received message will be stored in <parameter>message</parameter>,
|
||||
unless there were errors receiving the message, in which case the
|
||||
optional <parameter>errorcode</parameter> will be set to the value of the
|
||||
system errno variable to help you identify the cause.
|
||||
</para>
|
||||
<para>
|
||||
If <parameter>desiredmsgtype</parameter> is 0, the message from the front
|
||||
of the queue is returned. If <parameter>desiredmsgtype</parameter> is
|
||||
greater than 0, then the first message of that type is returned.
|
||||
If <parameter>desiredmsgtype</parameter> is less than 0, the first
|
||||
message on the queue with the lowest type less than or equal to the
|
||||
absolute value of <parameter>desiredmsgtype</parameter> will be read.
|
||||
If no messages match the criteria, your script will wait until a suitable
|
||||
message arrives on the queue. You can prevent the script from blocking
|
||||
by specifying <constant>MSG_IPC_NOWAIT</constant> in the
|
||||
<parameter>flags</parameter> parameter.
|
||||
</para>
|
||||
<para>
|
||||
<parameter>unserialize</parameter> defaults to &true;; if it is set to
|
||||
&true;, the message is treated as though it was serialized using the same
|
||||
mechanism as the session module. The message will be unserialized and
|
||||
then returned to your script. This allows you to easily receive arrays
|
||||
or complex object structures from other PHP scripts, or if you are using
|
||||
the WDDX serializer, from any WDDX compatible source.
|
||||
If <parameter>unserialize</parameter> is &false;, the message will be
|
||||
returned as a binary-safe string.
|
||||
</para>
|
||||
<para>
|
||||
The optional <parameter>flags</parameter> allows you to pass flags to the
|
||||
low-level msgrcv system call. It defaults to 0, but you may specify one
|
||||
or more of the following values (by adding or ORing them together).
|
||||
<table>
|
||||
<title>Flag values for msg_receive</title>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><constant>MSG_IPC_NOWAIT</constant></entry>
|
||||
<entry>If there are no messages of the
|
||||
<parameter>desiredmsgtype</parameter>, return immediately and do not
|
||||
wait. The function will fail and return an integer value
|
||||
corresponding to <constant>MSG_ENOMSG</constant>.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><constant>MSG_EXCEPT</constant></entry>
|
||||
<entry>Using this flag in combination with a
|
||||
<parameter>desiredmsgtype</parameter> greater than 0 will cause the
|
||||
function to receive the first message that is not equal to
|
||||
<parameter>desiredmsgtype</parameter>.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><constant>MSG_NOERROR</constant></entry>
|
||||
<entry>
|
||||
If the message is longer than <parameter>maxsize</parameter>,
|
||||
setting this flag will truncate the message to
|
||||
<parameter>maxsize</parameter> and will not signal an error.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
<para>
|
||||
Upon successful completion the message queue data structure is updated as
|
||||
follows: <literal>msg_lrpid</literal> is set to the process-ID of the
|
||||
calling process, <literal>msg_qnum</literal> is decremented by 1 and
|
||||
<literal>msg_rtime</literal> is set to the current time.
|
||||
</para>
|
||||
<para>
|
||||
<function>msg_receive</function> returns &true; on success or &false; on
|
||||
failure. If the function fails, the optional
|
||||
<parameter>errorcode</parameter> will be set to the value of the system
|
||||
errno variable.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>msg_remove_queue</function>,
|
||||
<function>msg_send</function>,
|
||||
<function>msg_stat_queue</function> and
|
||||
<function>msg_set_queue</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<refentry id="function.msg-receive">
|
||||
<refnamediv>
|
||||
<refname>msg_receive</refname>
|
||||
<refpurpose>Receive a message from a message queue</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>msg_receive</methodname>
|
||||
<methodparam><type>resource</type><parameter>queue</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>desiredmsgtype</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter role="reference">msgtype</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>maxsize</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter role="reference">message</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>unserialize</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">errorcode</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>msg_receive</function> will receive the first message from the
|
||||
specified <parameter>queue</parameter> of the type specified by
|
||||
<parameter>desiredmsgtype</parameter>.
|
||||
The type of the message that was received will be stored in
|
||||
<parameter>msgtype</parameter>.
|
||||
The maximum size of message to be accepted is specified by the
|
||||
<parameter>maxsize</parameter>; if the message in the queue is larger
|
||||
than this size the function will fail (unless you set
|
||||
<parameter>flags</parameter> as described below).
|
||||
The received message will be stored in <parameter>message</parameter>,
|
||||
unless there were errors receiving the message, in which case the
|
||||
optional <parameter>errorcode</parameter> will be set to the value of the
|
||||
system errno variable to help you identify the cause.
|
||||
</para>
|
||||
<para>
|
||||
If <parameter>desiredmsgtype</parameter> is 0, the message from the front
|
||||
of the queue is returned. If <parameter>desiredmsgtype</parameter> is
|
||||
greater than 0, then the first message of that type is returned.
|
||||
If <parameter>desiredmsgtype</parameter> is less than 0, the first
|
||||
message on the queue with the lowest type less than or equal to the
|
||||
absolute value of <parameter>desiredmsgtype</parameter> will be read.
|
||||
If no messages match the criteria, your script will wait until a suitable
|
||||
message arrives on the queue. You can prevent the script from blocking
|
||||
by specifying <constant>MSG_IPC_NOWAIT</constant> in the
|
||||
<parameter>flags</parameter> parameter.
|
||||
</para>
|
||||
<para>
|
||||
<parameter>unserialize</parameter> defaults to &true;; if it is set to
|
||||
&true;, the message is treated as though it was serialized using the same
|
||||
mechanism as the session module. The message will be unserialized and
|
||||
then returned to your script. This allows you to easily receive arrays
|
||||
or complex object structures from other PHP scripts, or if you are using
|
||||
the WDDX serializer, from any WDDX compatible source.
|
||||
If <parameter>unserialize</parameter> is &false;, the message will be
|
||||
returned as a binary-safe string.
|
||||
</para>
|
||||
<para>
|
||||
The optional <parameter>flags</parameter> allows you to pass flags to the
|
||||
low-level msgrcv system call. It defaults to 0, but you may specify one
|
||||
or more of the following values (by adding or ORing them together).
|
||||
<table>
|
||||
<title>Flag values for msg_receive</title>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><constant>MSG_IPC_NOWAIT</constant></entry>
|
||||
<entry>If there are no messages of the
|
||||
<parameter>desiredmsgtype</parameter>, return immediately and do not
|
||||
wait. The function will fail and return an integer value
|
||||
corresponding to <constant>MSG_ENOMSG</constant>.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><constant>MSG_EXCEPT</constant></entry>
|
||||
<entry>Using this flag in combination with a
|
||||
<parameter>desiredmsgtype</parameter> greater than 0 will cause the
|
||||
function to receive the first message that is not equal to
|
||||
<parameter>desiredmsgtype</parameter>.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><constant>MSG_NOERROR</constant></entry>
|
||||
<entry>
|
||||
If the message is longer than <parameter>maxsize</parameter>,
|
||||
setting this flag will truncate the message to
|
||||
<parameter>maxsize</parameter> and will not signal an error.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
<para>
|
||||
Upon successful completion the message queue data structure is updated as
|
||||
follows: <literal>msg_lrpid</literal> is set to the process-ID of the
|
||||
calling process, <literal>msg_qnum</literal> is decremented by 1 and
|
||||
<literal>msg_rtime</literal> is set to the current time.
|
||||
</para>
|
||||
<para>
|
||||
<function>msg_receive</function> returns &true; on success or &false; on
|
||||
failure. If the function fails, the optional
|
||||
<parameter>errorcode</parameter> will be set to the value of the system
|
||||
errno variable.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>msg_remove_queue</function>,
|
||||
<function>msg_send</function>,
|
||||
<function>msg_stat_queue</function> and
|
||||
<function>msg_set_queue</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,32 +1,30 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<refentry id="function.msg-remove-queue">
|
||||
<refnamediv>
|
||||
<refname>msg_remove_queue</refname>
|
||||
<refpurpose>
|
||||
Destroy a message queue
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>msg_remove_queue</methodname>
|
||||
<methodparam><type>resource</type><parameter>queue</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>msg_remove_queue</function> destroys the message queue specified
|
||||
by the <parameter>queue</parameter>. Only use this function when all
|
||||
processes have finished working with the message queue and you need to
|
||||
release the system resources held by it.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>msg_get_queue</function>,
|
||||
<function>msg_receive</function>,
|
||||
<function>msg_stat_queue</function> and
|
||||
<function>msg_set_queue</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id="function.msg-remove-queue">
|
||||
<refnamediv>
|
||||
<refname>msg_remove_queue</refname>
|
||||
<refpurpose>Destroy a message queue</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>msg_remove_queue</methodname>
|
||||
<methodparam><type>resource</type><parameter>queue</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>msg_remove_queue</function> destroys the message queue specified
|
||||
by the <parameter>queue</parameter>. Only use this function when all
|
||||
processes have finished working with the message queue and you need to
|
||||
release the system resources held by it.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>msg_get_queue</function>,
|
||||
<function>msg_receive</function>,
|
||||
<function>msg_stat_queue</function> and
|
||||
<function>msg_set_queue</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,62 +1,60 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.msg-send">
|
||||
<refnamediv>
|
||||
<refname>msg_send</refname>
|
||||
<refpurpose>
|
||||
Send a message to a message queue
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>msg_send</methodname>
|
||||
<methodparam><type>resource</type><parameter>queue</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>msgtype</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>message</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>serialize</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>blocking</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">errorcode</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>msg_send</function> sends a <parameter>message</parameter> of type
|
||||
<parameter>msgtype</parameter> (which MUST be greater than 0) to
|
||||
the message queue specified by <parameter>queue</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
If the message is too large to fit in the queue, your script will wait
|
||||
until another process reads messages from the queue and frees enough
|
||||
space for your message to be sent.
|
||||
This is called blocking; you can prevent blocking by setting the
|
||||
optional <parameter>blocking</parameter> parameter to &false;, in which
|
||||
case <function>msg_send</function> will immediately return &false; if the
|
||||
message is too big for the queue, and set the optional
|
||||
<parameter>errorcode</parameter> to <constant>MSG_EAGAIN</constant>, indicating that you should
|
||||
try to send your message again a little later on.
|
||||
</para>
|
||||
<para>
|
||||
The optional <parameter>serialize</parameter> controls how the
|
||||
<parameter>message</parameter> is sent. <parameter>serialize</parameter>
|
||||
defaults to &true; which means that the <parameter>message</parameter> is
|
||||
serialized using the same mechanism as the session module before being
|
||||
sent to the queue. This allows complex arrays and objects to be sent to
|
||||
other PHP scripts, or if you are using the WDDX serializer, to any WDDX
|
||||
compatible client.
|
||||
</para>
|
||||
<para>
|
||||
Upon successful completion the message queue data structure is updated as
|
||||
follows: <parameter>msg_lspid</parameter> is set to the process-ID of the
|
||||
calling process, <parameter>msg_qnum</parameter> is incremented by 1 and
|
||||
<parameter>msg_stime</parameter> is set to the current time.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>msg_remove_queue</function>,
|
||||
<function>msg_receive</function>,
|
||||
<function>msg_stat_queue</function> and
|
||||
<function>msg_set_queue</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<refentry id="function.msg-send">
|
||||
<refnamediv>
|
||||
<refname>msg_send</refname>
|
||||
<refpurpose>Send a message to a message queue</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>msg_send</methodname>
|
||||
<methodparam><type>resource</type><parameter>queue</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>msgtype</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>message</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>serialize</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>blocking</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">errorcode</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>msg_send</function> sends a <parameter>message</parameter> of type
|
||||
<parameter>msgtype</parameter> (which MUST be greater than 0) to
|
||||
the message queue specified by <parameter>queue</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
If the message is too large to fit in the queue, your script will wait
|
||||
until another process reads messages from the queue and frees enough
|
||||
space for your message to be sent.
|
||||
This is called blocking; you can prevent blocking by setting the
|
||||
optional <parameter>blocking</parameter> parameter to &false;, in which
|
||||
case <function>msg_send</function> will immediately return &false; if the
|
||||
message is too big for the queue, and set the optional
|
||||
<parameter>errorcode</parameter> to <constant>MSG_EAGAIN</constant>, indicating that you should
|
||||
try to send your message again a little later on.
|
||||
</para>
|
||||
<para>
|
||||
The optional <parameter>serialize</parameter> controls how the
|
||||
<parameter>message</parameter> is sent. <parameter>serialize</parameter>
|
||||
defaults to &true; which means that the <parameter>message</parameter> is
|
||||
serialized using the same mechanism as the session module before being
|
||||
sent to the queue. This allows complex arrays and objects to be sent to
|
||||
other PHP scripts, or if you are using the WDDX serializer, to any WDDX
|
||||
compatible client.
|
||||
</para>
|
||||
<para>
|
||||
Upon successful completion the message queue data structure is updated as
|
||||
follows: <parameter>msg_lspid</parameter> is set to the process-ID of the
|
||||
calling process, <parameter>msg_qnum</parameter> is incremented by 1 and
|
||||
<parameter>msg_stime</parameter> is set to the current time.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>msg_remove_queue</function>,
|
||||
<function>msg_receive</function>,
|
||||
<function>msg_stat_queue</function> and
|
||||
<function>msg_set_queue</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
|
@ -1,41 +1,39 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id="function.msg-set-queue">
|
||||
<refnamediv>
|
||||
<refname>msg_set_queue</refname>
|
||||
<refpurpose>
|
||||
Set information in the message queue data structure
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>msg_set_queue</methodname>
|
||||
<methodparam><type>resource</type><parameter>queue</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter>data</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>msg_set_queue</function> allows you to change the values of the
|
||||
msg_perm.uid, msg_perm.gid, msg_perm.mode and msg_qbytes fields of the
|
||||
underlying message queue data structure.
|
||||
You specify the values you require by setting the value of the keys that
|
||||
you require in the <parameter>data</parameter> array.
|
||||
</para>
|
||||
<para>
|
||||
Changing the data structure will require that PHP be running as the same
|
||||
user that created the queue, owns the queue (as determined by the
|
||||
existing msg_perm.xxx fields), or be running with root privileges.
|
||||
root privileges are required to raise the msg_qbytes values above the
|
||||
system defined limit.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>msg_remove_queue</function>,
|
||||
<function>msg_receive</function>,
|
||||
<function>msg_stat_queue</function> and
|
||||
<function>msg_get_queue</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id="function.msg-set-queue">
|
||||
<refnamediv>
|
||||
<refname>msg_set_queue</refname>
|
||||
<refpurpose>Set information in the message queue data structure</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>msg_set_queue</methodname>
|
||||
<methodparam><type>resource</type><parameter>queue</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter>data</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>msg_set_queue</function> allows you to change the values of the
|
||||
msg_perm.uid, msg_perm.gid, msg_perm.mode and msg_qbytes fields of the
|
||||
underlying message queue data structure.
|
||||
You specify the values you require by setting the value of the keys that
|
||||
you require in the <parameter>data</parameter> array.
|
||||
</para>
|
||||
<para>
|
||||
Changing the data structure will require that PHP be running as the same
|
||||
user that created the queue, owns the queue (as determined by the
|
||||
existing msg_perm.xxx fields), or be running with root privileges.
|
||||
root privileges are required to raise the msg_qbytes values above the
|
||||
system defined limit.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>msg_remove_queue</function>,
|
||||
<function>msg_receive</function>,
|
||||
<function>msg_stat_queue</function> and
|
||||
<function>msg_get_queue</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,104 +1,102 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id="function.msg-stat-queue">
|
||||
<refnamediv>
|
||||
<refname>msg_stat_queue</refname>
|
||||
<refpurpose>
|
||||
Returns information from the message queue data structure
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>msg_stat_queue</methodname>
|
||||
<methodparam><type>resource</type><parameter>queue</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>msg_stat_queue</function> returns the message queue meta data
|
||||
for the message queue specified by the <parameter>queue</parameter>.
|
||||
This is useful, for example, to determine which process sent the message
|
||||
that was just received.
|
||||
</para>
|
||||
<para>
|
||||
The return value is an array whose keys and values have the following
|
||||
meanings:
|
||||
<table>
|
||||
<title>Array structure for msg_stat_queue</title>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>msg_perm.uid</literal></entry>
|
||||
<entry>
|
||||
The uid of the owner of the queue.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_perm.gid</literal></entry>
|
||||
<entry>
|
||||
The gid of the owner of the queue.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_perm.mode</literal></entry>
|
||||
<entry>
|
||||
The file access mode of the queue.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_stime</literal></entry>
|
||||
<entry>
|
||||
The time that the last message was sent to the queue.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_rtime</literal></entry>
|
||||
<entry>
|
||||
The time that the last message was received from the queue.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_ctime</literal></entry>
|
||||
<entry>
|
||||
The time that the queue was last changed.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_qnum</literal></entry>
|
||||
<entry>
|
||||
The number of messages waiting to be read from the queue.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_qbytes</literal></entry>
|
||||
<entry>
|
||||
The number of bytes of space currently available in the queue to
|
||||
hold sent messages until they are received.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_lspid</literal></entry>
|
||||
<entry>
|
||||
The pid of the process that sent the last message to the queue.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_lrpid</literal></entry>
|
||||
<entry>
|
||||
The pid of the process that received the last message from the queue.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>msg_remove_queue</function>,
|
||||
<function>msg_receive</function>,
|
||||
<function>msg_get_queue</function> and
|
||||
<function>msg_set_queue</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id="function.msg-stat-queue">
|
||||
<refnamediv>
|
||||
<refname>msg_stat_queue</refname>
|
||||
<refpurpose>Returns information from the message queue data structure</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>msg_stat_queue</methodname>
|
||||
<methodparam><type>resource</type><parameter>queue</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>msg_stat_queue</function> returns the message queue meta data
|
||||
for the message queue specified by the <parameter>queue</parameter>.
|
||||
This is useful, for example, to determine which process sent the message
|
||||
that was just received.
|
||||
</para>
|
||||
<para>
|
||||
The return value is an array whose keys and values have the following
|
||||
meanings:
|
||||
<table>
|
||||
<title>Array structure for msg_stat_queue</title>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>msg_perm.uid</literal></entry>
|
||||
<entry>
|
||||
The uid of the owner of the queue.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_perm.gid</literal></entry>
|
||||
<entry>
|
||||
The gid of the owner of the queue.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_perm.mode</literal></entry>
|
||||
<entry>
|
||||
The file access mode of the queue.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_stime</literal></entry>
|
||||
<entry>
|
||||
The time that the last message was sent to the queue.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_rtime</literal></entry>
|
||||
<entry>
|
||||
The time that the last message was received from the queue.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_ctime</literal></entry>
|
||||
<entry>
|
||||
The time that the queue was last changed.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_qnum</literal></entry>
|
||||
<entry>
|
||||
The number of messages waiting to be read from the queue.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_qbytes</literal></entry>
|
||||
<entry>
|
||||
The number of bytes of space currently available in the queue to
|
||||
hold sent messages until they are received.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_lspid</literal></entry>
|
||||
<entry>
|
||||
The pid of the process that sent the last message to the queue.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>msg_lrpid</literal></entry>
|
||||
<entry>
|
||||
The pid of the process that received the last message from the queue.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>msg_remove_queue</function>,
|
||||
<function>msg_receive</function>,
|
||||
<function>msg_get_queue</function> and
|
||||
<function>msg_set_queue</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/sem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.sem-acquire">
|
||||
<refnamediv>
|
||||
<refname>sem_acquire</refname>
|
||||
<refpurpose>Acquire a semaphore</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sem_acquire</methodname>
|
||||
<methodparam><type>resource</type><parameter>sem_identifier</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>sem_acquire</function> blocks (if necessary) until the
|
||||
semaphore can be acquired. A process attempting to acquire a
|
||||
semaphore which it has already acquired will block forever
|
||||
if acquiring the semaphore would cause its maximum number
|
||||
of semaphore to be exceeded.
|
||||
<parameter>sem_identifier</parameter> is a semaphore resource,
|
||||
obtained from <function>sem_get</function>.
|
||||
</para>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
After processing a request, any semaphores acquired by the
|
||||
process but not explicitly released will be released automatically
|
||||
and a warning will be generated.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>sem_get</function>, and
|
||||
<function>sem_release</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.sem-acquire">
|
||||
<refnamediv>
|
||||
<refname>sem_acquire</refname>
|
||||
<refpurpose>Acquire a semaphore</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sem_acquire</methodname>
|
||||
<methodparam><type>resource</type><parameter>sem_identifier</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>sem_acquire</function> blocks (if necessary) until the
|
||||
semaphore can be acquired. A process attempting to acquire a
|
||||
semaphore which it has already acquired will block forever
|
||||
if acquiring the semaphore would cause its maximum number
|
||||
of semaphore to be exceeded.
|
||||
<parameter>sem_identifier</parameter> is a semaphore resource,
|
||||
obtained from <function>sem_get</function>.
|
||||
</para>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
After processing a request, any semaphores acquired by the
|
||||
process but not explicitly released will be released automatically
|
||||
and a warning will be generated.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>sem_get</function>, and
|
||||
<function>sem_release</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,49 +1,49 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- splitted from ./en/functions/sem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.sem-get">
|
||||
<refnamediv>
|
||||
<refname>sem_get</refname>
|
||||
<refpurpose>Get a semaphore id</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>sem_get</methodname>
|
||||
<methodparam><type>int</type><parameter>key</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>max_acquire</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>perm</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>auto_release</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>sem_get</function> returns an id that can be used to
|
||||
access the System V semaphore with the given <parameter>key</parameter>.
|
||||
The semaphore is created if necessary using the permission bits specified in
|
||||
<parameter>perm</parameter> (defaults to 0666). The number of processes that can
|
||||
acquire the semaphore simultaneously is set to <parameter>max_acquire</parameter>
|
||||
(defaults to 1). Actually this value is set only if the process
|
||||
finds it is the only process currently attached to the semaphore.
|
||||
</para>
|
||||
<para>
|
||||
Optional parameter <parameter>auto_release</parameter> specifies if the
|
||||
semaphore should be automatically released on request shutdown.
|
||||
It is available since PHP 4.3.0.
|
||||
</para>
|
||||
<para>
|
||||
Returns a positive semaphore identifier on success, or &false; on
|
||||
error.
|
||||
</para>
|
||||
<para>
|
||||
A second call to <function>sem_get</function> for the same key
|
||||
will return a different semaphore identifier, but both
|
||||
identifiers access the same underlying semaphore.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>sem_acquire</function>,
|
||||
<function>sem_release</function>, and <function>ftok</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.sem-get">
|
||||
<refnamediv>
|
||||
<refname>sem_get</refname>
|
||||
<refpurpose>Get a semaphore id</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>sem_get</methodname>
|
||||
<methodparam><type>int</type><parameter>key</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>max_acquire</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>perm</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>auto_release</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>sem_get</function> returns an id that can be used to
|
||||
access the System V semaphore with the given <parameter>key</parameter>.
|
||||
The semaphore is created if necessary using the permission bits specified in
|
||||
<parameter>perm</parameter> (defaults to 0666). The number of processes that can
|
||||
acquire the semaphore simultaneously is set to <parameter>max_acquire</parameter>
|
||||
(defaults to 1). Actually this value is set only if the process
|
||||
finds it is the only process currently attached to the semaphore.
|
||||
</para>
|
||||
<para>
|
||||
Optional parameter <parameter>auto_release</parameter> specifies if the
|
||||
semaphore should be automatically released on request shutdown.
|
||||
It is available since PHP 4.3.0.
|
||||
</para>
|
||||
<para>
|
||||
Returns a positive semaphore identifier on success, or &false; on
|
||||
error.
|
||||
</para>
|
||||
<para>
|
||||
A second call to <function>sem_get</function> for the same key
|
||||
will return a different semaphore identifier, but both
|
||||
identifiers access the same underlying semaphore.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>sem_acquire</function>,
|
||||
<function>sem_release</function>, and <function>ftok</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.sem-release">
|
||||
<refnamediv>
|
||||
<refname>sem_release</refname>
|
||||
<refpurpose>Release a semaphore</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sem_release</methodname>
|
||||
<methodparam><type>resource</type><parameter>sem_identifier</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>sem_release</function> releases the semaphore if it
|
||||
is currently acquired by the calling process, otherwise
|
||||
a warning is generated.
|
||||
</para>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
After releasing the semaphore, <function>sem_acquire</function>
|
||||
may be called to re-acquire it.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>sem_get</function> and
|
||||
<function>sem_acquire</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.sem-release">
|
||||
<refnamediv>
|
||||
<refname>sem_release</refname>
|
||||
<refpurpose>Release a semaphore</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sem_release</methodname>
|
||||
<methodparam><type>resource</type><parameter>sem_identifier</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>sem_release</function> releases the semaphore if it
|
||||
is currently acquired by the calling process, otherwise
|
||||
a warning is generated.
|
||||
</para>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
After releasing the semaphore, <function>sem_acquire</function>
|
||||
may be called to re-acquire it.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>sem_get</function> and
|
||||
<function>sem_acquire</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sem.xml, last change in rev 1.7 -->
|
||||
<refentry id="function.sem-remove">
|
||||
<refnamediv>
|
||||
<refname>sem_remove</refname>
|
||||
<refpurpose>Remove a semaphore</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sem_remove</methodname>
|
||||
<methodparam><type>resource</type><parameter>sem_identifier</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>sem_remove</function> removes the semaphore
|
||||
<parameter>sem_identifier</parameter> if it
|
||||
has been created by <function>sem_get</function>,
|
||||
otherwise generates a warning.
|
||||
</para>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
After removing the semaphore, it is no more accessible.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>sem_get</function>,
|
||||
<function>sem_release</function> and
|
||||
<function>sem_acquire</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.sem-remove">
|
||||
<refnamediv>
|
||||
<refname>sem_remove</refname>
|
||||
<refpurpose>Remove a semaphore</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sem_remove</methodname>
|
||||
<methodparam><type>resource</type><parameter>sem_identifier</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>sem_remove</function> removes the semaphore
|
||||
<parameter>sem_identifier</parameter> if it
|
||||
has been created by <function>sem_get</function>,
|
||||
otherwise generates a warning.
|
||||
</para>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
After removing the semaphore, it is no more accessible.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>sem_get</function>,
|
||||
<function>sem_release</function> and
|
||||
<function>sem_acquire</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,39 +1,39 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- splitted from ./en/functions/sem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.shm-attach">
|
||||
<refnamediv>
|
||||
<refname>shm_attach</refname>
|
||||
<refpurpose>Creates or open a shared memory segment</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>shm_attach</methodname>
|
||||
<methodparam><type>int</type><parameter>key</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>memsize</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>perm</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>shm_attach</function> returns an id that can be
|
||||
used to access the System V shared memory with the given <parameter>key</parameter>, the
|
||||
first call creates the shared memory segment with <parameter>memsize</parameter>
|
||||
(default: sysvshm.init_mem in the &php.ini;, otherwise
|
||||
10000 bytes) and the optional perm-bits <parameter>perm</parameter>
|
||||
(default: 0666).
|
||||
</para>
|
||||
<para>
|
||||
A second call to <function>shm_attach</function> for the same
|
||||
<parameter>key</parameter> will return a different shared memory
|
||||
identifier, but both identifiers access the same underlying
|
||||
shared memory. <parameter>Memsize</parameter> and
|
||||
<parameter>perm</parameter> will be ignored.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>ftok</function>, and <function>shm_detach</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.shm-attach">
|
||||
<refnamediv>
|
||||
<refname>shm_attach</refname>
|
||||
<refpurpose>Creates or open a shared memory segment</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>shm_attach</methodname>
|
||||
<methodparam><type>int</type><parameter>key</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>memsize</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>perm</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>shm_attach</function> returns an id that can be
|
||||
used to access the System V shared memory with the given <parameter>key</parameter>, the
|
||||
first call creates the shared memory segment with <parameter>memsize</parameter>
|
||||
(default: sysvshm.init_mem in the &php.ini;, otherwise
|
||||
10000 bytes) and the optional perm-bits <parameter>perm</parameter>
|
||||
(default: 0666).
|
||||
</para>
|
||||
<para>
|
||||
A second call to <function>shm_attach</function> for the same
|
||||
<parameter>key</parameter> will return a different shared memory
|
||||
identifier, but both identifiers access the same underlying
|
||||
shared memory. <parameter>Memsize</parameter> and
|
||||
<parameter>perm</parameter> will be ignored.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>ftok</function>, and <function>shm_detach</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.shm-detach">
|
||||
<refnamediv>
|
||||
<refname>shm_detach</refname>
|
||||
<refpurpose>Disconnects from shared memory segment</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>shm_detach</methodname>
|
||||
<methodparam><type>int</type><parameter>shm_identifier</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>shm_detach</function> disconnects from the shared
|
||||
memory given by the <parameter>shm_identifier</parameter> created
|
||||
by <function>shm_attach</function>. Remember, that shared memory
|
||||
still exist in the Unix system and the data is still present.
|
||||
</para>
|
||||
<para>
|
||||
<function>shm_detach</function> always returns &true;.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>shm_attach</function>, <function>shm_remove</function>,
|
||||
and <function>shm_remove_var</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.shm-detach">
|
||||
<refnamediv>
|
||||
<refname>shm_detach</refname>
|
||||
<refpurpose>Disconnects from shared memory segment</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>shm_detach</methodname>
|
||||
<methodparam><type>int</type><parameter>shm_identifier</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>shm_detach</function> disconnects from the shared
|
||||
memory given by the <parameter>shm_identifier</parameter> created
|
||||
by <function>shm_attach</function>. Remember, that shared memory
|
||||
still exist in the Unix system and the data is still present.
|
||||
</para>
|
||||
<para>
|
||||
<function>shm_detach</function> always returns &true;.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>shm_attach</function>, <function>shm_remove</function>,
|
||||
and <function>shm_remove_var</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/sem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.shm-get-var">
|
||||
<refnamediv>
|
||||
<refname>shm_get_var</refname>
|
||||
<refpurpose>Returns a variable from shared memory</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>shm_get_var</methodname>
|
||||
<methodparam><type>int</type><parameter>shm_identifier</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>variable_key</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>shm_get_var</function> returns the variable with a given
|
||||
<parameter>variable_key</parameter>, in the shared memory
|
||||
segment identified by <parameter>shm_identifier</parameter>.
|
||||
<parameter>shm_identifier</parameter> was obtained from
|
||||
<function>shm_attach</function>. The variable is still present
|
||||
in the shared memory.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.shm-get-var">
|
||||
<refnamediv>
|
||||
<refname>shm_get_var</refname>
|
||||
<refpurpose>Returns a variable from shared memory</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>shm_get_var</methodname>
|
||||
<methodparam><type>int</type><parameter>shm_identifier</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>variable_key</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>shm_get_var</function> returns the variable with a given
|
||||
<parameter>variable_key</parameter>, in the shared memory
|
||||
segment identified by <parameter>shm_identifier</parameter>.
|
||||
<parameter>shm_identifier</parameter> was obtained from
|
||||
<function>shm_attach</function>. The variable is still present
|
||||
in the shared memory.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,38 +1,36 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.shm-put-var">
|
||||
<refnamediv>
|
||||
<refname>shm_put_var</refname>
|
||||
<refpurpose>
|
||||
Inserts or updates a variable in shared memory
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>shm_put_var</methodname>
|
||||
<methodparam><type>int</type><parameter>shm_identifier</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>variable_key</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>variable</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>shm_put_var</function> inserts or updates the
|
||||
<parameter>variable</parameter> with the given
|
||||
<parameter>variable_key</parameter>.
|
||||
<link linkend="language.types">All variable-types</link> are supported.
|
||||
</para>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
Warnings (<literal>E_WARNING</literal> level) will be issued if
|
||||
<parameter>shm_identifier</parameter> is not a valid SysV shared memory
|
||||
index or if there was not enough shared memory remaining to complete your
|
||||
request.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.shm-put-var">
|
||||
<refnamediv>
|
||||
<refname>shm_put_var</refname>
|
||||
<refpurpose>Inserts or updates a variable in shared memory</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>shm_put_var</methodname>
|
||||
<methodparam><type>int</type><parameter>shm_identifier</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>variable_key</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>variable</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>shm_put_var</function> inserts or updates the
|
||||
<parameter>variable</parameter> with the given
|
||||
<parameter>variable_key</parameter>.
|
||||
<link linkend="language.types">All variable-types</link> are supported.
|
||||
</para>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
Warnings (<literal>E_WARNING</literal> level) will be issued if
|
||||
<parameter>shm_identifier</parameter> is not a valid SysV shared memory
|
||||
index or if there was not enough shared memory remaining to complete your
|
||||
request.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sem.xml, last change in rev 1.18 -->
|
||||
<refentry id="function.shm-remove-var">
|
||||
<refnamediv>
|
||||
<refname>shm_remove_var</refname>
|
||||
<refpurpose>Removes a variable from shared memory
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>shm_remove_var</methodname>
|
||||
<methodparam><type>int</type><parameter>shm_identifier</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>variable_key</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Removes a variable with a given <parameter>variable_key</parameter>
|
||||
and frees the occupied memory.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>shm_remove</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.shm-remove-var">
|
||||
<refnamediv>
|
||||
<refname>shm_remove_var</refname>
|
||||
<refpurpose>Removes a variable from shared memory
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>shm_remove_var</methodname>
|
||||
<methodparam><type>int</type><parameter>shm_identifier</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>variable_key</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Removes a variable with a given <parameter>variable_key</parameter>
|
||||
and frees the occupied memory.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>shm_remove</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.shm-remove">
|
||||
<refnamediv>
|
||||
<refname>shm_remove</refname>
|
||||
<refpurpose>Removes shared memory from Unix systems</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>shm_remove</methodname>
|
||||
<methodparam><type>int</type><parameter>shm_identifier</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>shm_remove</function> removes the shared memory
|
||||
<parameter>shm_identifier</parameter>. All data will be destroyed.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>shm_remove_var</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.shm-remove">
|
||||
<refnamediv>
|
||||
<refname>shm_remove</refname>
|
||||
<refpurpose>Removes shared memory from Unix systems</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>shm_remove</methodname>
|
||||
<methodparam><type>int</type><parameter>shm_identifier</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>shm_remove</function> removes the shared memory
|
||||
<parameter>shm_identifier</parameter>. All data will be destroyed.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>shm_remove_var</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.38 -->
|
||||
<refentry id='function.session-cache-expire'>
|
||||
<refnamediv>
|
||||
<refname>session_cache_expire</refname>
|
||||
<refpurpose>Return current cache expire</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>session_cache_expire</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>new_cache_expire</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_cache_expire</function> returns the current setting of
|
||||
<literal>session.cache_expire</literal>. The value returned should be read
|
||||
in minutes, defaults to 180. If <parameter>new_cache_expire</parameter>
|
||||
is given, the current cache expire is replaced with
|
||||
<parameter>new_cache_expire</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
The cache expire is reset to the default value of 180 stored in
|
||||
<literal>session.cache_limiter</literal> at request startup time. Thus,
|
||||
you need to call <function>session_cache_expire</function> for every
|
||||
request (and before <function>session_start</function> is called).
|
||||
</para>
|
||||
<example>
|
||||
<title><function>session_cache_expire</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id='function.session-cache-expire'>
|
||||
<refnamediv>
|
||||
<refname>session_cache_expire</refname>
|
||||
<refpurpose>Return current cache expire</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>session_cache_expire</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>new_cache_expire</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_cache_expire</function> returns the current setting of
|
||||
<literal>session.cache_expire</literal>. The value returned should be read
|
||||
in minutes, defaults to 180. If <parameter>new_cache_expire</parameter>
|
||||
is given, the current cache expire is replaced with
|
||||
<parameter>new_cache_expire</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
The cache expire is reset to the default value of 180 stored in
|
||||
<literal>session.cache_limiter</literal> at request startup time. Thus,
|
||||
you need to call <function>session_cache_expire</function> for every
|
||||
request (and before <function>session_start</function> is called).
|
||||
</para>
|
||||
<example>
|
||||
<title><function>session_cache_expire</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
|
@ -48,22 +48,22 @@ echo "The cache limiter is now set to $cache_limiter<br />";
|
|||
echo "The cached session pages expire after $cache_expire minutes";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<note>
|
||||
<simpara>
|
||||
Setting <parameter>new_cache_expire</parameter> is of value only, if
|
||||
<literal>session.cache_limiter</literal> is set to a value
|
||||
<emphasis>different</emphasis> from <literal>nocache</literal>.
|
||||
</simpara>
|
||||
</note>
|
||||
<para>
|
||||
See also the configuration settings <link linkend="ini.session.cache-expire">
|
||||
session.cache_expire</link>, <link linkend="ini.session.cache-limiter">
|
||||
session.cache_limiter</link> and <function>session_cache_limiter</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
<note>
|
||||
<simpara>
|
||||
Setting <parameter>new_cache_expire</parameter> is of value only, if
|
||||
<literal>session.cache_limiter</literal> is set to a value
|
||||
<emphasis>different</emphasis> from <literal>nocache</literal>.
|
||||
</simpara>
|
||||
</note>
|
||||
<para>
|
||||
See also the configuration settings <link linkend="ini.session.cache-expire">
|
||||
session.cache_expire</link>, <link linkend="ini.session.cache-limiter">
|
||||
session.cache_limiter</link> and <function>session_cache_limiter</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,54 +1,54 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.62 -->
|
||||
<refentry id="function.session-cache-limiter">
|
||||
<refnamediv>
|
||||
<refname>session_cache_limiter</refname>
|
||||
<refpurpose>Get and/or set the current cache limiter</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>session_cache_limiter</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>cache_limiter</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_cache_limiter</function> returns the name of the
|
||||
current cache limiter. If <parameter>cache_limiter</parameter>
|
||||
is specified, the name of the current cache limiter is changed to the
|
||||
new value.
|
||||
</para>
|
||||
<para>
|
||||
The cache limiter defines which cache control HTTP headers are sent to
|
||||
the client. These headers determine the rules by which the page content
|
||||
may be cached by the client and intermediate proxies. Setting the cache
|
||||
limiter to <literal>nocache</literal> disallows any client/proxy caching.
|
||||
A value of <literal>public</literal> permits caching by proxies and the
|
||||
client, whereas <literal>private</literal> disallows caching by proxies
|
||||
and permits the client to cache the contents.
|
||||
</para>
|
||||
<para>
|
||||
In <literal>private</literal> mode, the Expire header sent to the
|
||||
client may cause confusion for some browsers, including Mozilla.
|
||||
You can avoid this problem by using
|
||||
<literal>private_no_expire</literal> mode. The expire header is never
|
||||
sent to the client in this mode.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<literal>private_no_expire</literal> was added in PHP 4.2.0.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
The cache limiter is reset to the default value stored in
|
||||
<link linkend="ini.session.cache-limiter">session.cache_limiter</link>
|
||||
at request startup time. Thus, you need to call
|
||||
<function>session_cache_limiter</function> for every
|
||||
request (and before <function>session_start</function> is called).
|
||||
</para>
|
||||
<example>
|
||||
<title><function>session_cache_limiter</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.session-cache-limiter">
|
||||
<refnamediv>
|
||||
<refname>session_cache_limiter</refname>
|
||||
<refpurpose>Get and/or set the current cache limiter</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>session_cache_limiter</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>cache_limiter</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_cache_limiter</function> returns the name of the
|
||||
current cache limiter. If <parameter>cache_limiter</parameter>
|
||||
is specified, the name of the current cache limiter is changed to the
|
||||
new value.
|
||||
</para>
|
||||
<para>
|
||||
The cache limiter defines which cache control HTTP headers are sent to
|
||||
the client. These headers determine the rules by which the page content
|
||||
may be cached by the client and intermediate proxies. Setting the cache
|
||||
limiter to <literal>nocache</literal> disallows any client/proxy caching.
|
||||
A value of <literal>public</literal> permits caching by proxies and the
|
||||
client, whereas <literal>private</literal> disallows caching by proxies
|
||||
and permits the client to cache the contents.
|
||||
</para>
|
||||
<para>
|
||||
In <literal>private</literal> mode, the Expire header sent to the
|
||||
client may cause confusion for some browsers, including Mozilla.
|
||||
You can avoid this problem by using
|
||||
<literal>private_no_expire</literal> mode. The expire header is never
|
||||
sent to the client in this mode.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<literal>private_no_expire</literal> was added in PHP 4.2.0.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
The cache limiter is reset to the default value stored in
|
||||
<link linkend="ini.session.cache-limiter">session.cache_limiter</link>
|
||||
at request startup time. Thus, you need to call
|
||||
<function>session_cache_limiter</function> for every
|
||||
request (and before <function>session_start</function> is called).
|
||||
</para>
|
||||
<example>
|
||||
<title><function>session_cache_limiter</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
|
@ -60,14 +60,14 @@ $cache_limiter = session_cache_limiter();
|
|||
echo "The cache limiter is now set to $cache_limiter<br />";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Also see the <link linkend="ini.session.cache-limiter">session.cache_limiter</link>
|
||||
configuration directive.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Also see the <link linkend="ini.session.cache-limiter">session.cache_limiter</link>
|
||||
configuration directive.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.session-decode">
|
||||
<refnamediv>
|
||||
<refname>session_decode</refname>
|
||||
<refpurpose>Decodes session data from a string</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>session_decode</methodname>
|
||||
<methodparam><type>string</type><parameter>data</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_decode</function> decodes the session data in
|
||||
<parameter>data</parameter>, setting variables stored in the
|
||||
session.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>session_encode</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.session-decode">
|
||||
<refnamediv>
|
||||
<refname>session_decode</refname>
|
||||
<refpurpose>Decodes session data from a string</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>session_decode</methodname>
|
||||
<methodparam><type>string</type><parameter>data</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_decode</function> decodes the session data in
|
||||
<parameter>data</parameter>, setting variables stored in the
|
||||
session.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>session_encode</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.session-destroy">
|
||||
<refnamediv>
|
||||
<refname>session_destroy</refname>
|
||||
<refpurpose>Destroys all data registered to a session</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>session_destroy</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
<function>session_destroy</function> destroys all of the data
|
||||
associated with the current session. It does not unset any of
|
||||
the global variables associated with the session, or unset the
|
||||
session cookie.
|
||||
</simpara>
|
||||
<para>
|
||||
In order to kill the session altogether, like to log the user out, the
|
||||
session id must also be unset. If a cookie is used to propagate the
|
||||
session id (default behavior), then the session cookie must be deleted.
|
||||
<function>setcookie</function> may be used for that.
|
||||
</para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</simpara>
|
||||
<para>
|
||||
<example>
|
||||
<title>Destroying a session with <varname>$_SESSION</varname></title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.session-destroy">
|
||||
<refnamediv>
|
||||
<refname>session_destroy</refname>
|
||||
<refpurpose>Destroys all data registered to a session</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>session_destroy</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
<function>session_destroy</function> destroys all of the data
|
||||
associated with the current session. It does not unset any of
|
||||
the global variables associated with the session, or unset the
|
||||
session cookie.
|
||||
</simpara>
|
||||
<para>
|
||||
In order to kill the session altogether, like to log the user out, the
|
||||
session id must also be unset. If a cookie is used to propagate the
|
||||
session id (default behavior), then the session cookie must be deleted.
|
||||
<function>setcookie</function> may be used for that.
|
||||
</para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</simpara>
|
||||
<para>
|
||||
<example>
|
||||
<title>Destroying a session with <varname>$_SESSION</varname></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Initialize the session.
|
||||
|
@ -50,22 +50,22 @@ if (isset($_COOKIE[session_name()])) {
|
|||
session_destroy();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Only use <function>session_unset</function> for older deprecated code
|
||||
that does not use <varname>$_SESSION</varname>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>unset</function> and
|
||||
<function>setcookie</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Only use <function>session_unset</function> for older deprecated code
|
||||
that does not use <varname>$_SESSION</varname>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>unset</function> and
|
||||
<function>setcookie</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,29 +1,27 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.session-encode">
|
||||
<refnamediv>
|
||||
<refname>session_encode</refname>
|
||||
<refpurpose>
|
||||
Encodes the current session data as a string
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>session_encode</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_encode</function> returns a string with the
|
||||
contents of the current session encoded within.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>session_decode</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.session-encode">
|
||||
<refnamediv>
|
||||
<refname>session_encode</refname>
|
||||
<refpurpose>Encodes the current session data as a string</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>session_encode</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_encode</function> returns a string with the
|
||||
contents of the current session encoded within.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>session_decode</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,64 +1,62 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.8 -->
|
||||
<refentry id="function.session-get-cookie-params">
|
||||
<refnamediv>
|
||||
<refname>session_get_cookie_params</refname>
|
||||
<refpurpose>
|
||||
Get the session cookie parameters
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>session_get_cookie_params</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>session_get_cookie_params</function> function returns an
|
||||
array with the current session cookie information, the array contains
|
||||
the following items:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"lifetime" - The lifetime of the cookie in seconds.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"path" - The path where information is stored.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"domain" - The domain of the cookie.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"secure" - The cookie should only be sent over secure connections.
|
||||
(This item was added in PHP 4.0.4.)
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"httponly" - The cookie can only be accessed through the HTTP protocol
|
||||
(This item was added in PHP 5.2.0).
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
See also the configuration directives
|
||||
<link linkend="ini.session.cookie-lifetime">session.cookie_lifetime</link>,
|
||||
<link linkend="ini.session.cookie-path">session.cookie_path</link>,
|
||||
<link linkend="ini.session.cookie-domain">session.cookie_domain</link>,
|
||||
<link linkend="ini.session.cookie-secure">session.cookie_secure</link>,
|
||||
<link linkend="ini.session.cookie-httponly">session.cookie_httponly</link>, and
|
||||
<function>session_set_cookie_params</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.session-get-cookie-params">
|
||||
<refnamediv>
|
||||
<refname>session_get_cookie_params</refname>
|
||||
<refpurpose>Get the session cookie parameters</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>session_get_cookie_params</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>session_get_cookie_params</function> function returns an
|
||||
array with the current session cookie information, the array contains
|
||||
the following items:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"lifetime" - The lifetime of the cookie in seconds.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"path" - The path where information is stored.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"domain" - The domain of the cookie.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"secure" - The cookie should only be sent over secure connections.
|
||||
(This item was added in PHP 4.0.4.)
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"httponly" - The cookie can only be accessed through the HTTP protocol
|
||||
(This item was added in PHP 5.2.0).
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
See also the configuration directives
|
||||
<link linkend="ini.session.cookie-lifetime">session.cookie_lifetime</link>,
|
||||
<link linkend="ini.session.cookie-path">session.cookie_path</link>,
|
||||
<link linkend="ini.session.cookie-domain">session.cookie_domain</link>,
|
||||
<link linkend="ini.session.cookie-secure">session.cookie_secure</link>,
|
||||
<link linkend="ini.session.cookie-httponly">session.cookie_httponly</link>, and
|
||||
<function>session_set_cookie_params</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,43 +1,41 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.8 -->
|
||||
<refentry id="function.session-is-registered">
|
||||
<refnamediv>
|
||||
<refname>session_is_registered</refname>
|
||||
<refpurpose>
|
||||
Find out whether a global variable is registered in a session
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>session_is_registered</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_is_registered</function> returns &true; if there
|
||||
is a global variable with the name <parameter>name</parameter>
|
||||
registered in the current session.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
If <varname>$_SESSION</varname> (or
|
||||
<varname>$HTTP_SESSION_VARS</varname> for PHP 4.0.6 or less) is
|
||||
used, use <function>isset</function> to check a variable is
|
||||
registered in <varname>$_SESSION</varname>.
|
||||
</para>
|
||||
</note>
|
||||
<caution>
|
||||
<para>
|
||||
If you are using
|
||||
<varname>$_SESSION</varname> (or <varname>$HTTP_SESSION_VARS</varname>),
|
||||
do not use <function>session_register</function>,
|
||||
<function>session_is_registered</function> and
|
||||
<function>session_unregister</function>.
|
||||
</para>
|
||||
</caution>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.session-is-registered">
|
||||
<refnamediv>
|
||||
<refname>session_is_registered</refname>
|
||||
<refpurpose>Find out whether a global variable is registered in a session</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>session_is_registered</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_is_registered</function> returns &true; if there
|
||||
is a global variable with the name <parameter>name</parameter>
|
||||
registered in the current session.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
If <varname>$_SESSION</varname> (or
|
||||
<varname>$HTTP_SESSION_VARS</varname> for PHP 4.0.6 or less) is
|
||||
used, use <function>isset</function> to check a variable is
|
||||
registered in <varname>$_SESSION</varname>.
|
||||
</para>
|
||||
</note>
|
||||
<caution>
|
||||
<para>
|
||||
If you are using
|
||||
<varname>$_SESSION</varname> (or <varname>$HTTP_SESSION_VARS</varname>),
|
||||
do not use <function>session_register</function>,
|
||||
<function>session_is_registered</function> and
|
||||
<function>session_unregister</function>.
|
||||
</para>
|
||||
</caution>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.session-module-name">
|
||||
<refnamediv>
|
||||
<refname>session_module_name</refname>
|
||||
<refpurpose>Get and/or set the current session module</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>session_module_name</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>module</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_module_name</function> returns the name of the
|
||||
current session module. If <parameter>module</parameter> is
|
||||
specified, that module will be used instead.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.session-module-name">
|
||||
<refnamediv>
|
||||
<refname>session_module_name</refname>
|
||||
<refpurpose>Get and/or set the current session module</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>session_module_name</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>module</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_module_name</function> returns the name of the
|
||||
current session module. If <parameter>module</parameter> is
|
||||
specified, that module will be used instead.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.session-name">
|
||||
<refnamediv>
|
||||
<refname>session_name</refname>
|
||||
<refpurpose>Get and/or set the current session name</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>session_name</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_name</function> returns the name of the current
|
||||
session. If <parameter>name</parameter> is specified, the name of
|
||||
the current session is changed to its value.
|
||||
</para>
|
||||
<para>
|
||||
The session name references the session id in cookies and
|
||||
URLs. It should contain only alphanumeric characters; it should
|
||||
be short and descriptive (i.e. for users with enabled cookie
|
||||
warnings). The session name is reset to the default value
|
||||
stored in <literal>session.name</literal> at request startup
|
||||
time. Thus, you need to call <function>session_name</function>
|
||||
for every request (and before <function>session_start</function>
|
||||
or <function>session_register</function> are called).
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
The session name can't consist of digits only, at least one letter must
|
||||
be present. Otherwise a new session id is generated every time.
|
||||
</para>
|
||||
</warning>
|
||||
<example>
|
||||
<title><function>session_name</function> examples</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.session-name">
|
||||
<refnamediv>
|
||||
<refname>session_name</refname>
|
||||
<refpurpose>Get and/or set the current session name</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>session_name</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_name</function> returns the name of the current
|
||||
session. If <parameter>name</parameter> is specified, the name of
|
||||
the current session is changed to its value.
|
||||
</para>
|
||||
<para>
|
||||
The session name references the session id in cookies and
|
||||
URLs. It should contain only alphanumeric characters; it should
|
||||
be short and descriptive (i.e. for users with enabled cookie
|
||||
warnings). The session name is reset to the default value
|
||||
stored in <literal>session.name</literal> at request startup
|
||||
time. Thus, you need to call <function>session_name</function>
|
||||
for every request (and before <function>session_start</function>
|
||||
or <function>session_register</function> are called).
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
The session name can't consist of digits only, at least one letter must
|
||||
be present. Otherwise a new session id is generated every time.
|
||||
</para>
|
||||
</warning>
|
||||
<example>
|
||||
<title><function>session_name</function> examples</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
|
@ -46,14 +46,14 @@ $previous_name = session_name("WebsiteID");
|
|||
echo "The previous session name was $previous_name<br />";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
See also the <link linkend="ini.session.name">session.name</link>
|
||||
configuration directive.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
See also the <link linkend="ini.session.name">session.name</link>
|
||||
configuration directive.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,79 +1,77 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.session-register">
|
||||
<refnamediv>
|
||||
<refname>session_register</refname>
|
||||
<refpurpose>
|
||||
Register one or more global variables with the current session
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>session_register</methodname>
|
||||
<methodparam><type>mixed</type><parameter>name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_register</function> accepts a variable number of
|
||||
arguments, any of which can be either a string holding the name of a
|
||||
variable or an array consisting of variable names or other arrays. For
|
||||
each name, <function>session_register</function> registers the global
|
||||
variable with that name in the current session.
|
||||
</para>
|
||||
<caution>
|
||||
<para>
|
||||
If you want your script to work regardless of <link
|
||||
linkend="ini.register-globals">register_globals</link>,
|
||||
you need to instead use the
|
||||
<link linkend="reserved.variables.session">$_SESSION</link> array
|
||||
as <varname>$_SESSION</varname> entries are automatically
|
||||
registered. If your script uses
|
||||
<function>session_register</function>, it will not work in
|
||||
environments where the PHP directive
|
||||
<link linkend="ini.register-globals">register_globals</link>
|
||||
is disabled.
|
||||
</para>
|
||||
</caution>
|
||||
|
||||
¬e.registerglobals;
|
||||
|
||||
<caution>
|
||||
<para>
|
||||
This registers a <emphasis>global</emphasis> variable. If you
|
||||
want to register a session variable from within a function, you
|
||||
need to make sure to make it global using the <link
|
||||
linkend="language.variables.scope"><command>global</command></link>
|
||||
keyword or the <varname>$GLOBALS[]</varname> array, or use the
|
||||
special session arrays as noted below.
|
||||
</para>
|
||||
</caution>
|
||||
<caution>
|
||||
<para>
|
||||
If you are using <varname>$_SESSION</varname>
|
||||
(or <varname>$HTTP_SESSION_VARS</varname>), do not use
|
||||
<function>session_register</function>,
|
||||
<function>session_is_registered</function>, and
|
||||
<function>session_unregister</function>.
|
||||
</para>
|
||||
</caution>
|
||||
<para>
|
||||
This function returns &true; when all of the variables are successfully
|
||||
registered with the session.
|
||||
</para>
|
||||
<para>
|
||||
If <function>session_start</function> was not called before this function
|
||||
is called, an implicit call to <function>session_start</function> with no
|
||||
parameters will be made. <varname>$_SESSION</varname> does not mimic
|
||||
this behavior and requires <function>session_start</function> before use.
|
||||
</para>
|
||||
<para>
|
||||
You can also create a session variable by simply setting the
|
||||
appropriate member of the <varname>$_SESSION</varname>
|
||||
or <varname>$HTTP_SESSION_VARS</varname> (PHP < 4.1.0) array.
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.session-register">
|
||||
<refnamediv>
|
||||
<refname>session_register</refname>
|
||||
<refpurpose>Register one or more global variables with the current session</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>session_register</methodname>
|
||||
<methodparam><type>mixed</type><parameter>name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_register</function> accepts a variable number of
|
||||
arguments, any of which can be either a string holding the name of a
|
||||
variable or an array consisting of variable names or other arrays. For
|
||||
each name, <function>session_register</function> registers the global
|
||||
variable with that name in the current session.
|
||||
</para>
|
||||
<caution>
|
||||
<para>
|
||||
If you want your script to work regardless of <link
|
||||
linkend="ini.register-globals">register_globals</link>,
|
||||
you need to instead use the
|
||||
<link linkend="reserved.variables.session">$_SESSION</link> array
|
||||
as <varname>$_SESSION</varname> entries are automatically
|
||||
registered. If your script uses
|
||||
<function>session_register</function>, it will not work in
|
||||
environments where the PHP directive
|
||||
<link linkend="ini.register-globals">register_globals</link>
|
||||
is disabled.
|
||||
</para>
|
||||
</caution>
|
||||
|
||||
¬e.registerglobals;
|
||||
|
||||
<caution>
|
||||
<para>
|
||||
This registers a <emphasis>global</emphasis> variable. If you
|
||||
want to register a session variable from within a function, you
|
||||
need to make sure to make it global using the <link
|
||||
linkend="language.variables.scope"><command>global</command></link>
|
||||
keyword or the <varname>$GLOBALS[]</varname> array, or use the
|
||||
special session arrays as noted below.
|
||||
</para>
|
||||
</caution>
|
||||
<caution>
|
||||
<para>
|
||||
If you are using <varname>$_SESSION</varname>
|
||||
(or <varname>$HTTP_SESSION_VARS</varname>), do not use
|
||||
<function>session_register</function>,
|
||||
<function>session_is_registered</function>, and
|
||||
<function>session_unregister</function>.
|
||||
</para>
|
||||
</caution>
|
||||
<para>
|
||||
This function returns &true; when all of the variables are successfully
|
||||
registered with the session.
|
||||
</para>
|
||||
<para>
|
||||
If <function>session_start</function> was not called before this function
|
||||
is called, an implicit call to <function>session_start</function> with no
|
||||
parameters will be made. <varname>$_SESSION</varname> does not mimic
|
||||
this behavior and requires <function>session_start</function> before use.
|
||||
</para>
|
||||
<para>
|
||||
You can also create a session variable by simply setting the
|
||||
appropriate member of the <varname>$_SESSION</varname>
|
||||
or <varname>$HTTP_SESSION_VARS</varname> (PHP < 4.1.0) array.
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Use of session_register() is deprecated
|
||||
|
@ -87,35 +85,35 @@ $_SESSION["zim"] = "An invader from another planet.";
|
|||
$HTTP_SESSION_VARS["spongebob"] = "He's got square pants.";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
It is currently impossible to register resource variables in a
|
||||
session. For example, you cannot create a connection to a
|
||||
database and store the connection id as a session variable and
|
||||
expect the connection to still be valid the next time the
|
||||
session is restored. PHP functions that return a resource are
|
||||
identified by having a return type of
|
||||
<literal>resource</literal> in their function definition. A
|
||||
list of functions that return resources are available in the
|
||||
<link linkend="resource">resource types</link> appendix.
|
||||
</para>
|
||||
<para>
|
||||
If <varname>$_SESSION</varname> (or
|
||||
<varname>$HTTP_SESSION_VARS</varname> for PHP 4.0.6 or less) is
|
||||
used, assign values to
|
||||
<varname>$_SESSION</varname>. For example: $_SESSION['var'] = 'ABC';
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <function>session_is_registered</function>,
|
||||
<function>session_unregister</function>, and
|
||||
<link linkend="reserved.variables.session">$_SESSION</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
It is currently impossible to register resource variables in a
|
||||
session. For example, you cannot create a connection to a
|
||||
database and store the connection id as a session variable and
|
||||
expect the connection to still be valid the next time the
|
||||
session is restored. PHP functions that return a resource are
|
||||
identified by having a return type of
|
||||
<literal>resource</literal> in their function definition. A
|
||||
list of functions that return resources are available in the
|
||||
<link linkend="resource">resource types</link> appendix.
|
||||
</para>
|
||||
<para>
|
||||
If <varname>$_SESSION</varname> (or
|
||||
<varname>$HTTP_SESSION_VARS</varname> for PHP 4.0.6 or less) is
|
||||
used, assign values to
|
||||
<varname>$_SESSION</varname>. For example: $_SESSION['var'] = 'ABC';
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <function>session_is_registered</function>,
|
||||
<function>session_unregister</function>, and
|
||||
<link linkend="reserved.variables.session">$_SESSION</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.session-save-path">
|
||||
<refnamediv>
|
||||
<refname>session_save_path</refname>
|
||||
<refpurpose>Get and/or set the current session save path</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>session_save_path</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>path</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.session-save-path">
|
||||
<refnamediv>
|
||||
<refname>session_save_path</refname>
|
||||
<refpurpose>Get and/or set the current session save path</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>session_save_path</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>path</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_save_path</function> returns the path of the current
|
||||
directory used to save session data. If <parameter>path</parameter>
|
||||
is specified, the path to which data is saved will be changed.
|
||||
<function>session_save_path</function> needs to be called before
|
||||
<function>session_start</function> for that purpose.
|
||||
<note>
|
||||
<para>
|
||||
<function>session_save_path</function> returns the path of the current
|
||||
directory used to save session data. If <parameter>path</parameter>
|
||||
is specified, the path to which data is saved will be changed.
|
||||
<function>session_save_path</function> needs to be called before
|
||||
<function>session_start</function> for that purpose.
|
||||
<note>
|
||||
<para>
|
||||
On some operating systems, you may want to specify a path on a
|
||||
filesystem that handles lots of small files efficiently. For
|
||||
example, on Linux, reiserfs may provide better performance than
|
||||
ext2fs.
|
||||
</para>
|
||||
</note>
|
||||
On some operating systems, you may want to specify a path on a
|
||||
filesystem that handles lots of small files efficiently. For
|
||||
example, on Linux, reiserfs may provide better performance than
|
||||
ext2fs.
|
||||
</para>
|
||||
<para>
|
||||
See also the <link linkend="ini.session.save-path">session.save_path</link>
|
||||
configuration directive.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</note>
|
||||
</para>
|
||||
<para>
|
||||
See also the <link linkend="ini.session.save-path">session.save_path</link>
|
||||
configuration directive.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,47 +1,45 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.session-set-cookie-params">
|
||||
<refnamediv>
|
||||
<refname>session_set_cookie_params</refname>
|
||||
<refpurpose>
|
||||
Set the session cookie parameters
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>session_set_cookie_params</methodname>
|
||||
<methodparam><type>int</type><parameter>lifetime</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>path</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>domain</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>secure</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>httponly</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Set cookie parameters defined in the &php.ini; file. The effect of this
|
||||
function only lasts for the duration of the script. Thus, you need to
|
||||
call <function>session_set_cookie_params</function> for every request and
|
||||
before <function>session_start</function> is called.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
The <parameter>secure</parameter> parameter was added in PHP
|
||||
4.0.4, while the <parameter>httponly</parameter> parameter was added in
|
||||
PHP 5.2.0.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also the configuration directives
|
||||
<link linkend="ini.session.cookie-lifetime">session.cookie_lifetime</link>,
|
||||
<link linkend="ini.session.cookie-path">session.cookie_path</link>,
|
||||
<link linkend="ini.session.cookie-domain">session.cookie_domain</link>,
|
||||
<link linkend="ini.session.cookie-secure">session.cookie_secure</link>,
|
||||
<link linkend="ini.session.cookie-httponly">session.cookie_httponly</link>, and
|
||||
<function>session_get_cookie_params</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.session-set-cookie-params">
|
||||
<refnamediv>
|
||||
<refname>session_set_cookie_params</refname>
|
||||
<refpurpose>Set the session cookie parameters</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>session_set_cookie_params</methodname>
|
||||
<methodparam><type>int</type><parameter>lifetime</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>path</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>domain</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>secure</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>httponly</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Set cookie parameters defined in the &php.ini; file. The effect of this
|
||||
function only lasts for the duration of the script. Thus, you need to
|
||||
call <function>session_set_cookie_params</function> for every request and
|
||||
before <function>session_start</function> is called.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
The <parameter>secure</parameter> parameter was added in PHP
|
||||
4.0.4, while the <parameter>httponly</parameter> parameter was added in
|
||||
PHP 5.2.0.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also the configuration directives
|
||||
<link linkend="ini.session.cookie-lifetime">session.cookie_lifetime</link>,
|
||||
<link linkend="ini.session.cookie-path">session.cookie_path</link>,
|
||||
<link linkend="ini.session.cookie-domain">session.cookie_domain</link>,
|
||||
<link linkend="ini.session.cookie-secure">session.cookie_secure</link>,
|
||||
<link linkend="ini.session.cookie-httponly">session.cookie_httponly</link>, and
|
||||
<function>session_get_cookie_params</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,96 +1,94 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.14 $ -->
|
||||
<!-- $Revision: 1.15 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.23 -->
|
||||
<refentry id="function.session-set-save-handler">
|
||||
<refnamediv>
|
||||
<refname>session_set_save_handler</refname>
|
||||
<refpurpose>
|
||||
Sets user-level session storage functions
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>session_set_save_handler</methodname>
|
||||
<methodparam><type>callback</type><parameter>open</parameter></methodparam>
|
||||
<methodparam><type>callback</type><parameter>close</parameter></methodparam>
|
||||
<methodparam><type>callback</type><parameter>read</parameter></methodparam>
|
||||
<methodparam><type>callback</type><parameter>write</parameter></methodparam>
|
||||
<methodparam><type>callback</type><parameter>destroy</parameter></methodparam>
|
||||
<methodparam><type>callback</type><parameter>gc</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_set_save_handler</function> sets the user-level
|
||||
session storage functions which are used for storing and
|
||||
retrieving data associated with a session. This is most useful
|
||||
when a storage method other than those supplied by PHP sessions
|
||||
is preferred. i.e. Storing the session data in a local database.
|
||||
&return.success;
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
The "write" handler is not executed until after the output
|
||||
stream is closed. Thus, output from debugging statements in the
|
||||
"write" handler will never be seen in the browser. If debugging
|
||||
output is necessary, it is suggested that the debug output be
|
||||
written to a file instead.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
The following example provides file based session
|
||||
storage similar to the PHP sessions default save handler
|
||||
<parameter>files</parameter>. This example could easily be
|
||||
extended to cover database storage using your favorite PHP
|
||||
supported database engine.
|
||||
</para>
|
||||
<para>
|
||||
Read function must return string value always to make save
|
||||
handler work as expected. Return empty string if there is no data
|
||||
to read. Return values from other handlers are converted to
|
||||
boolean expression. &true; for success, &false; for failure.
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
Write and Close handlers are called after destructing objects since PHP
|
||||
5.0.5. Thus destructors can use sessions but session handler can't use
|
||||
objects. In prior versions, they were called in the opposite order. It
|
||||
is possible to call <function>session_write_close</function> from the
|
||||
destructor to solve this chicken and egg problem.
|
||||
</para>
|
||||
</warning>
|
||||
<para>
|
||||
<example>
|
||||
<title>
|
||||
<function>session_set_save_handler</function> example
|
||||
</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.session-set-save-handler">
|
||||
<refnamediv>
|
||||
<refname>session_set_save_handler</refname>
|
||||
<refpurpose>Sets user-level session storage functions</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>session_set_save_handler</methodname>
|
||||
<methodparam><type>callback</type><parameter>open</parameter></methodparam>
|
||||
<methodparam><type>callback</type><parameter>close</parameter></methodparam>
|
||||
<methodparam><type>callback</type><parameter>read</parameter></methodparam>
|
||||
<methodparam><type>callback</type><parameter>write</parameter></methodparam>
|
||||
<methodparam><type>callback</type><parameter>destroy</parameter></methodparam>
|
||||
<methodparam><type>callback</type><parameter>gc</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_set_save_handler</function> sets the user-level
|
||||
session storage functions which are used for storing and
|
||||
retrieving data associated with a session. This is most useful
|
||||
when a storage method other than those supplied by PHP sessions
|
||||
is preferred. i.e. Storing the session data in a local database.
|
||||
&return.success;
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
The "write" handler is not executed until after the output
|
||||
stream is closed. Thus, output from debugging statements in the
|
||||
"write" handler will never be seen in the browser. If debugging
|
||||
output is necessary, it is suggested that the debug output be
|
||||
written to a file instead.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
The following example provides file based session
|
||||
storage similar to the PHP sessions default save handler
|
||||
<parameter>files</parameter>. This example could easily be
|
||||
extended to cover database storage using your favorite PHP
|
||||
supported database engine.
|
||||
</para>
|
||||
<para>
|
||||
Read function must return string value always to make save
|
||||
handler work as expected. Return empty string if there is no data
|
||||
to read. Return values from other handlers are converted to
|
||||
boolean expression. &true; for success, &false; for failure.
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
Write and Close handlers are called after destructing objects since PHP
|
||||
5.0.5. Thus destructors can use sessions but session handler can't use
|
||||
objects. In prior versions, they were called in the opposite order. It
|
||||
is possible to call <function>session_write_close</function> from the
|
||||
destructor to solve this chicken and egg problem.
|
||||
</para>
|
||||
</warning>
|
||||
<para>
|
||||
<example>
|
||||
<title>
|
||||
<function>session_set_save_handler</function> example
|
||||
</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
function open($save_path, $session_name)
|
||||
function open($save_path, $session_name)
|
||||
{
|
||||
global $sess_save_path;
|
||||
|
||||
|
||||
$sess_save_path = $save_path;
|
||||
return(true);
|
||||
}
|
||||
|
||||
function close()
|
||||
function close()
|
||||
{
|
||||
return(true);
|
||||
}
|
||||
|
||||
function read($id)
|
||||
function read($id)
|
||||
{
|
||||
global $sess_save_path;
|
||||
|
||||
|
||||
$sess_file = "$sess_save_path/sess_$id";
|
||||
return (string) @file_get_contents($sess_file);
|
||||
}
|
||||
|
||||
function write($id, $sess_data)
|
||||
function write($id, $sess_data)
|
||||
{
|
||||
global $sess_save_path;
|
||||
|
||||
|
||||
$sess_file = "$sess_save_path/sess_$id";
|
||||
if ($fp = @fopen($sess_file, "w")) {
|
||||
$return = fwrite($fp, $sess_data);
|
||||
|
@ -102,18 +100,18 @@ function write($id, $sess_data)
|
|||
|
||||
}
|
||||
|
||||
function destroy($id)
|
||||
function destroy($id)
|
||||
{
|
||||
global $sess_save_path;
|
||||
|
||||
|
||||
$sess_file = "$sess_save_path/sess_$id";
|
||||
return(@unlink($sess_file));
|
||||
}
|
||||
|
||||
function gc($maxlifetime)
|
||||
function gc($maxlifetime)
|
||||
{
|
||||
global $sess_save_path;
|
||||
|
||||
|
||||
foreach (glob("$sess_save_path/sess_*") as $filename) {
|
||||
if (filemtime($filename) + $maxlifetime < time()) {
|
||||
@unlink($filename);
|
||||
|
@ -130,15 +128,15 @@ session_start();
|
|||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also the <link linkend="ini.session.save-handler">session.save_handler</link>
|
||||
configuration directive.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also the <link linkend="ini.session.save-handler">session.save_handler</link>
|
||||
configuration directive.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.session-start">
|
||||
<refnamediv>
|
||||
<refname>session_start</refname>
|
||||
<refpurpose>Initialize session data</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>session_start</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
<function>session_start</function> creates a session or resumes
|
||||
the current one based on the current session id that's being
|
||||
passed via a request, such as GET, POST, or a cookie.
|
||||
</simpara>
|
||||
<simpara>
|
||||
This function always returns &true;.
|
||||
</simpara>
|
||||
<note>
|
||||
<para>
|
||||
If you are using cookie-based sessions, you must call
|
||||
<function>session_start</function> before anything is outputted to the
|
||||
browser.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
<example>
|
||||
<title>A session example: <filename>page1.php</filename></title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.session-start">
|
||||
<refnamediv>
|
||||
<refname>session_start</refname>
|
||||
<refpurpose>Initialize session data</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>session_start</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
<function>session_start</function> creates a session or resumes
|
||||
the current one based on the current session id that's being
|
||||
passed via a request, such as GET, POST, or a cookie.
|
||||
</simpara>
|
||||
<simpara>
|
||||
This function always returns &true;.
|
||||
</simpara>
|
||||
<note>
|
||||
<para>
|
||||
If you are using cookie-based sessions, you must call
|
||||
<function>session_start</function> before anything is outputted to the
|
||||
browser.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
<example>
|
||||
<title>A session example: <filename>page1.php</filename></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// page1.php
|
||||
|
@ -50,21 +50,21 @@ echo '<br /><a href="page2.php">page 2</a>';
|
|||
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
After viewing <filename>page1.php</filename>, the second page
|
||||
<filename>page2.php</filename> will magically contain the session
|
||||
data. Read the <link linkend="ref.session">session reference</link>
|
||||
for information on <link linkend="session.idpassing">propagating
|
||||
session ids</link> as it, for example, explains what the constant
|
||||
<constant>SID</constant> is all about.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>A session example: <filename>page2.php</filename></title>
|
||||
<programlisting role="php">
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
After viewing <filename>page1.php</filename>, the second page
|
||||
<filename>page2.php</filename> will magically contain the session
|
||||
data. Read the <link linkend="ref.session">session reference</link>
|
||||
for information on <link linkend="session.idpassing">propagating
|
||||
session ids</link> as it, for example, explains what the constant
|
||||
<constant>SID</constant> is all about.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>A session example: <filename>page2.php</filename></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// page2.php
|
||||
|
@ -81,44 +81,44 @@ echo date('Y m d H:i:s', $_SESSION['time']);
|
|||
echo '<br /><a href="page1.php">page 1</a>';
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<simpara>
|
||||
If you want to use a named session, you must call
|
||||
<function>session_name</function> before calling
|
||||
<function>session_start</function>.
|
||||
</simpara>
|
||||
<simpara>
|
||||
<function>session_start</function> will register internal output
|
||||
handler for URL rewriting when <literal>trans-sid</literal> is
|
||||
enabled. If a user uses <literal>ob_gzhandler</literal> or like
|
||||
with <function>ob_start</function>, the order of output handler
|
||||
is important for proper output. For example, user must register
|
||||
<literal>ob_gzhandler</literal> before session start.
|
||||
</simpara>
|
||||
<note>
|
||||
<simpara>
|
||||
Use of <link linkend="ini.zlib.output-compression">zlib.output_compression</link>
|
||||
is recommended rather than <function>ob_gzhandler</function>
|
||||
</simpara>
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
As of PHP 4.3.3, calling <function>session_start</function> while the
|
||||
session has already been started will result in an error of level
|
||||
<constant>E_NOTICE</constant>. Also, the second session start will
|
||||
simply be ignored.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="reserved.variables.session">$_SESSION</link>,
|
||||
<link linkend="ini.session.auto-start">session.auto_start</link>, and
|
||||
<function>session_id</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<simpara>
|
||||
If you want to use a named session, you must call
|
||||
<function>session_name</function> before calling
|
||||
<function>session_start</function>.
|
||||
</simpara>
|
||||
<simpara>
|
||||
<function>session_start</function> will register internal output
|
||||
handler for URL rewriting when <literal>trans-sid</literal> is
|
||||
enabled. If a user uses <literal>ob_gzhandler</literal> or like
|
||||
with <function>ob_start</function>, the order of output handler
|
||||
is important for proper output. For example, user must register
|
||||
<literal>ob_gzhandler</literal> before session start.
|
||||
</simpara>
|
||||
<note>
|
||||
<simpara>
|
||||
Use of <link linkend="ini.zlib.output-compression">zlib.output_compression</link>
|
||||
is recommended rather than <function>ob_gzhandler</function>
|
||||
</simpara>
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
As of PHP 4.3.3, calling <function>session_start</function> while the
|
||||
session has already been started will result in an error of level
|
||||
<constant>E_NOTICE</constant>. Also, the second session start will
|
||||
simply be ignored.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="reserved.variables.session">$_SESSION</link>,
|
||||
<link linkend="ini.session.auto-start">session.auto_start</link>, and
|
||||
<function>session_id</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,57 +1,55 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.session-unregister">
|
||||
<refnamediv>
|
||||
<refname>session_unregister</refname>
|
||||
<refpurpose>
|
||||
Unregister a global variable from the current session
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>session_unregister</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_unregister</function> unregisters
|
||||
the global variable named <parameter>name</parameter> from the
|
||||
current session.
|
||||
</para>
|
||||
<para>
|
||||
This function returns &true; when the variable is successfully
|
||||
unregistered from the session.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
If <varname>$_SESSION</varname> (or
|
||||
<varname>$HTTP_SESSION_VARS</varname> for PHP 4.0.6 or less) is
|
||||
used, use <function>unset</function> to unregister a session
|
||||
variable. Do not <function>unset</function> <varname>$_SESSION</varname>
|
||||
itself as this will disable the special function of the
|
||||
<varname>$_SESSION</varname> superglobal.
|
||||
</para>
|
||||
</note>
|
||||
<caution>
|
||||
<para>
|
||||
This function does not unset the corresponding global variable for
|
||||
<parameter>name</parameter>, it only prevents the variable from being
|
||||
saved as part of the session. You must call <function>unset</function>
|
||||
to remove the corresponding global variable.
|
||||
</para>
|
||||
</caution>
|
||||
<caution>
|
||||
<para>
|
||||
If you are using
|
||||
<varname>$_SESSION</varname> (or <varname>$HTTP_SESSION_VARS</varname>),
|
||||
do not use <function>session_register</function>,
|
||||
<function>session_is_registered</function> and
|
||||
<function>session_unregister</function>.
|
||||
</para>
|
||||
</caution>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.session-unregister">
|
||||
<refnamediv>
|
||||
<refname>session_unregister</refname>
|
||||
<refpurpose>Unregister a global variable from the current session</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>session_unregister</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>session_unregister</function> unregisters
|
||||
the global variable named <parameter>name</parameter> from the
|
||||
current session.
|
||||
</para>
|
||||
<para>
|
||||
This function returns &true; when the variable is successfully
|
||||
unregistered from the session.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
If <varname>$_SESSION</varname> (or
|
||||
<varname>$HTTP_SESSION_VARS</varname> for PHP 4.0.6 or less) is
|
||||
used, use <function>unset</function> to unregister a session
|
||||
variable. Do not <function>unset</function> <varname>$_SESSION</varname>
|
||||
itself as this will disable the special function of the
|
||||
<varname>$_SESSION</varname> superglobal.
|
||||
</para>
|
||||
</note>
|
||||
<caution>
|
||||
<para>
|
||||
This function does not unset the corresponding global variable for
|
||||
<parameter>name</parameter>, it only prevents the variable from being
|
||||
saved as part of the session. You must call <function>unset</function>
|
||||
to remove the corresponding global variable.
|
||||
</para>
|
||||
</caution>
|
||||
<caution>
|
||||
<para>
|
||||
If you are using
|
||||
<varname>$_SESSION</varname> (or <varname>$HTTP_SESSION_VARS</varname>),
|
||||
do not use <function>session_register</function>,
|
||||
<function>session_is_registered</function> and
|
||||
<function>session_unregister</function>.
|
||||
</para>
|
||||
</caution>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,43 +1,41 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.8 -->
|
||||
<refentry id="function.session-unset">
|
||||
<refnamediv>
|
||||
<refname>session_unset</refname>
|
||||
<refpurpose>
|
||||
Free all session variables
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>session_unset</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.session-unset">
|
||||
<refnamediv>
|
||||
<refname>session_unset</refname>
|
||||
<refpurpose>Free all session variables</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>session_unset</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>session_unset</function> function frees all session variables
|
||||
currently registered.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
If <varname>$_SESSION</varname> (or
|
||||
<varname>$HTTP_SESSION_VARS</varname> for PHP 4.0.6 or less) is
|
||||
used, use <function>unset</function> to unregister a session
|
||||
variable, i.e. <literal>unset ($_SESSION['varname']);</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
<caution>
|
||||
<para>
|
||||
The <function>session_unset</function> function frees all session variables
|
||||
currently registered.
|
||||
Do NOT unset the whole <varname>$_SESSION</varname> with
|
||||
<literal>unset($_SESSION)</literal> as this will disable the
|
||||
registering of session variables through the
|
||||
<varname>$_SESSION</varname> superglobal.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
If <varname>$_SESSION</varname> (or
|
||||
<varname>$HTTP_SESSION_VARS</varname> for PHP 4.0.6 or less) is
|
||||
used, use <function>unset</function> to unregister a session
|
||||
variable, i.e. <literal>unset ($_SESSION['varname']);</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
<caution>
|
||||
<para>
|
||||
Do NOT unset the whole <varname>$_SESSION</varname> with
|
||||
<literal>unset($_SESSION)</literal> as this will disable the
|
||||
registering of session variables through the
|
||||
<varname>$_SESSION</varname> superglobal.
|
||||
</para>
|
||||
</caution>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</caution>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,37 +1,32 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- splitted from ./en/functions/session.xml, last change in rev 1.38 -->
|
||||
<refentry id="function.session-write-close">
|
||||
<refnamediv>
|
||||
<refname>session_write_close</refname>
|
||||
<refpurpose>Write session data and end session</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>session_write_close</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
End the current session and store session data.
|
||||
</para>
|
||||
<para>
|
||||
Session data is usually stored after your script terminated
|
||||
without the need to call <function>session_write_close</function>, but as
|
||||
session data is locked to prevent concurrent writes only one
|
||||
script may operate on a session at any time. When using framesets
|
||||
together with sessions you will experience the frames loading one
|
||||
by one due to this locking. You can reduce the time needed to
|
||||
load all the frames by ending the session as soon as all changes
|
||||
to session variables are done.
|
||||
</para>
|
||||
<!-- commented out until final decision on implementation
|
||||
<para>
|
||||
See also: <function>session_readonly</function>.
|
||||
</para>
|
||||
-->
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.session-write-close">
|
||||
<refnamediv>
|
||||
<refname>session_write_close</refname>
|
||||
<refpurpose>Write session data and end session</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>session_write_close</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
End the current session and store session data.
|
||||
</para>
|
||||
<para>
|
||||
Session data is usually stored after your script terminated
|
||||
without the need to call <function>session_write_close</function>, but as
|
||||
session data is locked to prevent concurrent writes only one
|
||||
script may operate on a session at any time. When using framesets
|
||||
together with sessions you will experience the frames loading one
|
||||
by one due to this locking. You can reduce the time needed to
|
||||
load all the frames by ending the session as soon as all changes
|
||||
to session variables are done.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,56 +1,56 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.1 -->
|
||||
<refentry id="function.socket-accept">
|
||||
<refnamediv>
|
||||
<refname>socket_accept</refname>
|
||||
<refpurpose>Accepts a connection on a socket</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>socket_accept</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
After the socket <parameter>socket</parameter> has been created
|
||||
using <function>socket_create</function>, bound to a name with
|
||||
<function>socket_bind</function>, and told to listen for connections
|
||||
with <function>socket_listen</function>, this function will accept
|
||||
incoming connections on that socket. Once a successful connection
|
||||
is made, a new socket resource is returned, which may be used
|
||||
for communication. If there are multiple connections queued on
|
||||
the socket, the first will be used. If there are no pending
|
||||
connections, <function>socket_accept</function> will block until
|
||||
a connection becomes present. If <parameter>socket</parameter>
|
||||
has been made non-blocking using
|
||||
<function>socket_set_blocking</function> or
|
||||
<function>socket_set_nonblock</function>, &false; will be returned.
|
||||
</para>
|
||||
<para>
|
||||
The socket resource returned by
|
||||
<function>socket_accept</function> may not be used to accept new
|
||||
connections. The original listening socket
|
||||
<parameter>socket</parameter>, however, remains open and may be
|
||||
reused.
|
||||
</para>
|
||||
<para>
|
||||
Returns a new socket resource on success, or &false; on error. The actual
|
||||
error code can be retrieved by calling
|
||||
<function>socket_last_error</function>. This error code may be passed to
|
||||
<function>socket_strerror</function> to get a textual explanation of the
|
||||
error.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_connect</function>,
|
||||
<function>socket_listen</function>,
|
||||
<function>socket_create</function>, and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-accept">
|
||||
<refnamediv>
|
||||
<refname>socket_accept</refname>
|
||||
<refpurpose>Accepts a connection on a socket</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>socket_accept</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
After the socket <parameter>socket</parameter> has been created
|
||||
using <function>socket_create</function>, bound to a name with
|
||||
<function>socket_bind</function>, and told to listen for connections
|
||||
with <function>socket_listen</function>, this function will accept
|
||||
incoming connections on that socket. Once a successful connection
|
||||
is made, a new socket resource is returned, which may be used
|
||||
for communication. If there are multiple connections queued on
|
||||
the socket, the first will be used. If there are no pending
|
||||
connections, <function>socket_accept</function> will block until
|
||||
a connection becomes present. If <parameter>socket</parameter>
|
||||
has been made non-blocking using
|
||||
<function>socket_set_blocking</function> or
|
||||
<function>socket_set_nonblock</function>, &false; will be returned.
|
||||
</para>
|
||||
<para>
|
||||
The socket resource returned by
|
||||
<function>socket_accept</function> may not be used to accept new
|
||||
connections. The original listening socket
|
||||
<parameter>socket</parameter>, however, remains open and may be
|
||||
reused.
|
||||
</para>
|
||||
<para>
|
||||
Returns a new socket resource on success, or &false; on error. The actual
|
||||
error code can be retrieved by calling
|
||||
<function>socket_last_error</function>. This error code may be passed to
|
||||
<function>socket_strerror</function> to get a textual explanation of the
|
||||
error.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_connect</function>,
|
||||
<function>socket_listen</function>,
|
||||
<function>socket_create</function>, and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id="function.socket-clear-error">
|
||||
<refnamediv>
|
||||
<refname>socket_clear_error</refname>
|
||||
<refpurpose>Clears the error on the socket or the last error code</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>socket_clear_error</methodname>
|
||||
<methodparam choice="opt"><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function clears the error code on the given socket or the global
|
||||
last socket error.
|
||||
</para>
|
||||
<para>
|
||||
This function allows explicitly resetting the error code value either of
|
||||
a socket or of the extension global last error code. This may be useful
|
||||
to detect within a part of the application if an error occurred or not.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_last_error</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.socket-clear-error">
|
||||
<refnamediv>
|
||||
<refname>socket_clear_error</refname>
|
||||
<refpurpose>Clears the error on the socket or the last error code</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>socket_clear_error</methodname>
|
||||
<methodparam choice="opt"><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function clears the error code on the given socket or the global
|
||||
last socket error.
|
||||
</para>
|
||||
<para>
|
||||
This function allows explicitly resetting the error code value either of
|
||||
a socket or of the extension global last error code. This may be useful
|
||||
to detect within a part of the application if an error occurred or not.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_last_error</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.1 -->
|
||||
<refentry id="function.socket-close">
|
||||
<refnamediv>
|
||||
<refname>socket_close</refname>
|
||||
<refpurpose>Closes a socket resource</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>socket_close</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>socket_close</function> closes the socket resource
|
||||
given by <parameter>socket</parameter>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>socket_close</function> can't be used on PHP file resources
|
||||
created with <function>fopen</function>, <function>popen</function>,
|
||||
<function>fsockopen</function>, or <function>pfsockopen</function>; it is
|
||||
meant for sockets created with <function>socket_create</function> or
|
||||
<function>socket_accept</function>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <function>socket_bind</function>, <function>socket_listen</function>,
|
||||
<function>socket_create</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-close">
|
||||
<refnamediv>
|
||||
<refname>socket_close</refname>
|
||||
<refpurpose>Closes a socket resource</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>socket_close</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>socket_close</function> closes the socket resource
|
||||
given by <parameter>socket</parameter>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>socket_close</function> can't be used on PHP file resources
|
||||
created with <function>fopen</function>, <function>popen</function>,
|
||||
<function>fsockopen</function>, or <function>pfsockopen</function>; it is
|
||||
meant for sockets created with <function>socket_create</function> or
|
||||
<function>socket_accept</function>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <function>socket_bind</function>, <function>socket_listen</function>,
|
||||
<function>socket_create</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,60 +1,60 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.1 -->
|
||||
<refentry id="function.socket-connect">
|
||||
<refnamediv>
|
||||
<refname>socket_connect</refname>
|
||||
<refpurpose>Initiates a connection on a socket</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_connect</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>address</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>port</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Initiates a connection using the socket resource
|
||||
<parameter>socket</parameter>, which must be a valid socket
|
||||
resource created with <function>socket_create</function>.
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>address</parameter> parameter is either an IP
|
||||
address in dotted-quad notation
|
||||
(e.g. <literal>127.0.0.1</literal>), if the socket is of the
|
||||
<constant>AF_INET</constant> family; or the pathname of a
|
||||
Unix domain socket, if the socket family is
|
||||
<constant>AF_UNIX</constant>.
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>port</parameter> parameter is only used when
|
||||
connecting to an <constant>AF_INET</constant> socket, and
|
||||
designates the port on the remote host to which a connection
|
||||
should be made.
|
||||
</para>
|
||||
<para>
|
||||
&return.success; The error code can be retrieved with
|
||||
<function>socket_last_error</function>. This code may be passed to
|
||||
<function>socket_strerror</function> to get a textual explanation of the
|
||||
error.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
If the socket is non-blocking then this function returns &false; with an
|
||||
error <literal>Operation now in progress</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_listen</function>,
|
||||
<function>socket_create</function>,
|
||||
<function>socket_last_error</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-connect">
|
||||
<refnamediv>
|
||||
<refname>socket_connect</refname>
|
||||
<refpurpose>Initiates a connection on a socket</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_connect</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>address</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>port</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Initiates a connection using the socket resource
|
||||
<parameter>socket</parameter>, which must be a valid socket
|
||||
resource created with <function>socket_create</function>.
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>address</parameter> parameter is either an IP
|
||||
address in dotted-quad notation
|
||||
(e.g. <literal>127.0.0.1</literal>), if the socket is of the
|
||||
<constant>AF_INET</constant> family; or the pathname of a
|
||||
Unix domain socket, if the socket family is
|
||||
<constant>AF_UNIX</constant>.
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>port</parameter> parameter is only used when
|
||||
connecting to an <constant>AF_INET</constant> socket, and
|
||||
designates the port on the remote host to which a connection
|
||||
should be made.
|
||||
</para>
|
||||
<para>
|
||||
&return.success; The error code can be retrieved with
|
||||
<function>socket_last_error</function>. This code may be passed to
|
||||
<function>socket_strerror</function> to get a textual explanation of the
|
||||
error.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
If the socket is non-blocking then this function returns &false; with an
|
||||
error <literal>Operation now in progress</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_listen</function>,
|
||||
<function>socket_create</function>,
|
||||
<function>socket_last_error</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,58 +1,58 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
|
||||
<refentry id="function.socket-create-listen">
|
||||
<refnamediv>
|
||||
<refname>socket_create_listen</refname>
|
||||
<refpurpose>Opens a socket on port to accept connections </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>socket_create_listen</methodname>
|
||||
<methodparam><type>int</type><parameter>port</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>backlog</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function is meant to ease the task of creating a new socket which
|
||||
only listens to accept new connections.
|
||||
</para>
|
||||
<para>
|
||||
<function>socket_create_listen</function> creates a new socket resource of
|
||||
type <constant>AF_INET</constant> listening on <emphasis>all</emphasis>
|
||||
local interfaces on the given port waiting for new connections.
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>backlog</parameter> parameter defines the maximum length
|
||||
the queue of pending connections may grow to.
|
||||
<constant>SOMAXCONN</constant> may be passed as
|
||||
<parameter>backlog</parameter> parameter, see
|
||||
<function>socket_listen</function> for more information.
|
||||
</para>
|
||||
<para>
|
||||
<function>socket_create_listen</function> returns a new socket resource
|
||||
on success or &false; on error. The error code can be retrieved with
|
||||
<function>socket_last_error</function>. This code may be passed to
|
||||
<function>socket_strerror</function> to get a textual explanation of the
|
||||
error.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
If you want to create a socket which only listens on a certain
|
||||
interface you need to use <function>socket_create</function>,
|
||||
<function>socket_bind</function> and <function>socket_listen</function>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_create</function>,
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_listen</function>,
|
||||
<function>socket_last_error</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-create-listen">
|
||||
<refnamediv>
|
||||
<refname>socket_create_listen</refname>
|
||||
<refpurpose>Opens a socket on port to accept connections </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>socket_create_listen</methodname>
|
||||
<methodparam><type>int</type><parameter>port</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>backlog</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function is meant to ease the task of creating a new socket which
|
||||
only listens to accept new connections.
|
||||
</para>
|
||||
<para>
|
||||
<function>socket_create_listen</function> creates a new socket resource of
|
||||
type <constant>AF_INET</constant> listening on <emphasis>all</emphasis>
|
||||
local interfaces on the given port waiting for new connections.
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>backlog</parameter> parameter defines the maximum length
|
||||
the queue of pending connections may grow to.
|
||||
<constant>SOMAXCONN</constant> may be passed as
|
||||
<parameter>backlog</parameter> parameter, see
|
||||
<function>socket_listen</function> for more information.
|
||||
</para>
|
||||
<para>
|
||||
<function>socket_create_listen</function> returns a new socket resource
|
||||
on success or &false; on error. The error code can be retrieved with
|
||||
<function>socket_last_error</function>. This code may be passed to
|
||||
<function>socket_strerror</function> to get a textual explanation of the
|
||||
error.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
If you want to create a socket which only listens on a certain
|
||||
interface you need to use <function>socket_create</function>,
|
||||
<function>socket_bind</function> and <function>socket_listen</function>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_create</function>,
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_listen</function>,
|
||||
<function>socket_last_error</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,173 +1,173 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<!-- $Revision: 1.14 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
|
||||
<refentry id="function.socket-create-pair">
|
||||
<refnamediv>
|
||||
<refname>socket_create_pair</refname>
|
||||
<refpurpose>Creates a pair of indistinguishable sockets and stores them in an array</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_create_pair</methodname>
|
||||
<methodparam><type>int</type><parameter>domain</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>type</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>protocol</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter role="reference">fd</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>socket_create_pair</function> creates two connected and indistinguishable sockets, and stores
|
||||
them in <parameter>fd</parameter>. This function is commonly used in IPC (InterProcess Communication).
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>domain</parameter> parameter specifies the protocol
|
||||
family to be used by the socket.
|
||||
</para>
|
||||
<table>
|
||||
<title>Available address/protocol families</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Domain</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>AF_INET</entry>
|
||||
<entry>
|
||||
IPv4 Internet based protocols. TCP and UDP are common protocols of
|
||||
this protocol family. Supported only in windows.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>AF_INET6</entry>
|
||||
<entry>
|
||||
IPv6 Internet based protocols. TCP and UDP are common protocols of
|
||||
this protocol family. Support added in PHP 5.0.0.
|
||||
Supported only in windows.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>AF_UNIX</entry>
|
||||
<entry>
|
||||
Local communication protocol family. High efficiency and low
|
||||
overhead make it a great form of IPC (Interprocess Communication).
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
The <parameter>type</parameter> parameter selects the type of communication
|
||||
to be used by the socket.
|
||||
</para>
|
||||
<table>
|
||||
<title>Available socket types</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Type</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>SOCK_STREAM</entry>
|
||||
<entry>
|
||||
Provides sequenced, reliable, full-duplex, connection-based byte streams.
|
||||
An out-of-band data transmission mechanism may be supported.
|
||||
The TCP protocol is based on this socket type.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_DGRAM</entry>
|
||||
<entry>
|
||||
Supports datagrams (connectionless, unreliable messages of a fixed maximum length).
|
||||
The UDP protocol is based on this socket type.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_SEQPACKET</entry>
|
||||
<entry>
|
||||
Provides a sequenced, reliable, two-way connection-based data transmission path for
|
||||
datagrams of fixed maximum length; a consumer is required to read an
|
||||
entire packet with each read call.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_RAW</entry>
|
||||
<entry>
|
||||
Provides raw network protocol access. This special type of socket
|
||||
can be used to manually construct any type of protocol. A common use
|
||||
for this socket type is to perform ICMP requests (like ping,
|
||||
traceroute, etc).
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_RDM</entry>
|
||||
<entry>
|
||||
Provides a reliable datagram layer that does not guarantee ordering.
|
||||
This is most likely not implemented on your operating system.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
The <parameter>protocol</parameter> parameter sets the specific
|
||||
protocol within the specified <parameter>domain</parameter> to be used
|
||||
when communicating on the returned socket. The proper value can be retrieved by
|
||||
name by using <function>getprotobyname</function>. If
|
||||
the desired protocol is TCP, or UDP the corresponding constants
|
||||
<constant>SOL_TCP</constant>, and <constant>SOL_UDP</constant>
|
||||
can also be used.
|
||||
</para>
|
||||
<table>
|
||||
<title>Common protocols</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Name</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>icmp</entry>
|
||||
<entry>
|
||||
The Internet Control Message Protocol is used primarily by gateways
|
||||
and hosts to report errors in datagram communication. The "ping"
|
||||
command (present in most modern operating systems) is an example
|
||||
application of ICMP.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>udp</entry>
|
||||
<entry>
|
||||
The User Datagram Protocol is a connectionless, unreliable,
|
||||
protocol with fixed record lengths. Due to these aspects, UDP
|
||||
requires a minimum amount of protocol overhead.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>tcp</entry>
|
||||
<entry>
|
||||
The Transmission Control Protocol is a reliable, connection based,
|
||||
stream oriented, full duplex protocol. TCP guarantees that all data packets
|
||||
will be received in the order in which they were sent. If any packet is somehow
|
||||
lost during communication, TCP will automatically retransmit the packet until
|
||||
the destination host acknowledges that packet. For reliability and performance
|
||||
reasons, the TCP implementation itself decides the appropriate octet boundaries
|
||||
of the underlying datagram communication layer. Therefore, TCP applications must
|
||||
allow for the possibility of partial record transmission.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
<example>
|
||||
<refentry id="function.socket-create-pair">
|
||||
<refnamediv>
|
||||
<refname>socket_create_pair</refname>
|
||||
<refpurpose>Creates a pair of indistinguishable sockets and stores them in an array</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_create_pair</methodname>
|
||||
<methodparam><type>int</type><parameter>domain</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>type</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>protocol</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter role="reference">fd</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>socket_create_pair</function> creates two connected and indistinguishable sockets, and stores
|
||||
them in <parameter>fd</parameter>. This function is commonly used in IPC (InterProcess Communication).
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>domain</parameter> parameter specifies the protocol
|
||||
family to be used by the socket.
|
||||
</para>
|
||||
<table>
|
||||
<title>Available address/protocol families</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Domain</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>AF_INET</entry>
|
||||
<entry>
|
||||
IPv4 Internet based protocols. TCP and UDP are common protocols of
|
||||
this protocol family. Supported only in windows.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>AF_INET6</entry>
|
||||
<entry>
|
||||
IPv6 Internet based protocols. TCP and UDP are common protocols of
|
||||
this protocol family. Support added in PHP 5.0.0.
|
||||
Supported only in windows.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>AF_UNIX</entry>
|
||||
<entry>
|
||||
Local communication protocol family. High efficiency and low
|
||||
overhead make it a great form of IPC (Interprocess Communication).
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
The <parameter>type</parameter> parameter selects the type of communication
|
||||
to be used by the socket.
|
||||
</para>
|
||||
<table>
|
||||
<title>Available socket types</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Type</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>SOCK_STREAM</entry>
|
||||
<entry>
|
||||
Provides sequenced, reliable, full-duplex, connection-based byte streams.
|
||||
An out-of-band data transmission mechanism may be supported.
|
||||
The TCP protocol is based on this socket type.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_DGRAM</entry>
|
||||
<entry>
|
||||
Supports datagrams (connectionless, unreliable messages of a fixed maximum length).
|
||||
The UDP protocol is based on this socket type.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_SEQPACKET</entry>
|
||||
<entry>
|
||||
Provides a sequenced, reliable, two-way connection-based data transmission path for
|
||||
datagrams of fixed maximum length; a consumer is required to read an
|
||||
entire packet with each read call.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_RAW</entry>
|
||||
<entry>
|
||||
Provides raw network protocol access. This special type of socket
|
||||
can be used to manually construct any type of protocol. A common use
|
||||
for this socket type is to perform ICMP requests (like ping,
|
||||
traceroute, etc).
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_RDM</entry>
|
||||
<entry>
|
||||
Provides a reliable datagram layer that does not guarantee ordering.
|
||||
This is most likely not implemented on your operating system.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
The <parameter>protocol</parameter> parameter sets the specific
|
||||
protocol within the specified <parameter>domain</parameter> to be used
|
||||
when communicating on the returned socket. The proper value can be retrieved by
|
||||
name by using <function>getprotobyname</function>. If
|
||||
the desired protocol is TCP, or UDP the corresponding constants
|
||||
<constant>SOL_TCP</constant>, and <constant>SOL_UDP</constant>
|
||||
can also be used.
|
||||
</para>
|
||||
<table>
|
||||
<title>Common protocols</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Name</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>icmp</entry>
|
||||
<entry>
|
||||
The Internet Control Message Protocol is used primarily by gateways
|
||||
and hosts to report errors in datagram communication. The "ping"
|
||||
command (present in most modern operating systems) is an example
|
||||
application of ICMP.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>udp</entry>
|
||||
<entry>
|
||||
The User Datagram Protocol is a connectionless, unreliable,
|
||||
protocol with fixed record lengths. Due to these aspects, UDP
|
||||
requires a minimum amount of protocol overhead.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>tcp</entry>
|
||||
<entry>
|
||||
The Transmission Control Protocol is a reliable, connection based,
|
||||
stream oriented, full duplex protocol. TCP guarantees that all data packets
|
||||
will be received in the order in which they were sent. If any packet is somehow
|
||||
lost during communication, TCP will automatically retransmit the packet until
|
||||
the destination host acknowledges that packet. For reliability and performance
|
||||
reasons, the TCP implementation itself decides the appropriate octet boundaries
|
||||
of the underlying datagram communication layer. Therefore, TCP applications must
|
||||
allow for the possibility of partial record transmission.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>socket_create_pair</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
|
@ -192,10 +192,10 @@ socket_close($sockets[1]);
|
|||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>socket_create_pair</function> IPC example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
|
@ -233,10 +233,10 @@ if ($pid == -1) {
|
|||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,196 +1,196 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.4 -->
|
||||
<refentry id="function.socket-create">
|
||||
<refnamediv>
|
||||
<refname>socket_create</refname>
|
||||
<refpurpose>Create a socket (endpoint for communication)</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>socket_create</methodname>
|
||||
<methodparam><type>int</type><parameter>domain</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>type</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>protocol</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Creates and returns a socket resource, also referred to as an endpoint
|
||||
of communication. A typical network connection is made up of 2 sockets, one
|
||||
performing the role of the client, and another performing the role of the server.
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>domain</parameter> parameter specifies the protocol
|
||||
family to be used by the socket.
|
||||
</para>
|
||||
<table>
|
||||
<title>Available address/protocol families</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Domain</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>AF_INET</entry>
|
||||
<entry>
|
||||
IPv4 Internet based protocols. TCP and UDP are common protocols of
|
||||
this protocol family.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>AF_INET6</entry>
|
||||
<entry>
|
||||
IPv6 Internet based protocols. TCP and UDP are common protocols of
|
||||
this protocol family. Support added in PHP 5.0.0.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>AF_UNIX</entry>
|
||||
<entry>
|
||||
Local communication protocol family. High efficiency and low
|
||||
overhead make it a great form of IPC (Interprocess Communication).
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
The <parameter>type</parameter> parameter selects the type of communication
|
||||
to be used by the socket.
|
||||
</para>
|
||||
<table>
|
||||
<title>Available socket types</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Type</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>SOCK_STREAM</entry>
|
||||
<entry>
|
||||
Provides sequenced, reliable, full-duplex, connection-based byte streams.
|
||||
An out-of-band data transmission mechanism may be supported.
|
||||
The TCP protocol is based on this socket type.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_DGRAM</entry>
|
||||
<entry>
|
||||
Supports datagrams (connectionless, unreliable messages of a fixed maximum length).
|
||||
The UDP protocol is based on this socket type.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_SEQPACKET</entry>
|
||||
<entry>
|
||||
Provides a sequenced, reliable, two-way connection-based data transmission path for
|
||||
datagrams of fixed maximum length; a consumer is required to read an
|
||||
entire packet with each read call.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_RAW</entry>
|
||||
<entry>
|
||||
Provides raw network protocol access. This special type of socket
|
||||
can be used to manually construct any type of protocol. A common use
|
||||
for this socket type is to perform ICMP requests (like ping,
|
||||
traceroute, etc).
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_RDM</entry>
|
||||
<entry>
|
||||
Provides a reliable datagram layer that does not guarantee ordering.
|
||||
This is most likely not implemented on your operating system.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
The <parameter>protocol</parameter> parameter sets the specific
|
||||
protocol within the specified <parameter>domain</parameter> to be used
|
||||
when communicating on the returned socket. The proper value can be retrieved by
|
||||
name by using <function>getprotobyname</function>. If
|
||||
the desired protocol is TCP, or UDP the corresponding constants
|
||||
<constant>SOL_TCP</constant>, and <constant>SOL_UDP</constant>
|
||||
can also be used.
|
||||
</para>
|
||||
<table>
|
||||
<title>Common protocols</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Name</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>icmp</entry>
|
||||
<entry>
|
||||
The Internet Control Message Protocol is used primarily by gateways
|
||||
and hosts to report errors in datagram communication. The "ping"
|
||||
command (present in most modern operating systems) is an example
|
||||
application of ICMP.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>udp</entry>
|
||||
<entry>
|
||||
The User Datagram Protocol is a connectionless, unreliable,
|
||||
protocol with fixed record lengths. Due to these aspects, UDP
|
||||
requires a minimum amount of protocol overhead.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>tcp</entry>
|
||||
<entry>
|
||||
The Transmission Control Protocol is a reliable, connection based,
|
||||
stream oriented, full duplex protocol. TCP guarantees that all data packets
|
||||
will be received in the order in which they were sent. If any packet is somehow
|
||||
lost during communication, TCP will automatically retransmit the packet until
|
||||
the destination host acknowledges that packet. For reliability and performance
|
||||
reasons, the TCP implementation itself decides the appropriate octet boundaries
|
||||
of the underlying datagram communication layer. Therefore, TCP applications must
|
||||
allow for the possibility of partial record transmission.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
<function>socket_create</function> Returns a socket resource on success, or &false;
|
||||
on error. The actual error code can be retrieved by calling <function>socket_last_error</function>.
|
||||
This error code may be passed to <function>socket_strerror</function> to get a textual
|
||||
explanation of the error.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
If an invalid <parameter>domain</parameter> or
|
||||
<parameter>type</parameter> is given, <function>socket_create</function>
|
||||
defaults to <constant>AF_INET</constant> and
|
||||
<constant>SOCK_STREAM</constant> respectively and additionally emits an
|
||||
<constant>E_WARNING</constant> message.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_accept</function>,
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_connect</function>,
|
||||
<function>socket_listen</function>,
|
||||
<function>socket_last_error</function>, and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-create">
|
||||
<refnamediv>
|
||||
<refname>socket_create</refname>
|
||||
<refpurpose>Create a socket (endpoint for communication)</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>socket_create</methodname>
|
||||
<methodparam><type>int</type><parameter>domain</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>type</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>protocol</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Creates and returns a socket resource, also referred to as an endpoint
|
||||
of communication. A typical network connection is made up of 2 sockets, one
|
||||
performing the role of the client, and another performing the role of the server.
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>domain</parameter> parameter specifies the protocol
|
||||
family to be used by the socket.
|
||||
</para>
|
||||
<table>
|
||||
<title>Available address/protocol families</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Domain</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>AF_INET</entry>
|
||||
<entry>
|
||||
IPv4 Internet based protocols. TCP and UDP are common protocols of
|
||||
this protocol family.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>AF_INET6</entry>
|
||||
<entry>
|
||||
IPv6 Internet based protocols. TCP and UDP are common protocols of
|
||||
this protocol family. Support added in PHP 5.0.0.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>AF_UNIX</entry>
|
||||
<entry>
|
||||
Local communication protocol family. High efficiency and low
|
||||
overhead make it a great form of IPC (Interprocess Communication).
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
The <parameter>type</parameter> parameter selects the type of communication
|
||||
to be used by the socket.
|
||||
</para>
|
||||
<table>
|
||||
<title>Available socket types</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Type</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>SOCK_STREAM</entry>
|
||||
<entry>
|
||||
Provides sequenced, reliable, full-duplex, connection-based byte streams.
|
||||
An out-of-band data transmission mechanism may be supported.
|
||||
The TCP protocol is based on this socket type.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_DGRAM</entry>
|
||||
<entry>
|
||||
Supports datagrams (connectionless, unreliable messages of a fixed maximum length).
|
||||
The UDP protocol is based on this socket type.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_SEQPACKET</entry>
|
||||
<entry>
|
||||
Provides a sequenced, reliable, two-way connection-based data transmission path for
|
||||
datagrams of fixed maximum length; a consumer is required to read an
|
||||
entire packet with each read call.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_RAW</entry>
|
||||
<entry>
|
||||
Provides raw network protocol access. This special type of socket
|
||||
can be used to manually construct any type of protocol. A common use
|
||||
for this socket type is to perform ICMP requests (like ping,
|
||||
traceroute, etc).
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SOCK_RDM</entry>
|
||||
<entry>
|
||||
Provides a reliable datagram layer that does not guarantee ordering.
|
||||
This is most likely not implemented on your operating system.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
The <parameter>protocol</parameter> parameter sets the specific
|
||||
protocol within the specified <parameter>domain</parameter> to be used
|
||||
when communicating on the returned socket. The proper value can be retrieved by
|
||||
name by using <function>getprotobyname</function>. If
|
||||
the desired protocol is TCP, or UDP the corresponding constants
|
||||
<constant>SOL_TCP</constant>, and <constant>SOL_UDP</constant>
|
||||
can also be used.
|
||||
</para>
|
||||
<table>
|
||||
<title>Common protocols</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Name</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>icmp</entry>
|
||||
<entry>
|
||||
The Internet Control Message Protocol is used primarily by gateways
|
||||
and hosts to report errors in datagram communication. The "ping"
|
||||
command (present in most modern operating systems) is an example
|
||||
application of ICMP.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>udp</entry>
|
||||
<entry>
|
||||
The User Datagram Protocol is a connectionless, unreliable,
|
||||
protocol with fixed record lengths. Due to these aspects, UDP
|
||||
requires a minimum amount of protocol overhead.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>tcp</entry>
|
||||
<entry>
|
||||
The Transmission Control Protocol is a reliable, connection based,
|
||||
stream oriented, full duplex protocol. TCP guarantees that all data packets
|
||||
will be received in the order in which they were sent. If any packet is somehow
|
||||
lost during communication, TCP will automatically retransmit the packet until
|
||||
the destination host acknowledges that packet. For reliability and performance
|
||||
reasons, the TCP implementation itself decides the appropriate octet boundaries
|
||||
of the underlying datagram communication layer. Therefore, TCP applications must
|
||||
allow for the possibility of partial record transmission.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
<function>socket_create</function> Returns a socket resource on success, or &false;
|
||||
on error. The actual error code can be retrieved by calling <function>socket_last_error</function>.
|
||||
This error code may be passed to <function>socket_strerror</function> to get a textual
|
||||
explanation of the error.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
If an invalid <parameter>domain</parameter> or
|
||||
<parameter>type</parameter> is given, <function>socket_create</function>
|
||||
defaults to <constant>AF_INET</constant> and
|
||||
<constant>SOCK_STREAM</constant> respectively and additionally emits an
|
||||
<constant>E_WARNING</constant> message.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_accept</function>,
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_connect</function>,
|
||||
<function>socket_listen</function>,
|
||||
<function>socket_last_error</function>, and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,154 +1,154 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
|
||||
<refentry id="function.socket-get-option">
|
||||
<refnamediv>
|
||||
<refname>socket_get_option</refname>
|
||||
<refpurpose>Gets socket options for the socket </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>socket_get_option</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>level</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>optname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>socket_get_option</function> function retrieves the value for
|
||||
the option specified by the <parameter>optname</parameter> parameter for the
|
||||
socket specified by the <parameter>socket</parameter> parameter. <function>socket_get_option</function>
|
||||
will return &false; on failure.
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>level</parameter> parameter specifies the protocol level at
|
||||
which the option resides. For example, to retrieve options at the socket level,
|
||||
a <parameter>level</parameter> parameter of SOL_SOCKET would be used. Other
|
||||
levels, such as TCP, can be used by specifying the protocol number of that level.
|
||||
Protocol numbers can be found by using the <function>getprotobyname</function> function.
|
||||
</para>
|
||||
<table>
|
||||
<title>Available Socket Options</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Option</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>SO_DEBUG</entry>
|
||||
<entry>
|
||||
Reports whether debugging information is being recorded.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_ACCEPTCONN</entry>
|
||||
<entry>
|
||||
Reports whether socket listening is enabled.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_BROADCAST</entry>
|
||||
<entry>
|
||||
Reports whether transmission of broadcast messages is supported.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_REUSEADDR</entry>
|
||||
<entry>
|
||||
Reports whether local addresses can be reused.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_KEEPALIVE</entry>
|
||||
<entry>
|
||||
Reports whether connections are kept active with periodic transmission
|
||||
of messages. If the connected socket fails to respond to these messages,
|
||||
the connection is broken and processes writing to that socket are notified
|
||||
with a SIGPIPE signal.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_LINGER</entry>
|
||||
<entry>
|
||||
Reports whether the <parameter>socket</parameter> lingers on <function>socket_close</function> if data is present.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_OOBINLINE</entry>
|
||||
<entry>
|
||||
Reports whether the <parameter>socket</parameter> leaves out-of-band data inline.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_SNDBUF</entry>
|
||||
<entry>
|
||||
Reports send buffer size information.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_RCVBUF</entry>
|
||||
<entry>
|
||||
Reports recieve buffer size information.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_ERROR</entry>
|
||||
<entry>
|
||||
Reports information about error status and clears it.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_TYPE</entry>
|
||||
<entry>
|
||||
Reports the <parameter>socket</parameter> type.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_DONTROUTE</entry>
|
||||
<entry>
|
||||
Reports whether outgoing messages bypass the standard routing facilities.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_RCVLOWAT</entry>
|
||||
<entry>
|
||||
Reports the minimum number of bytes to process for <parameter>socket</parameter> input operations.
|
||||
( Defaults to 1 )
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_RCVTIMEO</entry>
|
||||
<entry>
|
||||
Reports the timeout value for input operations.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_SNDLOWAT</entry>
|
||||
<entry>
|
||||
Reports the minimum number of bytes to process for <parameter>socket</parameter> output operations.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_SNDTIMEO</entry>
|
||||
<entry>
|
||||
Reports the timeout value specifying the amount of time that an output
|
||||
function blocks because flow control prevents data from being sent.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<note>
|
||||
<para>
|
||||
This function used to be called <literal>socket_getopt()</literal> prior
|
||||
to PHP 4.3.0
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-get-option">
|
||||
<refnamediv>
|
||||
<refname>socket_get_option</refname>
|
||||
<refpurpose>Gets socket options for the socket </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>socket_get_option</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>level</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>optname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>socket_get_option</function> function retrieves the value for
|
||||
the option specified by the <parameter>optname</parameter> parameter for the
|
||||
socket specified by the <parameter>socket</parameter> parameter. <function>socket_get_option</function>
|
||||
will return &false; on failure.
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>level</parameter> parameter specifies the protocol level at
|
||||
which the option resides. For example, to retrieve options at the socket level,
|
||||
a <parameter>level</parameter> parameter of SOL_SOCKET would be used. Other
|
||||
levels, such as TCP, can be used by specifying the protocol number of that level.
|
||||
Protocol numbers can be found by using the <function>getprotobyname</function> function.
|
||||
</para>
|
||||
<table>
|
||||
<title>Available Socket Options</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Option</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>SO_DEBUG</entry>
|
||||
<entry>
|
||||
Reports whether debugging information is being recorded.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_ACCEPTCONN</entry>
|
||||
<entry>
|
||||
Reports whether socket listening is enabled.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_BROADCAST</entry>
|
||||
<entry>
|
||||
Reports whether transmission of broadcast messages is supported.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_REUSEADDR</entry>
|
||||
<entry>
|
||||
Reports whether local addresses can be reused.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_KEEPALIVE</entry>
|
||||
<entry>
|
||||
Reports whether connections are kept active with periodic transmission
|
||||
of messages. If the connected socket fails to respond to these messages,
|
||||
the connection is broken and processes writing to that socket are notified
|
||||
with a SIGPIPE signal.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_LINGER</entry>
|
||||
<entry>
|
||||
Reports whether the <parameter>socket</parameter> lingers on <function>socket_close</function> if data is present.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_OOBINLINE</entry>
|
||||
<entry>
|
||||
Reports whether the <parameter>socket</parameter> leaves out-of-band data inline.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_SNDBUF</entry>
|
||||
<entry>
|
||||
Reports send buffer size information.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_RCVBUF</entry>
|
||||
<entry>
|
||||
Reports recieve buffer size information.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_ERROR</entry>
|
||||
<entry>
|
||||
Reports information about error status and clears it.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_TYPE</entry>
|
||||
<entry>
|
||||
Reports the <parameter>socket</parameter> type.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_DONTROUTE</entry>
|
||||
<entry>
|
||||
Reports whether outgoing messages bypass the standard routing facilities.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_RCVLOWAT</entry>
|
||||
<entry>
|
||||
Reports the minimum number of bytes to process for <parameter>socket</parameter> input operations.
|
||||
( Defaults to 1 )
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_RCVTIMEO</entry>
|
||||
<entry>
|
||||
Reports the timeout value for input operations.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_SNDLOWAT</entry>
|
||||
<entry>
|
||||
Reports the minimum number of bytes to process for <parameter>socket</parameter> output operations.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SO_SNDTIMEO</entry>
|
||||
<entry>
|
||||
Reports the timeout value specifying the amount of time that an output
|
||||
function blocks because flow control prevents data from being sent.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<note>
|
||||
<para>
|
||||
This function used to be called <literal>socket_getopt()</literal> prior
|
||||
to PHP 4.3.0
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,59 +1,56 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
|
||||
<refentry id="function.socket-getpeername">
|
||||
<refnamediv>
|
||||
<refname>socket_getpeername</refname>
|
||||
<refpurpose>
|
||||
Queries the remote side of the given socket which may either result in host/port
|
||||
or in a Unix filesystem path, dependent on its type
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_getpeername</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter role="reference">addr</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">port</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
If the given socket is of type <constant>AF_INET</constant>
|
||||
or <constant>AF_INET6</constant>, <function>socket_getpeername</function>
|
||||
will return the peers (remote) <emphasis>IP address</emphasis> in appropriate notation (e.g.
|
||||
<literal>127.0.0.1</literal> or <literal>fe80::1</literal>) in the
|
||||
<parameter>address</parameter> parameter and, if the optional
|
||||
<parameter>port</parameter> parameter is present, also the associated port.
|
||||
</para>
|
||||
<para>
|
||||
If the given socket is of type <constant>AF_UNIX</constant>,
|
||||
<function>socket_getpeername</function> will return the Unix filesystem
|
||||
path (e.g. <literal>/var/run/daemon.sock</literal>) in the
|
||||
<parameter>address</parameter> parameter.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
<function>socket_getpeername</function> should not be used with
|
||||
<constant>AF_UNIX</constant> sockets created with <function>socket_accept</function>.
|
||||
Only sockets created with <function>socket_connect</function> or a primary
|
||||
server socket following a call to <function>socket_bind</function> will return
|
||||
meaningful values.
|
||||
</simpara>
|
||||
</note>
|
||||
<para>
|
||||
&return.success; <function>socket_getpeername</function> may also return
|
||||
&false; if the socket type is not any of <constant>AF_INET</constant>,
|
||||
<constant>AF_INET6</constant>, or <constant>AF_UNIX</constant>, in which
|
||||
case the last socket error code is <emphasis>not</emphasis> updated.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_getsockname</function>,
|
||||
<function>socket_last_error</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-getpeername">
|
||||
<refnamediv>
|
||||
<refname>socket_getpeername</refname>
|
||||
<refpurpose>Queries the remote side of the given socket which may either result in host/port or in a Unix filesystem path, dependent on its type</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_getpeername</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter role="reference">addr</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">port</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
If the given socket is of type <constant>AF_INET</constant>
|
||||
or <constant>AF_INET6</constant>, <function>socket_getpeername</function>
|
||||
will return the peers (remote) <emphasis>IP address</emphasis> in appropriate notation (e.g.
|
||||
<literal>127.0.0.1</literal> or <literal>fe80::1</literal>) in the
|
||||
<parameter>address</parameter> parameter and, if the optional
|
||||
<parameter>port</parameter> parameter is present, also the associated port.
|
||||
</para>
|
||||
<para>
|
||||
If the given socket is of type <constant>AF_UNIX</constant>,
|
||||
<function>socket_getpeername</function> will return the Unix filesystem
|
||||
path (e.g. <literal>/var/run/daemon.sock</literal>) in the
|
||||
<parameter>address</parameter> parameter.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
<function>socket_getpeername</function> should not be used with
|
||||
<constant>AF_UNIX</constant> sockets created with <function>socket_accept</function>.
|
||||
Only sockets created with <function>socket_connect</function> or a primary
|
||||
server socket following a call to <function>socket_bind</function> will return
|
||||
meaningful values.
|
||||
</simpara>
|
||||
</note>
|
||||
<para>
|
||||
&return.success; <function>socket_getpeername</function> may also return
|
||||
&false; if the socket type is not any of <constant>AF_INET</constant>,
|
||||
<constant>AF_INET6</constant>, or <constant>AF_UNIX</constant>, in which
|
||||
case the last socket error code is <emphasis>not</emphasis> updated.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_getsockname</function>,
|
||||
<function>socket_last_error</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,59 +1,56 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
|
||||
<refentry id="function.socket-getsockname">
|
||||
<refnamediv>
|
||||
<refname>socket_getsockname</refname>
|
||||
<refpurpose>
|
||||
Queries the local side of the given socket which may either result in host/port
|
||||
or in a Unix filesystem path, dependent on its type
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_getsockname</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter role="reference">addr</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">port</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
If the given socket is of type <constant>AF_INET</constant>
|
||||
or <constant>AF_INET6</constant>, <function>socket_getsockname</function>
|
||||
will return the local <emphasis>IP address</emphasis> in appropriate notation (e.g.
|
||||
<literal>127.0.0.1</literal> or <literal>fe80::1</literal>) in the
|
||||
<parameter>address</parameter> parameter and, if the optional
|
||||
<parameter>port</parameter> parameter is present, also the associated port.
|
||||
</para>
|
||||
<para>
|
||||
If the given socket is of type <constant>AF_UNIX</constant>,
|
||||
<function>socket_getsockname</function> will return the Unix filesystem
|
||||
path (e.g. <literal>/var/run/daemon.sock</literal>) in the
|
||||
<parameter>address</parameter> parameter.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
<function>socket_getsockname</function> should not be used with
|
||||
<constant>AF_UNIX</constant> sockets created with <function>socket_connect</function>.
|
||||
Only sockets created with <function>socket_accept</function> or a primary
|
||||
server socket following a call to <function>socket_bind</function> will return
|
||||
meaningful values.
|
||||
</simpara>
|
||||
</note>
|
||||
<para>
|
||||
&return.success; <function>socket_getsockname</function> may also return
|
||||
&false; if the socket type is not any of <constant>AF_INET</constant>,
|
||||
<constant>AF_INET6</constant>, or <constant>AF_UNIX</constant>, in which
|
||||
case the last socket error code is <emphasis>not</emphasis> updated.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_getpeername</function>,
|
||||
<function>socket_last_error</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-getsockname">
|
||||
<refnamediv>
|
||||
<refname>socket_getsockname</refname>
|
||||
<refpurpose>Queries the local side of the given socket which may either result in host/port or in a Unix filesystem path, dependent on its type</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_getsockname</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter role="reference">addr</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">port</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
If the given socket is of type <constant>AF_INET</constant>
|
||||
or <constant>AF_INET6</constant>, <function>socket_getsockname</function>
|
||||
will return the local <emphasis>IP address</emphasis> in appropriate notation (e.g.
|
||||
<literal>127.0.0.1</literal> or <literal>fe80::1</literal>) in the
|
||||
<parameter>address</parameter> parameter and, if the optional
|
||||
<parameter>port</parameter> parameter is present, also the associated port.
|
||||
</para>
|
||||
<para>
|
||||
If the given socket is of type <constant>AF_UNIX</constant>,
|
||||
<function>socket_getsockname</function> will return the Unix filesystem
|
||||
path (e.g. <literal>/var/run/daemon.sock</literal>) in the
|
||||
<parameter>address</parameter> parameter.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
<function>socket_getsockname</function> should not be used with
|
||||
<constant>AF_UNIX</constant> sockets created with <function>socket_connect</function>.
|
||||
Only sockets created with <function>socket_accept</function> or a primary
|
||||
server socket following a call to <function>socket_bind</function> will return
|
||||
meaningful values.
|
||||
</simpara>
|
||||
</note>
|
||||
<para>
|
||||
&return.success; <function>socket_getsockname</function> may also return
|
||||
&false; if the socket type is not any of <constant>AF_INET</constant>,
|
||||
<constant>AF_INET6</constant>, or <constant>AF_UNIX</constant>, in which
|
||||
case the last socket error code is <emphasis>not</emphasis> updated.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_getpeername</function>,
|
||||
<function>socket_last_error</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.1 -->
|
||||
<refentry id="function.socket-last-error">
|
||||
<refnamediv>
|
||||
<refname>socket_last_error</refname>
|
||||
<refpurpose>Returns the last error on the socket </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>socket_last_error</methodname>
|
||||
<methodparam choice="opt"><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function returns a socket error code.
|
||||
</para>
|
||||
<para>
|
||||
If a socket resource is passed to this function, the last error which
|
||||
occurred on this particular socket is returned. If the socket resource is
|
||||
omitted, the error code of the last failed socket function is returned.
|
||||
The latter is in particular helpful for functions like
|
||||
<function>socket_create</function> which don't return a socket on
|
||||
failure and <function>socket_select</function> which can fail for reasons
|
||||
not directly tied to a particular socket. The error code is suitable to
|
||||
be fed to <function>socket_strerror</function> which returns a string
|
||||
describing the given error code.
|
||||
<programlisting role="php">
|
||||
<refentry id="function.socket-last-error">
|
||||
<refnamediv>
|
||||
<refname>socket_last_error</refname>
|
||||
<refpurpose>Returns the last error on the socket </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>socket_last_error</methodname>
|
||||
<methodparam choice="opt"><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function returns a socket error code.
|
||||
</para>
|
||||
<para>
|
||||
If a socket resource is passed to this function, the last error which
|
||||
occurred on this particular socket is returned. If the socket resource is
|
||||
omitted, the error code of the last failed socket function is returned.
|
||||
The latter is in particular helpful for functions like
|
||||
<function>socket_create</function> which don't return a socket on
|
||||
failure and <function>socket_select</function> which can fail for reasons
|
||||
not directly tied to a particular socket. The error code is suitable to
|
||||
be fed to <function>socket_strerror</function> which returns a string
|
||||
describing the given error code.
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
if (false == ($socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {
|
||||
|
@ -34,16 +34,16 @@ if (false == ($socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>socket_last_error</function> does not clear the error code, use
|
||||
<function>socket_clear_error</function> for this purpose.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>socket_last_error</function> does not clear the error code, use
|
||||
<function>socket_clear_error</function> for this purpose.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,63 +1,63 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.1 -->
|
||||
<refentry id="function.socket-listen">
|
||||
<refnamediv>
|
||||
<refname>socket_listen</refname>
|
||||
<refpurpose>Listens for a connection on a socket</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_listen</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>backlog</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
After the socket <parameter>socket</parameter> has been created
|
||||
using <function>socket_create</function> and bound to a name with
|
||||
<function>socket_bind</function>, it may be told to listen for incoming
|
||||
connections on <parameter>socket</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
A maximum of <parameter>backlog</parameter> incoming connections will be
|
||||
queued for processing. If a connection request arrives with the queue
|
||||
full the client may receive an error with an indication of
|
||||
<literal>ECONNREFUSED</literal>, or, if the underlying protocol supports
|
||||
retransmission, the request may be ignored so that retries may succeed.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
The maximum number passed to the <parameter>backlog</parameter>
|
||||
parameter highly depends on the underlying platform. On Linux, it is
|
||||
silently truncated to <constant>SOMAXCONN</constant>. On win32, if
|
||||
passed <constant>SOMAXCONN</constant>, the underlying service provider
|
||||
responsible for the socket will set the backlog to a maximum
|
||||
<emphasis>reasonable</emphasis> value. There is no standard provision to
|
||||
find out the actual backlog value on this platform.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
<function>socket_listen</function> is applicable only to sockets of
|
||||
type <constant>SOCK_STREAM</constant> or
|
||||
<constant>SOCK_SEQPACKET</constant>.
|
||||
</para>
|
||||
<para>
|
||||
&return.success; The error code can be retrieved with
|
||||
<function>socket_last_error</function>. This code may be passed to
|
||||
<function>socket_strerror</function> to get a textual explanation of the
|
||||
error.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_accept</function>,
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_connect</function>,
|
||||
<function>socket_create</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-listen">
|
||||
<refnamediv>
|
||||
<refname>socket_listen</refname>
|
||||
<refpurpose>Listens for a connection on a socket</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_listen</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>backlog</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
After the socket <parameter>socket</parameter> has been created
|
||||
using <function>socket_create</function> and bound to a name with
|
||||
<function>socket_bind</function>, it may be told to listen for incoming
|
||||
connections on <parameter>socket</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
A maximum of <parameter>backlog</parameter> incoming connections will be
|
||||
queued for processing. If a connection request arrives with the queue
|
||||
full the client may receive an error with an indication of
|
||||
<literal>ECONNREFUSED</literal>, or, if the underlying protocol supports
|
||||
retransmission, the request may be ignored so that retries may succeed.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
The maximum number passed to the <parameter>backlog</parameter>
|
||||
parameter highly depends on the underlying platform. On Linux, it is
|
||||
silently truncated to <constant>SOMAXCONN</constant>. On win32, if
|
||||
passed <constant>SOMAXCONN</constant>, the underlying service provider
|
||||
responsible for the socket will set the backlog to a maximum
|
||||
<emphasis>reasonable</emphasis> value. There is no standard provision to
|
||||
find out the actual backlog value on this platform.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
<function>socket_listen</function> is applicable only to sockets of
|
||||
type <constant>SOCK_STREAM</constant> or
|
||||
<constant>SOCK_SEQPACKET</constant>.
|
||||
</para>
|
||||
<para>
|
||||
&return.success; The error code can be retrieved with
|
||||
<function>socket_last_error</function>. This code may be passed to
|
||||
<function>socket_strerror</function> to get a textual explanation of the
|
||||
error.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_accept</function>,
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_connect</function>,
|
||||
<function>socket_create</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,70 +1,70 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.8 -->
|
||||
<refentry id="function.socket-read">
|
||||
<refnamediv>
|
||||
<refname>socket_read</refname>
|
||||
<refpurpose>Reads a maximum of length bytes from a socket</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>socket_read</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>length</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The function <function>socket_read</function> reads from the socket
|
||||
resource <parameter>socket</parameter> created by the
|
||||
<function>socket_create</function> or
|
||||
<function>socket_accept</function> functions. The maximum number of bytes read
|
||||
is specified by the <parameter>length</parameter> parameter. Otherwise
|
||||
you can use \r, \n, or \0 to end reading
|
||||
(depending on the <parameter>type</parameter> parameter, see below).
|
||||
</para>
|
||||
<para>
|
||||
<function>socket_read</function> returns the data as a string on success, or
|
||||
&false; on error (including if the remote host has closed the
|
||||
connection). The error code can be retrieved with
|
||||
<function>socket_last_error</function>. This code may be passed to
|
||||
<function>socket_strerror</function> to get a textual representation of
|
||||
the error.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>socket_read</function> returns a zero length string ("")
|
||||
when there is no more data to read.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
Optional <parameter>type</parameter> parameter is a named constant:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
PHP_BINARY_READ - use the system <literal>recv()</literal> function.
|
||||
Safe for reading binary data. (Default in PHP >= 4.1.0)
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
PHP_NORMAL_READ - reading stops at \n or \r. (Default in PHP <= 4.0.6)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_accept</function>,
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_connect</function>,
|
||||
<function>socket_listen</function>,
|
||||
<function>socket_last_error</function>,
|
||||
<function>socket_strerror</function> and
|
||||
<function>socket_write</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-read">
|
||||
<refnamediv>
|
||||
<refname>socket_read</refname>
|
||||
<refpurpose>Reads a maximum of length bytes from a socket</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>socket_read</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>length</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The function <function>socket_read</function> reads from the socket
|
||||
resource <parameter>socket</parameter> created by the
|
||||
<function>socket_create</function> or
|
||||
<function>socket_accept</function> functions. The maximum number of bytes read
|
||||
is specified by the <parameter>length</parameter> parameter. Otherwise
|
||||
you can use \r, \n, or \0 to end reading
|
||||
(depending on the <parameter>type</parameter> parameter, see below).
|
||||
</para>
|
||||
<para>
|
||||
<function>socket_read</function> returns the data as a string on success, or
|
||||
&false; on error (including if the remote host has closed the
|
||||
connection). The error code can be retrieved with
|
||||
<function>socket_last_error</function>. This code may be passed to
|
||||
<function>socket_strerror</function> to get a textual representation of
|
||||
the error.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>socket_read</function> returns a zero length string ("")
|
||||
when there is no more data to read.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
Optional <parameter>type</parameter> parameter is a named constant:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
PHP_BINARY_READ - use the system <literal>recv()</literal> function.
|
||||
Safe for reading binary data. (Default in PHP >= 4.1.0)
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
PHP_NORMAL_READ - reading stops at \n or \r. (Default in PHP <= 4.0.6)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_accept</function>,
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_connect</function>,
|
||||
<function>socket_listen</function>,
|
||||
<function>socket_last_error</function>,
|
||||
<function>socket_strerror</function> and
|
||||
<function>socket_write</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
|
||||
<refentry id="function.socket-recv">
|
||||
<refnamediv>
|
||||
<refname>socket_recv</refname>
|
||||
<refpurpose>Receives data from a connected socket </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>socket_recv</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter role="reference">buf</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>len</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
&warn.undocumented.func;
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-recv">
|
||||
<refnamediv>
|
||||
<refname>socket_recv</refname>
|
||||
<refpurpose>Receives data from a connected socket </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>socket_recv</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter role="reference">buf</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>len</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
&warn.undocumented.func;
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
|
||||
<refentry id="function.socket-recvfrom">
|
||||
<refnamediv>
|
||||
<refname>socket_recvfrom</refname>
|
||||
<refpurpose>Receives data from a socket, connected or not </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>socket_recvfrom</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter role="reference">buf</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>len</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter role="reference">name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">port</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
&warn.undocumented.func;
|
||||
</para>
|
||||
<para>
|
||||
<function>socket_recvfrom</function> has been binary safe since PHP 4.3.0
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-recvfrom">
|
||||
<refnamediv>
|
||||
<refname>socket_recvfrom</refname>
|
||||
<refpurpose>Receives data from a socket, connected or not </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>socket_recvfrom</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter role="reference">buf</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>len</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter role="reference">name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">port</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
&warn.undocumented.func;
|
||||
</para>
|
||||
<para>
|
||||
<function>socket_recvfrom</function> has been binary safe since PHP 4.3.0
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,63 +1,60 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.14 $ -->
|
||||
<!-- $Revision: 1.15 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
|
||||
<refentry id="function.socket-select">
|
||||
<refnamediv>
|
||||
<refname>socket_select</refname>
|
||||
<refpurpose>
|
||||
Runs the select() system call on the given arrays of sockets
|
||||
with a specified timeout
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>socket_select</methodname>
|
||||
<methodparam><type>array</type><parameter role="reference">read</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter role="reference">write</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter role="reference">except</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>tv_sec</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>tv_usec</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>socket_select</function> accepts arrays of sockets and
|
||||
waits for them to change status. Those coming with BSD sockets background
|
||||
will recognize that those socket resource arrays are in fact the
|
||||
so-called file descriptor sets. Three independent arrays of socket
|
||||
resources are watched.
|
||||
</para>
|
||||
<para>
|
||||
The sockets listed in the <parameter>read</parameter> array will be watched to
|
||||
see if characters become available for reading (more precisely, to see if
|
||||
a read will not block - in particular, a socket resource is also ready on
|
||||
end-of-file, in which case a <function>socket_read</function> will return
|
||||
a zero length string).
|
||||
</para>
|
||||
<para>
|
||||
The sockets listed in the <parameter>write</parameter> array will be
|
||||
watched to see if a write will not block.
|
||||
</para>
|
||||
<para>
|
||||
The sockets listed in the <parameter>except</parameter> array will be
|
||||
watched for exceptions.
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
On exit, the arrays are modified to indicate which socket resource
|
||||
actually changed status.
|
||||
</para>
|
||||
</warning>
|
||||
<para>
|
||||
You do not need to pass every array to
|
||||
<function>socket_select</function>. You can leave it out and use an
|
||||
empty array or &null; instead. Also do not forget that those arrays are
|
||||
passed <emphasis>by reference</emphasis> and will be modified after
|
||||
<function>socket_select</function> returns.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>socket_select</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.socket-select">
|
||||
<refnamediv>
|
||||
<refname>socket_select</refname>
|
||||
<refpurpose>Runs the select() system call on the given arrays of sockets with a specified timeout</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>socket_select</methodname>
|
||||
<methodparam><type>array</type><parameter role="reference">read</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter role="reference">write</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter role="reference">except</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>tv_sec</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>tv_usec</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>socket_select</function> accepts arrays of sockets and
|
||||
waits for them to change status. Those coming with BSD sockets background
|
||||
will recognize that those socket resource arrays are in fact the
|
||||
so-called file descriptor sets. Three independent arrays of socket
|
||||
resources are watched.
|
||||
</para>
|
||||
<para>
|
||||
The sockets listed in the <parameter>read</parameter> array will be watched to
|
||||
see if characters become available for reading (more precisely, to see if
|
||||
a read will not block - in particular, a socket resource is also ready on
|
||||
end-of-file, in which case a <function>socket_read</function> will return
|
||||
a zero length string).
|
||||
</para>
|
||||
<para>
|
||||
The sockets listed in the <parameter>write</parameter> array will be
|
||||
watched to see if a write will not block.
|
||||
</para>
|
||||
<para>
|
||||
The sockets listed in the <parameter>except</parameter> array will be
|
||||
watched for exceptions.
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
On exit, the arrays are modified to indicate which socket resource
|
||||
actually changed status.
|
||||
</para>
|
||||
</warning>
|
||||
<para>
|
||||
You do not need to pass every array to
|
||||
<function>socket_select</function>. You can leave it out and use an
|
||||
empty array or &null; instead. Also do not forget that those arrays are
|
||||
passed <emphasis>by reference</emphasis> and will be modified after
|
||||
<function>socket_select</function> returns.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>socket_select</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* Prepare the read array */
|
||||
|
@ -73,54 +70,54 @@ if ($num_changed_sockets === false) {
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Due a limitation in the current Zend Engine it is not possible to pass a
|
||||
constant modifier like &null; directly as a parameter to a function
|
||||
which expects this parameter to be passed by reference. Instead use a
|
||||
temporary variable or an expression with the leftmost member being a
|
||||
temporary variable:
|
||||
<example>
|
||||
<title>Using &null; with <function>socket_select</function></title>
|
||||
<programlisting role="php">
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Due a limitation in the current Zend Engine it is not possible to pass a
|
||||
constant modifier like &null; directly as a parameter to a function
|
||||
which expects this parameter to be passed by reference. Instead use a
|
||||
temporary variable or an expression with the leftmost member being a
|
||||
temporary variable:
|
||||
<example>
|
||||
<title>Using &null; with <function>socket_select</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$e = NULL;
|
||||
socket_select($r, $w, $e, 0);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
The <parameter>tv_sec</parameter> and <parameter>tv_usec</parameter>
|
||||
together form the <emphasis>timeout</emphasis> parameter. The
|
||||
<emphasis>timeout</emphasis> is an upper bound on the amount of time
|
||||
elapsed before <function>socket_select</function> return.
|
||||
<parameter>tv_sec</parameter> may be zero , causing
|
||||
<function>socket_select</function> to return immediately. This is useful
|
||||
for polling. If <parameter>tv_sec</parameter> is &null; (no timeout),
|
||||
<function>socket_select</function> can block indefinitely.
|
||||
</para>
|
||||
<para>
|
||||
On success <function>socket_select</function> returns the number of
|
||||
socket resources contained in the modified arrays, which may be zero if
|
||||
the timeout expires before anything interesting happens. On error &false;
|
||||
is returned. The error code can be retrieved with
|
||||
<function>socket_last_error</function>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Be sure to use the <literal>===</literal> operator when checking for an
|
||||
error. Since the <function>socket_select</function> may return 0 the
|
||||
comparison with <literal>==</literal> would evaluate to &true;:
|
||||
<example>
|
||||
<title>Understanding <function>socket_select</function>'s result</title>
|
||||
<programlisting role="php">
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
The <parameter>tv_sec</parameter> and <parameter>tv_usec</parameter>
|
||||
together form the <emphasis>timeout</emphasis> parameter. The
|
||||
<emphasis>timeout</emphasis> is an upper bound on the amount of time
|
||||
elapsed before <function>socket_select</function> return.
|
||||
<parameter>tv_sec</parameter> may be zero , causing
|
||||
<function>socket_select</function> to return immediately. This is useful
|
||||
for polling. If <parameter>tv_sec</parameter> is &null; (no timeout),
|
||||
<function>socket_select</function> can block indefinitely.
|
||||
</para>
|
||||
<para>
|
||||
On success <function>socket_select</function> returns the number of
|
||||
socket resources contained in the modified arrays, which may be zero if
|
||||
the timeout expires before anything interesting happens. On error &false;
|
||||
is returned. The error code can be retrieved with
|
||||
<function>socket_last_error</function>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Be sure to use the <literal>===</literal> operator when checking for an
|
||||
error. Since the <function>socket_select</function> may return 0 the
|
||||
comparison with <literal>==</literal> would evaluate to &true;:
|
||||
<example>
|
||||
<title>Understanding <function>socket_select</function>'s result</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$e = NULL;
|
||||
|
@ -130,60 +127,60 @@ if (false === socket_select($r, $w, $e, 0)) {
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
Be aware that some socket implementations need to be handled very
|
||||
carefully. A few basic rules:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
You should always try to use <function>socket_select</function>
|
||||
without timeout. Your program should have nothing to do if there is
|
||||
no data available. Code that depends on timeouts is not usually
|
||||
portable and difficult to debug.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
No socket resource must be added to any set if you do not intend to
|
||||
check its result after the <function>socket_select</function> call,
|
||||
and respond appropriately. After <function>socket_select</function>
|
||||
returns, all socket resources in all arrays must be checked. Any
|
||||
socket resource that is available for writing must be written to, and
|
||||
any socket resource available for reading must be read from.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
If you read/write to a socket returns in the arrays be aware that
|
||||
they do not necessarily read/write the full amount of data you have
|
||||
requested. Be prepared to even only be able to read/write a single
|
||||
byte.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
It's common to most socket implementations that the only exception
|
||||
caught with the <parameter>except</parameter> array is out-of-bound
|
||||
data received on a socket.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_read</function>,
|
||||
<function>socket_write</function>,
|
||||
<function>socket_last_error</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
Be aware that some socket implementations need to be handled very
|
||||
carefully. A few basic rules:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
You should always try to use <function>socket_select</function>
|
||||
without timeout. Your program should have nothing to do if there is
|
||||
no data available. Code that depends on timeouts is not usually
|
||||
portable and difficult to debug.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
No socket resource must be added to any set if you do not intend to
|
||||
check its result after the <function>socket_select</function> call,
|
||||
and respond appropriately. After <function>socket_select</function>
|
||||
returns, all socket resources in all arrays must be checked. Any
|
||||
socket resource that is available for writing must be written to, and
|
||||
any socket resource available for reading must be read from.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
If you read/write to a socket returns in the arrays be aware that
|
||||
they do not necessarily read/write the full amount of data you have
|
||||
requested. Be prepared to even only be able to read/write a single
|
||||
byte.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
It's common to most socket implementations that the only exception
|
||||
caught with the <parameter>except</parameter> array is out-of-bound
|
||||
data received on a socket.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_read</function>,
|
||||
<function>socket_write</function>,
|
||||
<function>socket_last_error</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,73 +1,73 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
|
||||
<refentry id="function.socket-send">
|
||||
<refnamediv>
|
||||
<refname>socket_send</refname>
|
||||
<refpurpose>Sends data to a connected socket </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>socket_send</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>buf</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>len</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The function <function>socket_send</function> sends
|
||||
<parameter>len</parameter> bytes to the socket
|
||||
<parameter>socket</parameter> from <parameter>buf</parameter>
|
||||
</para>
|
||||
<para>
|
||||
The value of <parameter>flags</parameter> can be any
|
||||
<literal>ORed</literal> combination of the following:
|
||||
<table>
|
||||
<title>possible values for <parameter>flags</parameter></title>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>0x1</literal></entry>
|
||||
<entry>
|
||||
Process OOB (out-of-band) data
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x2</literal></entry>
|
||||
<entry>
|
||||
Peek at incoming message
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x4</literal></entry>
|
||||
<entry>
|
||||
Bypass routing, use direct interface
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x8</literal></entry>
|
||||
<entry>
|
||||
Data completes record
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x100</literal></entry>
|
||||
<entry>
|
||||
Data completes transaction
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_sendmsg</function> and
|
||||
<function>socket_sendto</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-send">
|
||||
<refnamediv>
|
||||
<refname>socket_send</refname>
|
||||
<refpurpose>Sends data to a connected socket </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>socket_send</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>buf</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>len</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The function <function>socket_send</function> sends
|
||||
<parameter>len</parameter> bytes to the socket
|
||||
<parameter>socket</parameter> from <parameter>buf</parameter>
|
||||
</para>
|
||||
<para>
|
||||
The value of <parameter>flags</parameter> can be any
|
||||
<literal>ORed</literal> combination of the following:
|
||||
<table>
|
||||
<title>possible values for <parameter>flags</parameter></title>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>0x1</literal></entry>
|
||||
<entry>
|
||||
Process OOB (out-of-band) data
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x2</literal></entry>
|
||||
<entry>
|
||||
Peek at incoming message
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x4</literal></entry>
|
||||
<entry>
|
||||
Bypass routing, use direct interface
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x8</literal></entry>
|
||||
<entry>
|
||||
Data completes record
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x100</literal></entry>
|
||||
<entry>
|
||||
Data completes transaction
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_sendmsg</function> and
|
||||
<function>socket_sendto</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,72 +1,72 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
|
||||
<refentry id="function.socket-sendto">
|
||||
<refnamediv>
|
||||
<refname>socket_sendto</refname>
|
||||
<refpurpose>Sends a message to a socket, whether it is connected or not </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>socket_sendto</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>buf</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>len</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>addr</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>port</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The function <function>socket_sendto</function> sends
|
||||
<parameter>len</parameter> bytes from <parameter>buf</parameter>
|
||||
through the socket <parameter>socket</parameter> to the
|
||||
<parameter>port</parameter> at the address <parameter>addr</parameter>
|
||||
</para>
|
||||
<para>
|
||||
The value of <parameter>flags</parameter> can be one of the
|
||||
following:
|
||||
<table>
|
||||
<title>possible values for <parameter>flags</parameter></title>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>0x1</literal></entry>
|
||||
<entry>
|
||||
Process OOB (out-of-band) data.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x2</literal></entry>
|
||||
<entry>
|
||||
Peek at incoming message.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x4</literal></entry>
|
||||
<entry>
|
||||
Bypass routing, use direct interface.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x8</literal></entry>
|
||||
<entry>
|
||||
Data completes record.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x100</literal></entry>
|
||||
<entry>
|
||||
Data completes transaction.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
<example>
|
||||
<title><function>socket_sendto</function> Example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.socket-sendto">
|
||||
<refnamediv>
|
||||
<refname>socket_sendto</refname>
|
||||
<refpurpose>Sends a message to a socket, whether it is connected or not </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>socket_sendto</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>buf</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>len</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>addr</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>port</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The function <function>socket_sendto</function> sends
|
||||
<parameter>len</parameter> bytes from <parameter>buf</parameter>
|
||||
through the socket <parameter>socket</parameter> to the
|
||||
<parameter>port</parameter> at the address <parameter>addr</parameter>
|
||||
</para>
|
||||
<para>
|
||||
The value of <parameter>flags</parameter> can be one of the
|
||||
following:
|
||||
<table>
|
||||
<title>possible values for <parameter>flags</parameter></title>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>0x1</literal></entry>
|
||||
<entry>
|
||||
Process OOB (out-of-band) data.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x2</literal></entry>
|
||||
<entry>
|
||||
Peek at incoming message.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x4</literal></entry>
|
||||
<entry>
|
||||
Bypass routing, use direct interface.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x8</literal></entry>
|
||||
<entry>
|
||||
Data completes record.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>0x100</literal></entry>
|
||||
<entry>
|
||||
Data completes transaction.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
<example>
|
||||
<title><function>socket_sendto</function> Example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$sh = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
|
@ -81,15 +81,15 @@
|
|||
socket_close($sh);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_send</function> and
|
||||
<function>socket_sendmsg</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_send</function> and
|
||||
<function>socket_sendmsg</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,26 +1,24 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id="function.socket-set-block">
|
||||
<refnamediv>
|
||||
<refname>socket_set_block</refname>
|
||||
<refpurpose>
|
||||
Sets blocking mode on a socket resource
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_set_block</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>socket_set_block</function> function removes the O_NONBLOCK flag
|
||||
on the socket specified by the <parameter>socket</parameter> parameter.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>socket_set_block</function> example</title>
|
||||
<programlisting role="php">
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id="function.socket-set-block">
|
||||
<refnamediv>
|
||||
<refname>socket_set_block</refname>
|
||||
<refpurpose>Sets blocking mode on a socket resource</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_set_block</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>socket_set_block</function> function removes the O_NONBLOCK flag
|
||||
on the socket specified by the <parameter>socket</parameter> parameter.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>socket_set_block</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
|
@ -43,18 +41,18 @@ if (socket_set_block($socket) === false) { // $socket is now blocking
|
|||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
See also <function>socket_set_nonblock</function> and
|
||||
<function>socket_set_option</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
See also <function>socket_set_nonblock</function> and
|
||||
<function>socket_set_option</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
|
||||
<refentry id="function.socket-set-nonblock">
|
||||
<refnamediv>
|
||||
<refname>socket_set_nonblock</refname>
|
||||
<refpurpose>Sets nonblocking mode for file descriptor fd </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_set_nonblock</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>socket_set_nonblock</function> function sets the O_NONBLOCK flag
|
||||
on the socket specified by the <parameter>socket</parameter> parameter.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>socket_set_nonblock</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.socket-set-nonblock">
|
||||
<refnamediv>
|
||||
<refname>socket_set_nonblock</refname>
|
||||
<refpurpose>Sets nonblocking mode for file descriptor fd </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_set_nonblock</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>socket_set_nonblock</function> function sets the O_NONBLOCK flag
|
||||
on the socket specified by the <parameter>socket</parameter> parameter.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>socket_set_nonblock</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$port = 9090;
|
||||
|
@ -36,18 +36,18 @@ if (socket_set_nonblock($socket) === false) {
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
See also <function>socket_set_block</function> and
|
||||
<function>socket_set_option</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
See also <function>socket_set_block</function> and
|
||||
<function>socket_set_option</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,45 +1,45 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
|
||||
<refentry id="function.socket-set-option">
|
||||
<refnamediv>
|
||||
<refname>socket_set_option</refname>
|
||||
<refpurpose>Sets socket options for the socket</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_set_option</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>level</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>optname</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>optval</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>socket_set_option</function> function sets the option specified by the <parameter>optname</parameter>
|
||||
parameter, at the protocol level specified by the <parameter>level</parameter> parameter, to the
|
||||
value pointed to by the <parameter>optval</parameter> parameter for the socket
|
||||
specified by the <parameter>socket</parameter> parameter. <function>socket_set_option</function>
|
||||
will return &false; on failure.
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>level</parameter> parameter specifies the protocol level at
|
||||
which the option resides. For example, to retrieve options at the socket level,
|
||||
a <parameter>level</parameter> parameter of SOL_SOCKET would be used. Other
|
||||
levels, such as TCP, can be used by specifying the protocol number of that level.
|
||||
Protocol numbers can be found by using the <function>getprotobyname</function> function.
|
||||
</para>
|
||||
<para>
|
||||
The available socket options are the same as those for the <function>socket_get_option</function> function.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used to be called <function>socket_setopt</function> prior
|
||||
to PHP 4.3.0.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-set-option">
|
||||
<refnamediv>
|
||||
<refname>socket_set_option</refname>
|
||||
<refpurpose>Sets socket options for the socket</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_set_option</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>level</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>optname</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>optval</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>socket_set_option</function> function sets the option specified by the <parameter>optname</parameter>
|
||||
parameter, at the protocol level specified by the <parameter>level</parameter> parameter, to the
|
||||
value pointed to by the <parameter>optval</parameter> parameter for the socket
|
||||
specified by the <parameter>socket</parameter> parameter. <function>socket_set_option</function>
|
||||
will return &false; on failure.
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>level</parameter> parameter specifies the protocol level at
|
||||
which the option resides. For example, to retrieve options at the socket level,
|
||||
a <parameter>level</parameter> parameter of SOL_SOCKET would be used. Other
|
||||
levels, such as TCP, can be used by specifying the protocol number of that level.
|
||||
Protocol numbers can be found by using the <function>getprotobyname</function> function.
|
||||
</para>
|
||||
<para>
|
||||
The available socket options are the same as those for the <function>socket_get_option</function> function.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used to be called <function>socket_setopt</function> prior
|
||||
to PHP 4.3.0.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,53 +1,53 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
|
||||
<refentry id="function.socket-shutdown">
|
||||
<refnamediv>
|
||||
<refname>socket_shutdown</refname>
|
||||
<refpurpose>Shuts down a socket for receiving, sending, or both</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_shutdown</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>how</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>socket_shutdown</function> function allows you to stop
|
||||
incoming, outgoing or all data (the default) from being sent through the
|
||||
<parameter>socket</parameter>
|
||||
</para>
|
||||
<para>
|
||||
The value of <parameter>how</parameter> can be one of the following:
|
||||
<table>
|
||||
<title>possible values for <parameter>how</parameter></title>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>0</literal></entry>
|
||||
<entry>
|
||||
Shutdown socket reading
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>1</literal></entry>
|
||||
<entry>
|
||||
Shutdown socket writing
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>2</literal></entry>
|
||||
<entry>
|
||||
Shutdown socket reading and writing
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-shutdown">
|
||||
<refnamediv>
|
||||
<refname>socket_shutdown</refname>
|
||||
<refpurpose>Shuts down a socket for receiving, sending, or both</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>socket_shutdown</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>how</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>socket_shutdown</function> function allows you to stop
|
||||
incoming, outgoing or all data (the default) from being sent through the
|
||||
<parameter>socket</parameter>
|
||||
</para>
|
||||
<para>
|
||||
The value of <parameter>how</parameter> can be one of the following:
|
||||
<table>
|
||||
<title>possible values for <parameter>how</parameter></title>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>0</literal></entry>
|
||||
<entry>
|
||||
Shutdown socket reading
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>1</literal></entry>
|
||||
<entry>
|
||||
Shutdown socket writing
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>2</literal></entry>
|
||||
<entry>
|
||||
Shutdown socket reading and writing
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,61 +1,63 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.8 -->
|
||||
<refentry id="function.socket-strerror">
|
||||
<refnamediv>
|
||||
<refname>socket_strerror</refname>
|
||||
<refpurpose>Return a string describing a socket error</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>socket_strerror</methodname>
|
||||
<methodparam><type>int</type><parameter>errno</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>socket_strerror</function> takes as its
|
||||
<parameter>errno</parameter> parameter a socket error code as returned by
|
||||
<function>socket_last_error</function> and returns the corresponding
|
||||
explanatory text. This makes it a bit more pleasant to figure out why
|
||||
something didn't work; for instance, instead of having to track down a
|
||||
system include file to find out what '-111' means, you just pass it to
|
||||
<function>socket_strerror</function>, and it tells you what happened.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>socket_strerror</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.socket-strerror">
|
||||
<refnamediv>
|
||||
<refname>socket_strerror</refname>
|
||||
<refpurpose>Return a string describing a socket error</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>socket_strerror</methodname>
|
||||
<methodparam><type>int</type><parameter>errno</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>socket_strerror</function> takes as its
|
||||
<parameter>errno</parameter> parameter a socket error code as returned by
|
||||
<function>socket_last_error</function> and returns the corresponding
|
||||
explanatory text. This makes it a bit more pleasant to figure out why
|
||||
something didn't work; for instance, instead of having to track down a
|
||||
system include file to find out what '-111' means, you just pass it to
|
||||
<function>socket_strerror</function>, and it tells you what happened.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>socket_strerror</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
if (false == ($socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {
|
||||
echo "socket_create() failed: reason: " . socket_strerror(socket_last_error()) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (false == (@socket_bind($socket, '127.0.0.1', 80))) {
|
||||
echo "socket_bind() failed: reason: " . socket_strerror(socket_last_error($socket)) . "\n";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
The expected output from the above example (assuming the script
|
||||
is not run with root privileges):
|
||||
</para>
|
||||
<screen>
|
||||
socket_bind() failed: reason: Permission denied
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</programlisting>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_accept</function>,
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_connect</function>,
|
||||
<function>socket_listen</function>, and
|
||||
<function>socket_create</function>.
|
||||
The expected output from the above example (assuming the script
|
||||
is not run with root privileges):
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
socket_bind() failed: reason: Permission denied
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_accept</function>,
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_connect</function>,
|
||||
<function>socket_listen</function>, and
|
||||
<function>socket_create</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,65 +1,65 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
|
||||
<refentry id="function.socket-write">
|
||||
<refnamediv>
|
||||
<refname>socket_write</refname>
|
||||
<refpurpose>Write to a socket</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>socket_write</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>buffer</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The function <function>socket_write</function> writes to the socket
|
||||
<parameter>socket</parameter> from
|
||||
<parameter>buffer</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
The optional parameter <parameter>length</parameter> can specify an
|
||||
alternate length of bytes written to the socket. If this length is
|
||||
greater then the buffer length, it is silently truncated to the length of
|
||||
the buffer.
|
||||
</para>
|
||||
<para>
|
||||
Returns the number of bytes successfully written to the socket or &false;
|
||||
one error. The error code can be retrieved with
|
||||
<function>socket_last_error</function>. This code may be passed to
|
||||
<function>socket_strerror</function> to get a textual explanation of the
|
||||
error.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>socket_write</function> does not necessarily write all bytes
|
||||
from the given buffer. It's valid that, depending on the network
|
||||
buffers etc., only a certain amount of data, even one byte, is written
|
||||
though your buffer is greater. You have to watch out so you don't
|
||||
unintentionally forget to transmit the rest of your data.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
It is perfectly valid for <function>socket_write</function> to
|
||||
return zero which means no bytes have been written. Be sure to use the
|
||||
<literal>===</literal> operator to check for &false; in case of an
|
||||
error.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_accept</function>,
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_connect</function>,
|
||||
<function>socket_listen</function>,
|
||||
<function>socket_read</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.socket-write">
|
||||
<refnamediv>
|
||||
<refname>socket_write</refname>
|
||||
<refpurpose>Write to a socket</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>socket_write</methodname>
|
||||
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>buffer</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The function <function>socket_write</function> writes to the socket
|
||||
<parameter>socket</parameter> from
|
||||
<parameter>buffer</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
The optional parameter <parameter>length</parameter> can specify an
|
||||
alternate length of bytes written to the socket. If this length is
|
||||
greater then the buffer length, it is silently truncated to the length of
|
||||
the buffer.
|
||||
</para>
|
||||
<para>
|
||||
Returns the number of bytes successfully written to the socket or &false;
|
||||
one error. The error code can be retrieved with
|
||||
<function>socket_last_error</function>. This code may be passed to
|
||||
<function>socket_strerror</function> to get a textual explanation of the
|
||||
error.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>socket_write</function> does not necessarily write all bytes
|
||||
from the given buffer. It's valid that, depending on the network
|
||||
buffers etc., only a certain amount of data, even one byte, is written
|
||||
though your buffer is greater. You have to watch out so you don't
|
||||
unintentionally forget to transmit the rest of your data.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
It is perfectly valid for <function>socket_write</function> to
|
||||
return zero which means no bytes have been written. Be sure to use the
|
||||
<literal>===</literal> operator to check for &false; in case of an
|
||||
error.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>socket_accept</function>,
|
||||
<function>socket_bind</function>,
|
||||
<function>socket_connect</function>,
|
||||
<function>socket_listen</function>,
|
||||
<function>socket_read</function> and
|
||||
<function>socket_strerror</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ssh2-auth-hostbased-file">
|
||||
<refnamediv>
|
||||
<refname>ssh2_auth_hostbased_file</refname>
|
||||
<refpurpose>
|
||||
Authenticate using a public hostkey
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_auth_hostbased_file</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>username</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>hostname</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>pubkeyfile</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>privkeyfile</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>passphrase</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>local_username</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id="function.ssh2-auth-hostbased-file">
|
||||
<refnamediv>
|
||||
<refname>ssh2_auth_hostbased_file</refname>
|
||||
<refpurpose>Authenticate using a public hostkey</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_auth_hostbased_file</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>username</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>hostname</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>pubkeyfile</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>privkeyfile</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>passphrase</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>local_username</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Authenticate using a public hostkey read from a file. If <parameter>privkeyfile</parameter>
|
||||
is encrypted (which it should be), the passphrase must be provided.
|
||||
If <parameter>local_username</parameter> is omitted, then the value for
|
||||
<parameter>username</parameter> will be used for it.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Authenticate using a public hostkey read from a file. If <parameter>privkeyfile</parameter>
|
||||
is encrypted (which it should be), the passphrase must be provided.
|
||||
If <parameter>local_username</parameter> is omitted, then the value for
|
||||
<parameter>username</parameter> will be used for it.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Authentication using a public hostkey</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Authentication using a public hostkey</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22, array('hostkey'=>'ssh-rsa'));
|
||||
|
@ -44,17 +42,17 @@ if (ssh2_auth_hostbased_file($connection, 'remoteusername', 'myhost.example.com'
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<note>
|
||||
<simpara>
|
||||
<function>ssh2_auth_hostbased_file</function> requires libssh2 >= 0.7 and PHP/SSH2 >= 0.7
|
||||
</simpara>
|
||||
</note>
|
||||
<note>
|
||||
<simpara>
|
||||
<function>ssh2_auth_hostbased_file</function> requires libssh2 >= 0.7 and PHP/SSH2 >= 0.7
|
||||
</simpara>
|
||||
</note>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,33 +1,31 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-auth-none">
|
||||
<refnamediv>
|
||||
<refname>ssh2_auth_none</refname>
|
||||
<refpurpose>
|
||||
Authenticate as "none"
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ssh2_auth_none</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>username</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-auth-none">
|
||||
<refnamediv>
|
||||
<refname>ssh2_auth_none</refname>
|
||||
<refpurpose>Authenticate as "none"</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ssh2_auth_none</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>username</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Attempt "none" authentication which usually will (and should) fail.
|
||||
As part of the failure, this function will return an array of accepted
|
||||
authentication methods. If the server does accept "none" as an
|
||||
authentication method for <parameter>username</parameter>, this function
|
||||
will simply return &true;.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Attempt "none" authentication which usually will (and should) fail.
|
||||
As part of the failure, this function will return an array of accepted
|
||||
authentication methods. If the server does accept "none" as an
|
||||
authentication method for <parameter>username</parameter>, this function
|
||||
will simply return &true;.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Using <function>ssh2_auth_none</function> to retreive
|
||||
a list of authentication methods.</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Using <function>ssh2_auth_none</function> to retreive
|
||||
a list of authentication methods.</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -39,11 +37,11 @@ if (in_array('password', $auth_methods)) {
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,29 +1,27 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-auth-password">
|
||||
<refnamediv>
|
||||
<refname>ssh2_auth_password</refname>
|
||||
<refpurpose>
|
||||
Authenticate over SSH using a plain password
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_auth_password</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>username</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>password</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-auth-password">
|
||||
<refnamediv>
|
||||
<refname>ssh2_auth_password</refname>
|
||||
<refpurpose>Authenticate over SSH using a plain password</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_auth_password</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>username</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>password</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Authenticate over SSH using a plain password
|
||||
</simpara>
|
||||
<simpara>
|
||||
Authenticate over SSH using a plain password
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Authenticating with a password</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Authenticating with a password</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -35,11 +33,11 @@ if (ssh2_auth_password($connection, 'username', 'secret')) {
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,32 +1,30 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-auth-pubkey-file">
|
||||
<refnamediv>
|
||||
<refname>ssh2_auth_pubkey_file</refname>
|
||||
<refpurpose>
|
||||
Authenticate using a public key
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_auth_pubkey_file</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>username</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>pubkeyfile</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>privkeyfile</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>passphrase</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-auth-pubkey-file">
|
||||
<refnamediv>
|
||||
<refname>ssh2_auth_pubkey_file</refname>
|
||||
<refpurpose>Authenticate using a public key</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_auth_pubkey_file</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>username</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>pubkeyfile</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>privkeyfile</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>passphrase</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Authenticate using a public key read from a file. If <parameter>privkeyfile</parameter>
|
||||
is encrypted (which it should be), the passphrase must be provided.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Authenticate using a public key read from a file. If <parameter>privkeyfile</parameter>
|
||||
is encrypted (which it should be), the passphrase must be provided.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Authentication using a public key</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Authentication using a public key</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22, array('hostkey'=>'ssh-rsa'));
|
||||
|
@ -40,11 +38,11 @@ if (ssh2_auth_pubkey_file($connection, 'username',
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,229 +1,227 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-connect">
|
||||
<refnamediv>
|
||||
<refname>ssh2_connect</refname>
|
||||
<refpurpose>
|
||||
Connect to an SSH server
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>ssh2_connect</methodname>
|
||||
<methodparam><type>string</type><parameter>host</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>port</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>methods</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>callbacks</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-connect">
|
||||
<refnamediv>
|
||||
<refname>ssh2_connect</refname>
|
||||
<refpurpose>Connect to an SSH server</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>ssh2_connect</methodname>
|
||||
<methodparam><type>string</type><parameter>host</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>port</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>methods</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>callbacks</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Establish a connection to a remote SSH server and return a resource on success, &false; on error.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Establish a connection to a remote SSH server and return a resource on success, &false; on error.
|
||||
</simpara>
|
||||
|
||||
<simpara>
|
||||
<parameter>methods</parameter> may be an associative array with up to four parameters
|
||||
as described below.
|
||||
</simpara>
|
||||
<simpara>
|
||||
<parameter>methods</parameter> may be an associative array with up to four parameters
|
||||
as described below.
|
||||
</simpara>
|
||||
|
||||
<para>
|
||||
<table>
|
||||
<title><parameter>methods</parameter> may be an associative array
|
||||
with any or all of the following parameters.</title>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Index</entry>
|
||||
<entry>Meaning</entry>
|
||||
<entry>Supported Values*</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>kex</entry>
|
||||
<entry>
|
||||
List of key exchange methods to advertise, comma separated
|
||||
in order of preference.
|
||||
</entry>
|
||||
<entry>
|
||||
<literal>diffie-hellman-group1-sha1</literal>,
|
||||
<literal>diffie-hellman-group14-sha1</literal>, and
|
||||
<literal>diffie-hellman-group-exchange-sha1</literal>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>hostkey</entry>
|
||||
<entry>
|
||||
List of hostkey methods to advertise, come separated
|
||||
in order of preference.
|
||||
</entry>
|
||||
<entry>
|
||||
<literal>ssh-rsa</literal> and
|
||||
<literal>ssh-dss</literal>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>client_to_server</entry>
|
||||
<entry>
|
||||
Associative array containing crypt, compression, and
|
||||
message authentication code (MAC) method preferences
|
||||
for messages sent from client to server.
|
||||
</entry>
|
||||
<entry/>
|
||||
</row>
|
||||
<row>
|
||||
<entry>server_to_client</entry>
|
||||
<entry>
|
||||
Associative array containing crypt, compression, and
|
||||
message authentication code (MAC) method preferences
|
||||
for messages sent from client to server.
|
||||
</entry>
|
||||
<entry/>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
<para>
|
||||
<table>
|
||||
<title><parameter>methods</parameter> may be an associative array
|
||||
with any or all of the following parameters.</title>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Index</entry>
|
||||
<entry>Meaning</entry>
|
||||
<entry>Supported Values*</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>kex</entry>
|
||||
<entry>
|
||||
List of key exchange methods to advertise, comma separated
|
||||
in order of preference.
|
||||
</entry>
|
||||
<entry>
|
||||
<literal>diffie-hellman-group1-sha1</literal>,
|
||||
<literal>diffie-hellman-group14-sha1</literal>, and
|
||||
<literal>diffie-hellman-group-exchange-sha1</literal>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>hostkey</entry>
|
||||
<entry>
|
||||
List of hostkey methods to advertise, come separated
|
||||
in order of preference.
|
||||
</entry>
|
||||
<entry>
|
||||
<literal>ssh-rsa</literal> and
|
||||
<literal>ssh-dss</literal>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>client_to_server</entry>
|
||||
<entry>
|
||||
Associative array containing crypt, compression, and
|
||||
message authentication code (MAC) method preferences
|
||||
for messages sent from client to server.
|
||||
</entry>
|
||||
<entry/>
|
||||
</row>
|
||||
<row>
|
||||
<entry>server_to_client</entry>
|
||||
<entry>
|
||||
Associative array containing crypt, compression, and
|
||||
message authentication code (MAC) method preferences
|
||||
for messages sent from client to server.
|
||||
</entry>
|
||||
<entry/>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
|
||||
<simpara>
|
||||
* - Supported Values are dependent on methods supported by underlying library.
|
||||
See <ulink url="&url.libssh2;">libssh2</ulink> documentation for additional
|
||||
information.
|
||||
</simpara>
|
||||
<simpara>
|
||||
* - Supported Values are dependent on methods supported by underlying library.
|
||||
See <ulink url="&url.libssh2;">libssh2</ulink> documentation for additional
|
||||
information.
|
||||
</simpara>
|
||||
|
||||
<para>
|
||||
<table>
|
||||
<title>
|
||||
<parameter>client_to_server</parameter> and
|
||||
<parameter>server_to_client</parameter> may be an associative array
|
||||
with any or all of the following parameters.
|
||||
</title>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Index</entry>
|
||||
<entry>Meaning</entry>
|
||||
<entry>Supported Values*</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>crypt</entry>
|
||||
<entry>List of crypto methods to advertise, comma separated
|
||||
in order of preference.</entry>
|
||||
<entry>
|
||||
<literal>rijndael-cbc@lysator.liu.se</literal>,
|
||||
<literal>aes256-cbc</literal>,
|
||||
<literal>aes192-cbc</literal>,
|
||||
<literal>aes128-cbc</literal>,
|
||||
<literal>3des-cbc</literal>,
|
||||
<literal>blowfish-cbc</literal>,
|
||||
<literal>cast128-cbc</literal>,
|
||||
<literal>arcfour</literal>, and
|
||||
<literal>none**</literal>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>comp</entry>
|
||||
<entry>List of compression methods to advertise, comma separated
|
||||
in order of preference.</entry>
|
||||
<entry>
|
||||
<literal>zlib</literal> and
|
||||
<literal>none</literal>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>mac</entry>
|
||||
<entry>List of MAC methods to advertise, come separated
|
||||
in order of preference.</entry>
|
||||
<entry>
|
||||
<literal>hmac-sha1</literal>,
|
||||
<literal>hmac-sha1-96</literal>,
|
||||
<literal>hmac-ripemd160</literal>,
|
||||
<literal>hmac-ripemd160@openssh.com</literal>, and
|
||||
<literal>none**</literal>
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
<para>
|
||||
<table>
|
||||
<title>
|
||||
<parameter>client_to_server</parameter> and
|
||||
<parameter>server_to_client</parameter> may be an associative array
|
||||
with any or all of the following parameters.
|
||||
</title>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Index</entry>
|
||||
<entry>Meaning</entry>
|
||||
<entry>Supported Values*</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>crypt</entry>
|
||||
<entry>List of crypto methods to advertise, comma separated
|
||||
in order of preference.</entry>
|
||||
<entry>
|
||||
<literal>rijndael-cbc@lysator.liu.se</literal>,
|
||||
<literal>aes256-cbc</literal>,
|
||||
<literal>aes192-cbc</literal>,
|
||||
<literal>aes128-cbc</literal>,
|
||||
<literal>3des-cbc</literal>,
|
||||
<literal>blowfish-cbc</literal>,
|
||||
<literal>cast128-cbc</literal>,
|
||||
<literal>arcfour</literal>, and
|
||||
<literal>none**</literal>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>comp</entry>
|
||||
<entry>List of compression methods to advertise, comma separated
|
||||
in order of preference.</entry>
|
||||
<entry>
|
||||
<literal>zlib</literal> and
|
||||
<literal>none</literal>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>mac</entry>
|
||||
<entry>List of MAC methods to advertise, come separated
|
||||
in order of preference.</entry>
|
||||
<entry>
|
||||
<literal>hmac-sha1</literal>,
|
||||
<literal>hmac-sha1-96</literal>,
|
||||
<literal>hmac-ripemd160</literal>,
|
||||
<literal>hmac-ripemd160@openssh.com</literal>, and
|
||||
<literal>none**</literal>
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<title>Crypt and MAC method "<literal>none</literal>"</title>
|
||||
<simpara>
|
||||
For security reasons, <literal>none</literal> is disabled by the underlying
|
||||
<ulink url="&url.libssh2;">libssh2</ulink> library unless explicitly enabled
|
||||
during build time by using the appropriate ./configure options. See documentation
|
||||
for the underlying library for more information.
|
||||
</simpara>
|
||||
</note>
|
||||
<note>
|
||||
<title>Crypt and MAC method "<literal>none</literal>"</title>
|
||||
<simpara>
|
||||
For security reasons, <literal>none</literal> is disabled by the underlying
|
||||
<ulink url="&url.libssh2;">libssh2</ulink> library unless explicitly enabled
|
||||
during build time by using the appropriate ./configure options. See documentation
|
||||
for the underlying library for more information.
|
||||
</simpara>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
<table>
|
||||
<title><parameter>callbackss</parameter> may be an associative array
|
||||
with any or all of the following parameters.</title>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Index</entry>
|
||||
<entry>Meaning</entry>
|
||||
<entry>Prototype</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>ignore</entry>
|
||||
<entry>
|
||||
Name of function to call when an
|
||||
<constant>SSH2_MSG_IGNORE</constant>
|
||||
packet is received
|
||||
</entry>
|
||||
<entry>void ignore_cb($message)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>debug</entry>
|
||||
<entry>
|
||||
Name of function to call when an
|
||||
<constant>SSH2_MSG_DEBUG</constant>
|
||||
packet is received
|
||||
</entry>
|
||||
<entry>void debug_cb($message, $language, $always_display)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>macerror</entry>
|
||||
<entry>
|
||||
Name of function to call when a
|
||||
packet is received but the message authentication
|
||||
code failed. If the callback returns &true;,
|
||||
the mismatch will be ignored, otherwise the
|
||||
connection will be terminated.
|
||||
</entry>
|
||||
<entry>bool macerror_cb($packet)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>disconnect</entry>
|
||||
<entry>
|
||||
Name of function to call when an
|
||||
<constant>SSH2_MSG_DISCONNECT</constant>
|
||||
packet is received
|
||||
</entry>
|
||||
<entry>void disconnect_cb($reason, $message, $language)</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
<para>
|
||||
<table>
|
||||
<title><parameter>callbackss</parameter> may be an associative array
|
||||
with any or all of the following parameters.</title>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Index</entry>
|
||||
<entry>Meaning</entry>
|
||||
<entry>Prototype</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>ignore</entry>
|
||||
<entry>
|
||||
Name of function to call when an
|
||||
<constant>SSH2_MSG_IGNORE</constant>
|
||||
packet is received
|
||||
</entry>
|
||||
<entry>void ignore_cb($message)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>debug</entry>
|
||||
<entry>
|
||||
Name of function to call when an
|
||||
<constant>SSH2_MSG_DEBUG</constant>
|
||||
packet is received
|
||||
</entry>
|
||||
<entry>void debug_cb($message, $language, $always_display)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>macerror</entry>
|
||||
<entry>
|
||||
Name of function to call when a
|
||||
packet is received but the message authentication
|
||||
code failed. If the callback returns &true;,
|
||||
the mismatch will be ignored, otherwise the
|
||||
connection will be terminated.
|
||||
</entry>
|
||||
<entry>bool macerror_cb($packet)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>disconnect</entry>
|
||||
<entry>
|
||||
Name of function to call when an
|
||||
<constant>SSH2_MSG_DISCONNECT</constant>
|
||||
packet is received
|
||||
</entry>
|
||||
<entry>void disconnect_cb($reason, $message, $language)</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>
|
||||
Open a connection forcing 3des-cbc when sending packets,
|
||||
any strength aes cipher when receiving packets,
|
||||
no compression in either direction,
|
||||
and Group1 key exchange.
|
||||
</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>
|
||||
Open a connection forcing 3des-cbc when sending packets,
|
||||
any strength aes cipher when receiving packets,
|
||||
no compression in either direction,
|
||||
and Group1 key exchange.
|
||||
</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* Notify the user if the server terminates the connection */
|
||||
|
@ -247,25 +245,25 @@ $connection = ssh2_connect('shell.example.com', 22, $methods, $callbacks);
|
|||
if (!$connection) die('Connection failed');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
Once connected, the client should verify the server's hostkey
|
||||
using <function>ssh2_fingerprint</function>, then authenticate
|
||||
using either password or public key.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Once connected, the client should verify the server's hostkey
|
||||
using <function>ssh2_fingerprint</function>, then authenticate
|
||||
using either password or public key.
|
||||
</simpara>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_fingerprint</function>,
|
||||
<function>ssh2_auth_none</function>,
|
||||
<function>ssh2_auth_password</function>, and
|
||||
<function>ssh2_auth_pubkey_file</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_fingerprint</function>,
|
||||
<function>ssh2_auth_none</function>,
|
||||
<function>ssh2_auth_password</function>, and
|
||||
<function>ssh2_auth_pubkey_file</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,34 +1,32 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-exec">
|
||||
<refnamediv>
|
||||
<refname>ssh2_exec</refname>
|
||||
<refpurpose>
|
||||
Execute a command on a remote server
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>ssh2_exec</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>pty</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>env</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>width</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>height</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>width_height_type</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-exec">
|
||||
<refnamediv>
|
||||
<refname>ssh2_exec</refname>
|
||||
<refpurpose>Execute a command on a remote server</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>ssh2_exec</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>pty</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>env</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>width</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>height</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>width_height_type</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Execute a command at the remote end and allocate a channel for it.
|
||||
Returns a stream on success or &false; on failure.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Execute a command at the remote end and allocate a channel for it.
|
||||
Returns a stream on success or &false; on failure.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Executing a command</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Executing a command</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -37,17 +35,17 @@ ssh2_auth_password($connection, 'username', 'password');
|
|||
$stream = ssh2_exec($connection, '/usr/local/bin/php -i');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_connect</function>,
|
||||
<function>ssh2_shell</function>, and
|
||||
<function>ssh2_tunnel</function>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_connect</function>,
|
||||
<function>ssh2_shell</function>, and
|
||||
<function>ssh2_tunnel</function>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,31 +1,29 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-fetch-stream">
|
||||
<refnamediv>
|
||||
<refname>ssh2_fetch_stream</refname>
|
||||
<refpurpose>
|
||||
Fetch an extended data stream
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>ssh2_fetch_stream</methodname>
|
||||
<methodparam><type>resource</type><parameter>channel</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>streamid</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-fetch-stream">
|
||||
<refnamediv>
|
||||
<refname>ssh2_fetch_stream</refname>
|
||||
<refpurpose>Fetch an extended data stream</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>ssh2_fetch_stream</methodname>
|
||||
<methodparam><type>resource</type><parameter>channel</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>streamid</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Fetches an alternate substream associated with an SSH2 channel stream
|
||||
identified by <parameter>streamid</parameter>. The SSH2 protocol
|
||||
currently defines only one substream, STDERR, which has a substream ID
|
||||
of <constant>SSH2_STREAM_STDERR</constant> (defined as 1).
|
||||
</simpara>
|
||||
<simpara>
|
||||
Fetches an alternate substream associated with an SSH2 channel stream
|
||||
identified by <parameter>streamid</parameter>. The SSH2 protocol
|
||||
currently defines only one substream, STDERR, which has a substream ID
|
||||
of <constant>SSH2_STREAM_STDERR</constant> (defined as 1).
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Opening a shell and retrieving the stderr stream associated with it.</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Opening a shell and retrieving the stderr stream associated with it.</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -35,18 +33,18 @@ $stdio_stream = ssh2_shell($connection);
|
|||
$stderr_stream = ssh2_fetch_stream($stdio_stream, SSH2_STREAM_STDERR);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_shell</function>,
|
||||
<function>ssh2_exec</function>, and
|
||||
<function>ssh2_connect</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_shell</function>,
|
||||
<function>ssh2_exec</function>, and
|
||||
<function>ssh2_connect</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,39 +1,37 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-fingerprint">
|
||||
<refnamediv>
|
||||
<refname>ssh2_fingerprint</refname>
|
||||
<refpurpose>
|
||||
Retreive fingerprint of remote server
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>ssh2_fingerprint</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-fingerprint">
|
||||
<refnamediv>
|
||||
<refname>ssh2_fingerprint</refname>
|
||||
<refpurpose>Retreive fingerprint of remote server</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>ssh2_fingerprint</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Returns a server hostkey hash from an active session.
|
||||
Defaults to MD5 fingerprint encoded as ASCII hex values.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Returns a server hostkey hash from an active session.
|
||||
Defaults to MD5 fingerprint encoded as ASCII hex values.
|
||||
</simpara>
|
||||
|
||||
<simpara>
|
||||
<parameter>flags</parameter> may be either of
|
||||
<constant>SSH2_FINGERPRINT_MD5</constant> or
|
||||
<constant>SSH2_FINGERPRINT_SHA1</constant> logically ORed with
|
||||
<constant>SSH2_FINGERPRINT_HEX</constant> or
|
||||
<constant>SSH2_FINGERPRINT_RAW</constant>.
|
||||
Defaults to <constant>SSH2_FINGERPRINT_MD5</constant> |
|
||||
<constant>SSH2_FINGERPRINT_HEX</constant>.
|
||||
</simpara>
|
||||
<simpara>
|
||||
<parameter>flags</parameter> may be either of
|
||||
<constant>SSH2_FINGERPRINT_MD5</constant> or
|
||||
<constant>SSH2_FINGERPRINT_SHA1</constant> logically ORed with
|
||||
<constant>SSH2_FINGERPRINT_HEX</constant> or
|
||||
<constant>SSH2_FINGERPRINT_RAW</constant>.
|
||||
Defaults to <constant>SSH2_FINGERPRINT_MD5</constant> |
|
||||
<constant>SSH2_FINGERPRINT_HEX</constant>.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Checking the fingerprint against a known value</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Checking the fingerprint against a known value</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$known_host = '6F89C2F0A719B30CC38ABDF90755F2E4';
|
||||
|
@ -49,11 +47,11 @@ if ($fingerprint != $known_host) {
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,27 +1,26 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-methods-negotiated">
|
||||
<refnamediv>
|
||||
<refname>ssh2_methods_negotiated</refname>
|
||||
<refpurpose>
|
||||
Return list of negotiated methods
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>ssh2_methods_negotiated</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-methods-negotiated">
|
||||
<refnamediv>
|
||||
<refname>ssh2_methods_negotiated</refname>
|
||||
<refpurpose>Return list of negotiated methods</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>ssh2_methods_negotiated</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Returns list of negotiated methods.
|
||||
</simpara>
|
||||
<para>
|
||||
Returns list of negotiated methods.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Determining what methods were negotiated</title>
|
||||
<programlisting role="php">
|
||||
<para>
|
||||
<example>
|
||||
<title>Determining what methods were negotiated</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -43,16 +42,18 @@ echo "\tMAC: {$methods['server_to_client']['mac']}\n";
|
|||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_connect</function>
|
||||
</simpara>
|
||||
<para>
|
||||
See Also:
|
||||
<function>ssh2_connect</function>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-publickey-list">
|
||||
<refnamediv>
|
||||
|
@ -57,7 +57,7 @@
|
|||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>Name of algorithm used by this publickey, for example:
|
||||
<literal>ssh-dss</literal> or <literal>ssh-rsa</literal>.</entry>
|
||||
<literal>ssh-dss</literal> or <literal>ssh-rsa</literal>.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>blob</entry>
|
||||
|
@ -65,10 +65,10 @@
|
|||
</row>
|
||||
<row>
|
||||
<entry>attrs</entry>
|
||||
<entry>Attributes assigned to this publickey.
|
||||
The most common attribute, and the only one supported by
|
||||
publickey version 1 servers, is <literal>comment</literal>,
|
||||
which may be any freeform string.</entry>
|
||||
<entry>Attributes assigned to this publickey. The most common
|
||||
attribute, and the only one supported by publickey version 1
|
||||
servers, is <literal>comment</literal>, which may be any freeform
|
||||
string.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
|
|
|
@ -1,29 +1,26 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-scp-recv">
|
||||
<refnamediv>
|
||||
<refname>ssh2_scp_recv</refname>
|
||||
<refpurpose>
|
||||
Request a file via SCP
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_scp_recv</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>remote_file</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>local_file</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Copy a file from the remote server to the local filesystem using the SCP protocol.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Downloading a file via SCP</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.ssh2-scp-recv">
|
||||
<refnamediv>
|
||||
<refname>ssh2_scp_recv</refname>
|
||||
<refpurpose>Request a file via SCP</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_scp_recv</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>remote_file</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>local_file</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Copy a file from the remote server to the local filesystem using the SCP protocol.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Downloading a file via SCP</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -32,17 +29,16 @@ ssh2_auth_password($connection, 'username', 'password');
|
|||
ssh2_scp_recv($connection, '/remote/filename', '/local/filename');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_scp_send</function>, and
|
||||
<function>copy</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See Also:
|
||||
<function>ssh2_scp_send</function>, and
|
||||
<function>copy</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,31 +1,29 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-scp-send">
|
||||
<refnamediv>
|
||||
<refname>ssh2_scp_send</refname>
|
||||
<refpurpose>
|
||||
Send a file via SCP
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_scp_send</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>local_file</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>remote_file</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>create_mode</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-scp-send">
|
||||
<refnamediv>
|
||||
<refname>ssh2_scp_send</refname>
|
||||
<refpurpose>Send a file via SCP</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_scp_send</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>local_file</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>remote_file</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>create_mode</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Copy a file from the local filesystem to the remote server using the SCP protocol.
|
||||
The file will be created with the mode specified by <parameter>create_mode</parameter>.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Copy a file from the local filesystem to the remote server using the SCP protocol.
|
||||
The file will be created with the mode specified by <parameter>create_mode</parameter>.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Uploading a file via SCP</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Uploading a file via SCP</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -34,17 +32,17 @@ ssh2_auth_password($connection, 'username', 'password');
|
|||
ssh2_scp_send($connection, '/local/filename', '/remote/filename', 0644);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_scp_recv</function>, and
|
||||
<function>copy</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_scp_recv</function>, and
|
||||
<function>copy</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,33 +1,31 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-sftp-lstat">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_lstat</refname>
|
||||
<refpurpose>
|
||||
Stat a symbolic link
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>ssh2_sftp_lstat</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>path</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-sftp-lstat">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_lstat</refname>
|
||||
<refpurpose>Stat a symbolic link</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>ssh2_sftp_lstat</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>path</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Stats a symbolic link on the remote filesystem <emphasis>without</emphasis>
|
||||
following the link. This function is similar to using the
|
||||
<function>lstat</function> function with the
|
||||
<link linkend="wrappers.ssh2">ssh2.sftp://</link> wrapper in PHP5
|
||||
and returns the same values. See the documentation for
|
||||
<function>stat</function> for details on the values which may be returned.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Stats a symbolic link on the remote filesystem <emphasis>without</emphasis>
|
||||
following the link. This function is similar to using the
|
||||
<function>lstat</function> function with the
|
||||
<link linkend="wrappers.ssh2">ssh2.sftp://</link> wrapper in PHP5
|
||||
and returns the same values. See the documentation for
|
||||
<function>stat</function> for details on the values which may be returned.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Stating a symbolic link via SFTP</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Stating a symbolic link via SFTP</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -44,18 +42,18 @@ $mtime = $statinfo['mtime'];
|
|||
$mode = $statinfo['mode'];
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_sftp_stat</function>,
|
||||
<function>lstat</function>, and
|
||||
<function>stat</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_sftp_stat</function>,
|
||||
<function>lstat</function>, and
|
||||
<function>stat</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-sftp-mkdir">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_mkdir</refname>
|
||||
<refpurpose>
|
||||
Create a directory
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_sftp_mkdir</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>dirname</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>recursive</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-sftp-mkdir">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_mkdir</refname>
|
||||
<refpurpose>Create a directory</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_sftp_mkdir</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>dirname</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>recursive</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Creates a directory on the remote file server with permissions set to
|
||||
<parameter>mode</parameter>. If <parameter>recursive</parameter> is &true;
|
||||
any parent directories required for <parameter>dirname</parameter> will
|
||||
be automatically created as well.
|
||||
This function is similar to using <function>mkdir</function> with the
|
||||
<link linkend="wrappers.ssh2">ssh2.sftp://</link> wrapper.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Creates a directory on the remote file server with permissions set to
|
||||
<parameter>mode</parameter>. If <parameter>recursive</parameter> is &true;
|
||||
any parent directories required for <parameter>dirname</parameter> will
|
||||
be automatically created as well.
|
||||
This function is similar to using <function>mkdir</function> with the
|
||||
<link linkend="wrappers.ssh2">ssh2.sftp://</link> wrapper.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Creating a directory on a remote server</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Creating a directory on a remote server</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -40,17 +38,17 @@ ssh2_sftp_mkdir($sftp, '/home/username/newdir');
|
|||
/* Or: mkdir("ssh2.sftp://$sftp/home/username/newdir"); */
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>mkdir</function>, and
|
||||
<function>ssh2_sftp_rmdir</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>mkdir</function>, and
|
||||
<function>ssh2_sftp_rmdir</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,28 +1,26 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-sftp-readlink">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_readlink</refname>
|
||||
<refpurpose>
|
||||
Return the target of a symbolic link
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>ssh2_sftp_readlink</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>link</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-sftp-readlink">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_readlink</refname>
|
||||
<refpurpose>Return the target of a symbolic link</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>ssh2_sftp_readlink</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>link</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Returns the target of a symbolic link.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Returns the target of a symbolic link.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Reading a symbolic link</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Reading a symbolic link</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -33,17 +31,17 @@ $target = ssh2_sftp_readlink($sftp, '/tmp/mysql.sock');
|
|||
/* $target is now (e.g.): '/var/run/mysql.sock' */
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>readlink</function>, and
|
||||
<function>ssh2_sftp_symlink</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>readlink</function>, and
|
||||
<function>ssh2_sftp_symlink</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,29 +1,27 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-sftp-realpath">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_realpath</refname>
|
||||
<refpurpose>
|
||||
Resolve the realpath of a provided path string
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>ssh2_sftp_realpath</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-sftp-realpath">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_realpath</refname>
|
||||
<refpurpose>Resolve the realpath of a provided path string</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>ssh2_sftp_realpath</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Translates <parameter>filename</parameter> into the effective real path
|
||||
on the remote filesystem.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Translates <parameter>filename</parameter> into the effective real path
|
||||
on the remote filesystem.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Resolving a pathname</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Resolving a pathname</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -34,18 +32,18 @@ $realpath = ssh2_sftp_realpath($sftp, '/home/username/../../../..//./usr/../etc/
|
|||
/* $realpath is now: '/etc/passwd' */
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>realpath</function>, and
|
||||
<function>ssh2_sftp_symlink</function>
|
||||
<function>ssh2_sftp_readlink</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>realpath</function>, and
|
||||
<function>ssh2_sftp_symlink</function>
|
||||
<function>ssh2_sftp_readlink</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,29 +1,27 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-sftp-rename">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_rename</refname>
|
||||
<refpurpose>
|
||||
Rename a remote file
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_sftp_rename</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>from</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>to</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-sftp-rename">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_rename</refname>
|
||||
<refpurpose>Rename a remote file</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_sftp_rename</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>from</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>to</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Renames a file on the remote filesystem.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Renames a file on the remote filesystem.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Renaming a file via sftp</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Renaming a file via sftp</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -33,16 +31,16 @@ $sftp = ssh2_sftp($connection);
|
|||
ssh2_sftp_rename($sftp, '/home/username/oldname', '/home/username/newname');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>rename</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>rename</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,30 +1,28 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-sftp-rmdir">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_rmdir</refname>
|
||||
<refpurpose>
|
||||
Remove a directory
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_sftp_rmdir</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>dirname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-sftp-rmdir">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_rmdir</refname>
|
||||
<refpurpose>Remove a directory</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_sftp_rmdir</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>dirname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Removes a directory from the remote file server.
|
||||
This function is similar to using <function>rmdir</function> with the
|
||||
<link linkend="wrappers.ssh2">ssh2.sftp://</link> wrapper.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Removes a directory from the remote file server.
|
||||
This function is similar to using <function>rmdir</function> with the
|
||||
<link linkend="wrappers.ssh2">ssh2.sftp://</link> wrapper.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Removing a directory on a remote server</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Removing a directory on a remote server</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -35,18 +33,18 @@ ssh2_sftp_rmdir($sftp, '/home/username/deltodel');
|
|||
/* Or: rmdir("ssh2.sftp://$sftp/home/username/dirtodel"); */
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>rmdir</function>, and
|
||||
<function>ssh2_sftp_mkdir</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>rmdir</function>, and
|
||||
<function>ssh2_sftp_mkdir</function>
|
||||
</simpara>
|
||||
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,32 +1,30 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-sftp-stat">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_stat</refname>
|
||||
<refpurpose>
|
||||
Stat a file on a remote filesystem
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>ssh2_sftp_stat</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>path</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-sftp-stat">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_stat</refname>
|
||||
<refpurpose>Stat a file on a remote filesystem</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>ssh2_sftp_stat</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>path</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Stats a file on the remote filesystem following any symbolic links.
|
||||
This function is similar to using the <function>stat</function> function
|
||||
with the <link linkend="wrappers.ssh2">ssh2.sftp://</link> wrapper in PHP5
|
||||
and returns the same values. See the documentation for
|
||||
<function>stat</function> for details on the values which may be returned.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Stats a file on the remote filesystem following any symbolic links.
|
||||
This function is similar to using the <function>stat</function> function
|
||||
with the <link linkend="wrappers.ssh2">ssh2.sftp://</link> wrapper in PHP5
|
||||
and returns the same values. See the documentation for
|
||||
<function>stat</function> for details on the values which may be returned.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Stating a file via SFTP</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Stating a file via SFTP</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -43,18 +41,18 @@ $mtime = $statinfo['mtime'];
|
|||
$mode = $statinfo['mode'];
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_sftp_lstat</function>,
|
||||
<function>lstat</function>, and
|
||||
<function>stat</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_sftp_lstat</function>,
|
||||
<function>lstat</function>, and
|
||||
<function>stat</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,30 +1,28 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-sftp-symlink">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_symlink</refname>
|
||||
<refpurpose>
|
||||
Create a symlink
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_sftp_symlink</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>target</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>link</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-sftp-symlink">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_symlink</refname>
|
||||
<refpurpose>Create a symlink</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_sftp_symlink</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>target</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>link</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Creates a symbolic link named <parameter>link</parameter> on the remote filesystem
|
||||
pointing to <parameter>target</parameter>.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Creates a symbolic link named <parameter>link</parameter> on the remote filesystem
|
||||
pointing to <parameter>target</parameter>.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Creating a symbolic link</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Creating a symbolic link</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -34,17 +32,17 @@ $sftp = ssh2_sftp($connection);
|
|||
ssh2_sftp_symlink($sftp, '/var/run/mysql.sock', '/tmp/mysql.sock');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>symlink</function>, and
|
||||
<function>ssh2_sftp_readlink</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>symlink</function>, and
|
||||
<function>ssh2_sftp_readlink</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,28 +1,26 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-sftp-unlink">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_unlink</refname>
|
||||
<refpurpose>
|
||||
Delete a file
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_sftp_unlink</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-sftp-unlink">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp_unlink</refname>
|
||||
<refpurpose>Delete a file</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ssh2_sftp_unlink</methodname>
|
||||
<methodparam><type>resource</type><parameter>sftp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Deletes a file on the remote filesystem
|
||||
</simpara>
|
||||
<simpara>
|
||||
Deletes a file on the remote filesystem
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Deleting a file</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Deleting a file</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -32,16 +30,16 @@ $sftp = ssh2_sftp($connection);
|
|||
ssh2_sftp_unlink($sftp, '/home/username/stale_file');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>unlink</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>unlink</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,33 +1,31 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-sftp">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp</refname>
|
||||
<refpurpose>
|
||||
Initialize SFTP subsystem
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>ssh2_sftp</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-sftp">
|
||||
<refnamediv>
|
||||
<refname>ssh2_sftp</refname>
|
||||
<refpurpose>Initialize SFTP subsystem</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>ssh2_sftp</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Request the SFTP subsystem from an already connected SSH2 server.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Request the SFTP subsystem from an already connected SSH2 server.
|
||||
</simpara>
|
||||
|
||||
<simpara>
|
||||
This method returns an <literal>SSH2 SFTP</literal> resource for use with
|
||||
all other ssh2_sftp_*() methods and the
|
||||
<link linkend="wrappers.ssh2">ssh2.sftp://</link> fopen wrapper.
|
||||
</simpara>
|
||||
<simpara>
|
||||
This method returns an <literal>SSH2 SFTP</literal> resource for use with
|
||||
all other ssh2_sftp_*() methods and the
|
||||
<link linkend="wrappers.ssh2">ssh2.sftp://</link> fopen wrapper.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Opening a file via SFTP</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Opening a file via SFTP</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -38,17 +36,17 @@ $sftp = ssh2_sftp($connection);
|
|||
$stream = fopen("ssh2.sftp://$sftp/path/to/file", 'r');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_scp_send</function>, and
|
||||
<function>ssh2_scp_recv</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_scp_send</function>, and
|
||||
<function>ssh2_scp_recv</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,44 +1,42 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-shell">
|
||||
<refnamediv>
|
||||
<refname>ssh2_shell</refname>
|
||||
<refpurpose>
|
||||
Request an interactive shell
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>ssh2_shell</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>term_type</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>env</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>width</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>height</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>width_height_type</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-shell">
|
||||
<refnamediv>
|
||||
<refname>ssh2_shell</refname>
|
||||
<refpurpose>Request an interactive shell</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>ssh2_shell</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>term_type</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>env</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>width</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>height</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>width_height_type</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Open a shell at the remote end and allocate a stream for it.
|
||||
<parameter>term_type</parameter> should correspond to one of the entries
|
||||
in the target system's <literal>/etc/termcap</literal> file and defaults to <literal>vanilla</literal>.
|
||||
<parameter>env</parameter> may be passed as an associative array of name/value pairs
|
||||
to set in the target environment.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Open a shell at the remote end and allocate a stream for it.
|
||||
<parameter>term_type</parameter> should correspond to one of the entries
|
||||
in the target system's <literal>/etc/termcap</literal> file and defaults to <literal>vanilla</literal>.
|
||||
<parameter>env</parameter> may be passed as an associative array of name/value pairs
|
||||
to set in the target environment.
|
||||
</simpara>
|
||||
|
||||
<simpara>
|
||||
<parameter>width</parameter>, and <parameter>height</parameter>
|
||||
define the width and height of the virtual terminal allocated for the shell process.
|
||||
<parameter>width_height_type</parameter> should be one of
|
||||
<constant>SSH2_TERM_UNIT_CHARS</constant> or
|
||||
<constant>SSH2_TERM_UNIT_PIXELS</constant>.
|
||||
</simpara>
|
||||
<simpara>
|
||||
<parameter>width</parameter>, and <parameter>height</parameter>
|
||||
define the width and height of the virtual terminal allocated for the shell process.
|
||||
<parameter>width_height_type</parameter> should be one of
|
||||
<constant>SSH2_TERM_UNIT_CHARS</constant> or
|
||||
<constant>SSH2_TERM_UNIT_PIXELS</constant>.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Executing a command</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Executing a command</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -47,18 +45,18 @@ ssh2_auth_password($connection, 'username', 'password');
|
|||
$stream = ssh2_shell($connection, 'vt102', null, 80, 24, SSH2_TERM_UNIT_CHARS);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_exec</function>,
|
||||
<function>ssh2_tunnel</function>, and
|
||||
<function>ssh2_fetch_stream</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_exec</function>,
|
||||
<function>ssh2_tunnel</function>, and
|
||||
<function>ssh2_fetch_stream</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,30 +1,28 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-tunnel">
|
||||
<refnamediv>
|
||||
<refname>ssh2_tunnel</refname>
|
||||
<refpurpose>
|
||||
Open a tunnel through a remote server
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>ssh2_tunnel</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>host</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>port</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<refentry id="function.ssh2-tunnel">
|
||||
<refnamediv>
|
||||
<refname>ssh2_tunnel</refname>
|
||||
<refpurpose>Open a tunnel through a remote server</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>ssh2_tunnel</methodname>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>host</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>port</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<simpara>
|
||||
Open a socket stream to an arbitrary host/port by way of the
|
||||
currently connected SSH server.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Open a socket stream to an arbitrary host/port by way of the
|
||||
currently connected SSH server.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Opening a tunnel to an arbitrary host</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>Opening a tunnel to an arbitrary host</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
@ -33,17 +31,17 @@ ssh2_auth_pubkey_file($connection, 'username', 'id_dsa.pub', 'id_dsa');
|
|||
$tunnel = ssh2_tunnel($connection, '10.0.0.101', 12345);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_connect</function>, and
|
||||
<function>fsockopen</function>
|
||||
</simpara>
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_connect</function>, and
|
||||
<function>fsockopen</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<!-- splitted from ./en/functions/sybase.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.sybase-affected-rows">
|
||||
<refnamediv>
|
||||
|
@ -9,10 +9,10 @@
|
|||
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>sybase_affected_rows</methodname>
|
||||
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>sybase_affected_rows</methodname>
|
||||
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>sybase_affected_rows</function> returns the number of
|
||||
rows affected by the last INSERT, UPDATE or DELETE query on the
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sybase.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.sybase-close">
|
||||
<refnamediv>
|
||||
|
@ -8,13 +8,13 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sybase_close</methodname>
|
||||
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sybase_close</methodname>
|
||||
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>sybase_close</function> closes the link to a Sybase
|
||||
database that's associated with the specified link
|
||||
database that's associated with the specified link
|
||||
<parameter>link_identifier</parameter>.
|
||||
If the link identifier isn't specified, the last opened link is
|
||||
assumed.
|
||||
|
@ -22,20 +22,20 @@
|
|||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
Note that this isn't usually necessary, as non-persistent
|
||||
open links are automatically closed at the end of the script's
|
||||
execution.
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
<function>sybase_close</function> will not close persistent links
|
||||
generated by <function>sybase_pconnect</function>.
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
See also
|
||||
<function>sybase_connect</function> and
|
||||
<function>sybase_pconnect</function>.
|
||||
</para>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/sybase.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.sybase-connect">
|
||||
<refnamediv>
|
||||
|
@ -8,24 +8,24 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>sybase_connect</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>servername</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>username</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>password</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>appname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>sybase_connect</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>servername</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>username</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>password</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>appname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns a positive Sybase link identifier on success, or
|
||||
&false; on failure.
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
<function>sybase_connect</function> establishes a connection to a
|
||||
Sybase server. The servername argument has to be a valid
|
||||
servername that is defined in the 'interfaces' file.
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
In case a second call is made to
|
||||
<function>sybase_connect</function> with the same arguments, no
|
||||
new link will be established, but instead, the link identifier of
|
||||
|
@ -52,7 +52,7 @@ sybase_close($link);
|
|||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
See also
|
||||
<function>sybase_pconnect</function> and
|
||||
<function>sybase_close</function>.
|
||||
</para>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sybase.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.sybase-data-seek">
|
||||
<refnamediv>
|
||||
|
@ -8,22 +8,22 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sybase_data_seek</methodname>
|
||||
<methodparam><type>resource</type><parameter>result_identifier</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>row_number</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sybase_data_seek</methodname>
|
||||
<methodparam><type>resource</type><parameter>result_identifier</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>row_number</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
<function>sybase_data_seek</function> moves the internal row
|
||||
pointer of the Sybase result associated with the specified result
|
||||
identifier to pointer to the specified row number. The next call
|
||||
to <function>sybase_fetch_row</function> would return that row.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<para>
|
||||
See also
|
||||
<function>sybase_fetch_row</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<refentry id="function.sybase-deadlock-retry-count">
|
||||
<refnamediv>
|
||||
<refname>sybase_deadlock_retry_count</refname>
|
||||
|
@ -7,18 +7,18 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>sybase_deadlock_retry_count</methodname>
|
||||
<methodparam><type>int</type><parameter>retry_count</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>sybase_deadlock_retry_count</methodname>
|
||||
<methodparam><type>int</type><parameter>retry_count</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Using <function>sybase_deadlock_retry_count</function>, the number of retries
|
||||
can be defined in cases of deadlocks. By default, every deadlock is retried
|
||||
an infinite number of times or until the process is killed by Sybase, the
|
||||
an infinite number of times or until the process is killed by Sybase, the
|
||||
executing script is killed (for instance, by <function>set_time_limit</function>)
|
||||
or the query succeeds.
|
||||
</para>
|
||||
|
||||
|
||||
&sybase.ct.only;
|
||||
|
||||
<para>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/sybase.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.sybase-fetch-array">
|
||||
<refnamediv>
|
||||
|
@ -8,10 +8,10 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>sybase_fetch_array</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>sybase_fetch_array</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns an array that corresponds to the fetched row, or
|
||||
&false; if there are no more rows.
|
||||
|
@ -29,7 +29,7 @@
|
|||
provides a significant added value.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<para>
|
||||
When selecting fields with identical names (for instance, in
|
||||
a join), the associative indices will have a sequential number prepended.
|
||||
See the example for details.
|
||||
|
@ -50,7 +50,7 @@ sybase_close($dbh);
|
|||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
The above example would produce the following output (assuming the two tables only
|
||||
The above example would produce the following output (assuming the two tables only
|
||||
have each one column called "person_id"):
|
||||
</para>
|
||||
<screen>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id="function.sybase-fetch-assoc">
|
||||
<refnamediv>
|
||||
<refname>sybase_fetch_assoc</refname>
|
||||
|
@ -7,22 +7,22 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>sybase_fetch_assoc</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>sybase_fetch_assoc</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns an array that corresponds to the fetched row, or
|
||||
&false; if there are no more rows.
|
||||
</para>
|
||||
|
||||
|
||||
&sybase.ct.only;
|
||||
|
||||
|
||||
<para>
|
||||
<function>sybase_fetch_assoc</function> is a version of
|
||||
<function>sybase_fetch_row</function> that uses column names
|
||||
instead of integers for indices in the result array. Columns from
|
||||
different tables with the same names are returned as
|
||||
different tables with the same names are returned as
|
||||
name, name1, name2, ..., nameN.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -33,8 +33,8 @@
|
|||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>sybase_fetch_array</function>,
|
||||
<function>sybase_fetch_object</function> and
|
||||
<function>sybase_fetch_array</function>,
|
||||
<function>sybase_fetch_object</function> and
|
||||
<function>sybase_fetch_row</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/sybase.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.sybase-fetch-field">
|
||||
<refnamediv>
|
||||
|
@ -8,13 +8,13 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>object</type><methodname>sybase_fetch_field</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>field_offset</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>object</type><methodname>sybase_fetch_field</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>field_offset</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns an object containing field information.
|
||||
Returns an object containing field information.
|
||||
</para>
|
||||
<para>
|
||||
<function>sybase_fetch_field</function> can be used in order to
|
||||
|
@ -46,7 +46,7 @@
|
|||
<simpara>
|
||||
numeric - 1 if the column is numeric
|
||||
</simpara>
|
||||
</listitem>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
type - datatype of the column
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/sybase.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.sybase-fetch-object">
|
||||
<refnamediv>
|
||||
|
@ -8,20 +8,20 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>object</type><methodname>sybase_fetch_object</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>mixed</type><parameter>object</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>object</type><methodname>sybase_fetch_object</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>mixed</type><parameter>object</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns an object with properties that correspond to the
|
||||
fetched row, or &false; if there are no more rows.
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
<function>sybase_fetch_object</function> is similar to
|
||||
<function>sybase_fetch_assoc</function>, with one difference - an object
|
||||
is returned, instead of an array.
|
||||
</para>
|
||||
</para>
|
||||
<para>
|
||||
Use the second <parameter>object</parameter> to specify the type of object
|
||||
you want to return. If this parameter is omitted, the object will be of
|
||||
|
@ -69,7 +69,7 @@ object(stdclass)(3) {
|
|||
class Foo {
|
||||
var $foo, $bar, $baz;
|
||||
}
|
||||
|
||||
|
||||
// {...]
|
||||
$qrh= sybase_query('SELECT foo, bar, baz FROM example');
|
||||
$foo= sybase_fetch_object($qrh, 'Foo');
|
||||
|
@ -85,8 +85,8 @@ object(stdclass)(3) {
|
|||
<function>sybase_fetch_array</function>, and almost as quick as
|
||||
<function>sybase_fetch_row</function> (the difference is insignificant).
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<para>
|
||||
See also
|
||||
<function>sybase_fetch_array</function> and
|
||||
<function>sybase_fetch_row</function>.
|
||||
</para>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/sybase.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.sybase-fetch-row">
|
||||
<refnamediv>
|
||||
|
@ -8,10 +8,10 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>sybase_fetch_row</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>sybase_fetch_row</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns an array that corresponds to the fetched row, or
|
||||
&false; if there are no more rows.
|
||||
|
@ -57,7 +57,7 @@
|
|||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
See also
|
||||
See also
|
||||
<function>sybase_fetch_array</function>,
|
||||
<function>sybase_fetch_assoc</function>,
|
||||
<function>sybase_fetch_object</function>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/sybase.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.sybase-field-seek">
|
||||
<refnamediv>
|
||||
|
@ -8,11 +8,11 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sybase_field_seek</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>field_offset</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sybase_field_seek</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>field_offset</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Seeks to the specified field offset. If the next call to
|
||||
<function>sybase_fetch_field</function> won't include a field
|
||||
|
@ -22,7 +22,7 @@
|
|||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
See also
|
||||
<function>sybase_fetch_field</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue