Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 152 additions & 0 deletions reference/posix/functions/posix-eaccess.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="function.posix-eaccess" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>posix_eaccess</refname>
<refpurpose>
Determine accessibility of a file
</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>posix_eaccess</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
<function>posix_eaccess</function> checks the effective user's permission of a file
</para>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>
The name of a file to be tested.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>
A mask consisting of one or more of <constant>POSIX_F_OK</constant>,
<constant>POSIX_R_OK</constant>, <constant>POSIX_W_OK</constant> and
<constant>POSIX_X_OK</constant>.
</para>
<para>
<constant>POSIX_R_OK</constant>, <constant>POSIX_W_OK</constant> and
<constant>POSIX_X_OK</constant> request checking whether the file
exists and has read, write and execute permissions, respectively.
<constant>POSIX_F_OK</constant> just requests checking for the
existence of the file.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

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

<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.3.0</entry>
<entry>
Checks the effective user/group for a file, differing
from <function>posix_access</function> which checks
from the real user/group.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>posix_eaccess</function> example</title>
<para>
This example will check if the $file is readable and writable, otherwise
will print an error message.
</para>
<programlisting role="php">
<![CDATA[
<?php

$file = 'some_file';

if (posix_eaccess($file, POSIX_R_OK | POSIX_W_OK)) {
echo 'The file is readable and writable!';

} else {
$error = posix_get_last_error();

echo "Error $error: " . posix_strerror($error);
}

?>
]]>
</programlisting>
</example>
</para>
</refsect1>

<refsect1 role="notes">
&reftitle.notes;
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>posix_get_last_error</function></member>
<member><function>posix_strerror</function></member>
<member><function>posix_access</function></member>
</simplelist>
</para>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
113 changes: 113 additions & 0 deletions reference/posix/functions/posix-fpathconf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="function.posix-fpathconf" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>posix_fpathconf</refname>
<refpurpose>Returns the value of a configurable limit</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>int</type><type>false</type></type><methodname>posix_fpathconf</methodname>
<methodparam><type class="union"><type>resource</type><type>int</type></type><parameter>file_descriptor</parameter></methodparam>
<methodparam><type>int</type><parameter>name</parameter></methodparam>
</methodsynopsis>
<para>
Returns the value of a configurable limit from <parameter>name</parameter> for a file descriptor <parameter>resource</parameter>
</para>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&posix.parameter.fd;
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>
The name of the configurable limit, one of the following.
<constant>POSIX_PC_LINK_MAX</constant>, <constant>POSIX_PC_MAX_CANON</constant>
<constant>POSIX_PC_MAX_INPUT</constant>, <constant>POSIX_PC_NAME_MAX</constant>
<constant>POSIX_PC_PATH_MAX</constant>, <constant>POSIX_PC_PIPE_BUF</constant>
<constant>POSIX_PC_CHOWN_RESTRICTED</constant>, <constant>POSIX_PC_NO_TRUNC</constant>
<constant>POSIX_PC_ALLOC_SIZE_MIN</constant>, <constant>POSIX_PC_SYMLINK_MAX</constant>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the configurable limit or &false;.
</para>
</refsect1>

<refsect1 role="errors">
&reftitle.errors;
<para>
Throws a <classname>ValueError</classname>
when <parameter>resource</parameter> is invalid.
</para>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<example xml:id="function.posix-fpathconf.example.basic">
<title><function>posix_fpathconf</function> example</title>
<para>
This example will get the max path name's length in bytes
for the current dir.
</para>
<programlisting role="php">
<![CDATA[
<?php
$fd = fopen(__DIR__, "r");
echo posix_fpathconf($fd, POSIX_PC_PATH_MAX);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
4096
]]>
</screen>
</example>
</refsect1>

<refsect1 role="notes">
&reftitle.notes;
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>posix_pathconf</function></member>
</simplelist>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
38 changes: 36 additions & 2 deletions reference/posix/functions/posix-getrlimit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
&reftitle.description;
<methodsynopsis>
<type class="union"><type>array</type><type>false</type></type><methodname>posix_getrlimit</methodname>
<void/>
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>resource</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<para>
<function>posix_getrlimit</function> returns an <type>array</type>
Expand All @@ -21,7 +21,19 @@

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>resource</parameter></term>
<listitem>
<para>
If &null; all resource limits will be fetched.
Otherwise, the only limits of the resource type provided will be returned.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

<refsect1 role="returnvalues">
Expand Down Expand Up @@ -115,6 +127,28 @@
</para>
</refsect1>

<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.3.0</entry>
<entry>
The optional <parameter>resource</parameter> parameter has been added.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<para>
Expand Down
23 changes: 23 additions & 0 deletions reference/posix/functions/posix-isatty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,29 @@
to a terminal and &false; otherwise.
</para>
</refsect1>

<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.3.0</entry>
<entry>
Type error <constant>E_WARNING</constant>s are now raised for integer
coercions following the usual PHP type coercion semantics.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
Expand Down
Loading