[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-cvs
Subject:    [DOC-CVS] [doc-en] master: [PHP 8.1] Use an `finfo` instance instead of a resource (#985)
From:       Sergey Panteleev via GitHub <noreply () php ! net>
Date:       2021-09-30 4:57:25
Message-ID: aMuWlx5ucvQyLCMDfGaguwChYaj3daVVLkAXybMcIxY () main ! php ! net
[Download RAW message or body]

Author: Sergey Panteleev (saundefined)
Committer: GitHub (web-flow)
Pusher: saundefined
Date: 2021-09-30T07:57:59+03:00

Commit: https://github.com/php/doc-en/commit/68ba58040e609589967077df116e715ffd865cdb
Raw diff: https://github.com/php/doc-en/commit/68ba58040e609589967077df116e715ffd865cdb.diff


[PHP 8.1] Use an `finfo` instance instead of a resource (#985)

Co-authored-by: George Peter Banyard <girgias@php.net>

Changed paths:
  M  language-snippets.ent
  M  reference/fileinfo/functions/finfo-buffer.xml
  M  reference/fileinfo/functions/finfo-close.xml
  M  reference/fileinfo/functions/finfo-file.xml
  M  reference/fileinfo/functions/finfo-open.xml
  M  reference/fileinfo/functions/finfo-set-flags.xml
  M  reference/fileinfo/setup.xml


Diff:

diff --git a/language-snippets.ent b/language-snippets.ent
index ea2b848228f..15b29146e38 100644
--- a/language-snippets.ent
+++ b/language-snippets.ent
@@ -670,6 +670,16 @@ information. Use <link \
linkend="language.operators.comparison">the ===  operator</link> for testing the \
return value of this  function.</simpara></warning>'>
 
+<!-- FileInfo -->
+<!ENTITY fileinfo.parameters.finfo '<para xmlns="http://docbook.org/ns/docbook">An \
<classname>finfo</classname> instance, returned by \
<function>finfo_open</function>.</para>'> +<!ENTITY fileinfo.changelog.finfo-object \
'<row xmlns="http://docbook.org/ns/docbook"> + <entry>8.1.0</entry>
+ <entry>
+  The <parameter>finfo</parameter> parameter expects an <classname>finfo</classname>
+  instance now; previously, a &resource; was expected.
+ </entry>
+</row>'>
+
 <!-- OpenSSL -->
 <!ENTITY openssl.param.x509 '<varlistentry xmlns="http://docbook.org/ns/docbook">
  <term><parameter>x509</parameter></term>
diff --git a/reference/fileinfo/functions/finfo-buffer.xml \
b/reference/fileinfo/functions/finfo-buffer.xml index b3b8bd918e9..0b76e24840a 100644
--- a/reference/fileinfo/functions/finfo-buffer.xml
+++ b/reference/fileinfo/functions/finfo-buffer.xml
@@ -12,7 +12,7 @@
   <para>&style.procedural;</para>
   <methodsynopsis role="procedural">
    <type class="union"><type>string</type><type>false</type></type><methodname>finfo_buffer</methodname>
                
-   <methodparam><type>resource</type><parameter>finfo</parameter></methodparam>
+   <methodparam><type>finfo</type><parameter>finfo</parameter></methodparam>
    <methodparam><type>string</type><parameter>string</parameter></methodparam>
    <methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer><constant>FILEINFO_NONE</constant></initializer></methodparam>
  <methodparam choice="opt"><type \
class="union"><type>resource</type><type>null</type></type><parameter>context</parameter><initializer>&null;</initializer></methodparam>
 @@ -37,9 +37,7 @@
     <varlistentry>
      <term><parameter>finfo</parameter></term>
      <listitem>
-      <para>
-       Fileinfo resource returned by <function>finfo_open</function>.
-      </para>
+      &fileinfo.parameters.finfo;
      </listitem>
     </varlistentry>
     <varlistentry>
@@ -88,6 +86,7 @@
      </row>
     </thead>
     <tbody>
+     &fileinfo.changelog.finfo-object;
      <row>
       <entry>8.0.0</entry>
       <entry>
diff --git a/reference/fileinfo/functions/finfo-close.xml \
b/reference/fileinfo/functions/finfo-close.xml index be0705087a6..a51ce800bac 100644
--- a/reference/fileinfo/functions/finfo-close.xml
+++ b/reference/fileinfo/functions/finfo-close.xml
@@ -4,17 +4,17 @@
 <refentry xml:id="function.finfo-close" xmlns="http://docbook.org/ns/docbook">
  <refnamediv>
   <refname>finfo_close</refname>
-  <refpurpose>Close fileinfo resource</refpurpose>
+  <refpurpose>Close finfo instance</refpurpose>
  </refnamediv>
  <refsect1 role="description">
   &reftitle.description;
   <methodsynopsis role="procedural">
    <type>bool</type><methodname>finfo_close</methodname>
-   <methodparam><type>resource</type><parameter>finfo</parameter></methodparam>
+   <methodparam><type>finfo</type><parameter>finfo</parameter></methodparam>
   </methodsynopsis>
 
   <para>
-   This function closes the resource opened by <function>finfo_open</function>.
+   This function closes the instance opened by <function>finfo_open</function>.
   </para>
 
  </refsect1>
@@ -25,9 +25,7 @@
     <varlistentry>
      <term><parameter>finfo</parameter></term>
      <listitem>
-      <para>
-       Fileinfo resource returned by <function>finfo_open</function>.
-      </para>
+      &fileinfo.parameters.finfo;
      </listitem>
     </varlistentry>
    </variablelist>
@@ -40,6 +38,23 @@
   </para>
  </refsect1>
 
+ <refsect1 role="changelog">
+  &reftitle.changelog;
+  <informaltable>
+   <tgroup cols="2">
+    <thead>
+     <row>
+      <entry>&Version;</entry>
+      <entry>&Description;</entry>
+     </row>
+    </thead>
+    <tbody>
+     &fileinfo.changelog.finfo-object;
+    </tbody>
+   </tgroup>
+  </informaltable>
+ </refsect1>
+
 </refentry>
 
 <!-- Keep this comment at the end of the file
diff --git a/reference/fileinfo/functions/finfo-file.xml \
b/reference/fileinfo/functions/finfo-file.xml index e216cd93d70..97c055ef96a 100644
--- a/reference/fileinfo/functions/finfo-file.xml
+++ b/reference/fileinfo/functions/finfo-file.xml
@@ -12,7 +12,7 @@
   <para>&style.procedural;</para>
   <methodsynopsis role="procedural">
    <type class="union"><type>string</type><type>false</type></type><methodname>finfo_file</methodname>
                
-   <methodparam><type>resource</type><parameter>finfo</parameter></methodparam>
+   <methodparam><type>finfo</type><parameter>finfo</parameter></methodparam>
    <methodparam><type>string</type><parameter>filename</parameter></methodparam>
    <methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer><constant>FILEINFO_NONE</constant></initializer></methodparam>
  <methodparam choice="opt"><type \
class="union"><type>resource</type><type>null</type></type><parameter>context</parameter><initializer>&null;</initializer></methodparam>
 @@ -37,9 +37,7 @@
     <varlistentry>
      <term><parameter>finfo</parameter></term>
      <listitem>
-      <para>
-       Fileinfo resource returned by <function>finfo_open</function>.
-      </para>
+      &fileinfo.parameters.finfo;
      </listitem>
     </varlistentry>
     <varlistentry>
@@ -89,6 +87,7 @@
      </row>
     </thead>
     <tbody>
+     &fileinfo.changelog.finfo-object;
      <row>
       <entry>8.0.0</entry>
       <entry>
diff --git a/reference/fileinfo/functions/finfo-open.xml \
b/reference/fileinfo/functions/finfo-open.xml index e888355d313..58370d10bd8 100644
--- a/reference/fileinfo/functions/finfo-open.xml
+++ b/reference/fileinfo/functions/finfo-open.xml
@@ -4,14 +4,14 @@
  <refnamediv>
   <refname>finfo_open</refname>
   <refname>finfo::__construct</refname>
-  <refpurpose>Create a new fileinfo resource</refpurpose>
+  <refpurpose>Create a new finfo instance</refpurpose>
  </refnamediv>
 
  <refsect1 role="description">
   &reftitle.description;
   <para>&style.procedural;</para>
   <methodsynopsis role="procedural">
-   <type class="union"><type>resource</type><type>false</type></type><methodname>finfo_open</methodname>
 +   <type class="union"><type>finfo</type><type>false</type></type><methodname>finfo_open</methodname>
  <methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer><constant>FILEINFO_NONE</constant></initializer></methodparam>
  <methodparam choice="opt"><type \
class="union"><type>string</type><type>null</type></type><parameter>magic_database</parameter><initializer>&null;</initializer></methodparam>
  </methodsynopsis>
@@ -22,7 +22,7 @@
    <methodparam choice="opt"><type \
class="union"><type>string</type><type>null</type></type><parameter>magic_database</parameter><initializer>&null;</initializer></methodparam>
  </constructorsynopsis>
   <para>
-   This function opens a magic database and returns its resource.
+   This function opens a magic database and returns its instance.
   </para>
  </refsect1>
 
@@ -63,7 +63,7 @@
   &reftitle.returnvalues;
   <para>
    (Procedural style only)
-   Returns a magic database resource on success&return.falseforfailure;.
+   Returns an <classname>finfo</classname> instance on \
success,&return.falseforfailure;.  </para>
  </refsect1>
 
@@ -78,6 +78,13 @@
      </row>
     </thead>
     <tbody>
+     <row>
+      <entry>8.1.0</entry>
+      <entry>
+       Returns an <classname>finfo</classname> instance now;
+       previously, a &resource; was returned.
+      </entry>
+     </row>
      <row>
       <entry>8.0.3</entry>
       <entry>
diff --git a/reference/fileinfo/functions/finfo-set-flags.xml \
b/reference/fileinfo/functions/finfo-set-flags.xml index 2ad51d1af77..0c739f50258 \
                100644
--- a/reference/fileinfo/functions/finfo-set-flags.xml
+++ b/reference/fileinfo/functions/finfo-set-flags.xml
@@ -12,7 +12,7 @@
   <para>&style.procedural;</para>
   <methodsynopsis role="procedural">
    <type>bool</type><methodname>finfo_set_flags</methodname>
-   <methodparam><type>resource</type><parameter>finfo</parameter></methodparam>
+   <methodparam><type>finfo</type><parameter>finfo</parameter></methodparam>
    <methodparam><type>int</type><parameter>flags</parameter></methodparam>
   </methodsynopsis>
   <para>&style.oop;</para>
@@ -34,9 +34,7 @@
     <varlistentry>
      <term><parameter>finfo</parameter></term>
      <listitem>
-      <para>
-       Fileinfo resource returned by <function>finfo_open</function>.
-      </para>
+      &fileinfo.parameters.finfo;
      </listitem>
     </varlistentry>
     <varlistentry>
@@ -58,6 +56,23 @@
   </para>
  </refsect1>
 
+ <refsect1 role="changelog">
+  &reftitle.changelog;
+  <informaltable>
+   <tgroup cols="2">
+    <thead>
+     <row>
+      <entry>&Version;</entry>
+      <entry>&Description;</entry>
+     </row>
+    </thead>
+    <tbody>
+     &fileinfo.changelog.finfo-object;
+    </tbody>
+   </tgroup>
+  </informaltable>
+ </refsect1>
+ 
 </refentry>
 <!-- Keep this comment at the end of the file
 Local variables:
diff --git a/reference/fileinfo/setup.xml b/reference/fileinfo/setup.xml
index 01082aafc76..22e67a83dc0 100644
--- a/reference/fileinfo/setup.xml
+++ b/reference/fileinfo/setup.xml
@@ -26,7 +26,7 @@
  <section xml:id="fileinfo.resources">
   &reftitle.resources;
   <para>
-   There is one resource used in Fileinfo extension: a magic database
+   Prior to PHP 8.1.0, there was one resource used in the Fileinfo extension: a \
magic database  descriptor returned by <function>finfo_open</function>.
   </para>
  </section>

-- 
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic