diff --git a/reference/fileinfo/configure.xml b/reference/fileinfo/configure.xml new file mode 100644 index 0000000000..ecd3049b00 --- /dev/null +++ b/reference/fileinfo/configure.xml @@ -0,0 +1,34 @@ + + +
+ &reftitle.install; + + A short installation note: just type + +$ pear install fileinfo + + in your console. + +
+ + + diff --git a/reference/fileinfo/constants.xml b/reference/fileinfo/constants.xml new file mode 100644 index 0000000000..edc7a92439 --- /dev/null +++ b/reference/fileinfo/constants.xml @@ -0,0 +1,119 @@ + + + +
+ &reftitle.constants; + &extension.constants; + + + + FILEINFO_NONE + (integer) + + + + No special handling. + + + + + + FILEINFO_SYMLINK + (integer) + + + + Follow symlinks. + + + + + + FILEINFO_MIME + (integer) + + + + Return a mime string, instead of a textual description. + + + + + + FILEINFO_COMPRESS + (integer) + + + + Decompress compressed files. + + + + + + FILEINFO_DEVICES + (integer) + + + + Look at the contents of blocks or character special devices. + + + + + + FILEINFO_CONTINUE + (integer) + + + + Return all matches, not just the first. + + + + + + FILEINFO_PRESERVE_ATIME + (integer) + + + + If possible preserve the original access time. + + + + + + FILEINFO_RAW + (integer) + + + + Don't translate unprintable characters to a \ooo octal + representation. + + + + +
+ + diff --git a/reference/fileinfo/functions/finfo-buffer.xml b/reference/fileinfo/functions/finfo-buffer.xml new file mode 100644 index 0000000000..775053e52b --- /dev/null +++ b/reference/fileinfo/functions/finfo-buffer.xml @@ -0,0 +1,124 @@ + + + + + + finfo_buffer + Return infromation about a string buffer + + + &reftitle.description; + + stringfinfo_buffer + resourcefinfo + stringstring + intoptions + + + finfo + + stringbuffer + stringstring + intoptions + + + + + This function is used to get information about binary data in a string. + + + + + &reftitle.parameters; + + + + finfo + + + Fileinfo resource returned by finfo_open. + + + + + string + + + Content of a file to be checked. + + + + + options + + + One or disjunction of more Fileinfo + constants. + + + + + + + + &reftitle.returnvalues; + + Returns a textual description of the string + argument, or &false; if an error occurred. + + + + + &reftitle.examples; + + + A <function>finfo_buffer</function> example + +buffer($_POST["script"]) . "\n"; +?> +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + + finfo_file + + + + + + + diff --git a/reference/fileinfo/functions/finfo-close.xml b/reference/fileinfo/functions/finfo-close.xml new file mode 100644 index 0000000000..9e335076c3 --- /dev/null +++ b/reference/fileinfo/functions/finfo-close.xml @@ -0,0 +1,64 @@ + + + + + + finfo_close + Close fileinfo resource + + + &reftitle.description; + + boolfinfo_close + resourcefinfo + + + + This function closes the resource opened by finfo_open. + + + + + &reftitle.parameters; + + + + finfo + + + Fileinfo resource returned by finfo_open. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + diff --git a/reference/fileinfo/functions/finfo-file.xml b/reference/fileinfo/functions/finfo-file.xml new file mode 100644 index 0000000000..3d0cea4457 --- /dev/null +++ b/reference/fileinfo/functions/finfo-file.xml @@ -0,0 +1,140 @@ + + + + + + finfo_file + Return information about a file + + + &reftitle.description; + + stringfinfo_file + resourcefinfo + stringfile_name + intoptions + resourcecontext + + + finfo + + stringfile + stringfile_name + intoptions + resourcecontext + + + + + This function is used to get information about a file. + + + + + &reftitle.parameters; + + + + finfo + + + Fileinfo resource returned by finfo_open. + + + + + file_name + + + Name of a file to be checked. + + + + + options + + + One or disjunction of more Fileinfo + constants. + + + + + context + + + For a description of contexts, refer to . + + + + + + + + &reftitle.returnvalues; + + Returns a textual description of the contents of the + filename argument, or &false; if an error occurred. + + + + + &reftitle.examples; + + + A <function>finfo_file</function> example + + +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + + finfo_buffer + + + + + + + diff --git a/reference/fileinfo/functions/finfo-open.xml b/reference/fileinfo/functions/finfo-open.xml new file mode 100644 index 0000000000..50c8d25a22 --- /dev/null +++ b/reference/fileinfo/functions/finfo-open.xml @@ -0,0 +1,96 @@ + + + + + + finfo_open + Create a new fileinfo resource + + + &reftitle.description; + + resourcefinfo_open + intoptions + stringarg + + + finfo + + __construct + intoptions + stringmagic_file + + + + + This function opens a magic database and returns its resource. + + + + + &reftitle.parameters; + + + + options + + + One or disjunction of more Fileinfo + constants. + + + + + magic_file + + + Name of a magic database file, usually something like + /path/to/magic.mime. If not specified, + MAGIC environment variable is used. If this variable + is not set neither, /usr/share/misc/magic is used. + .mime and/or .mgc is added if + appropriate. + + + + + + + + &reftitle.returnvalues; + + Returns a magic database resource on success or &false; on failure. + + + + + &reftitle.seealso; + + + finfo_close + + + + + + + diff --git a/reference/fileinfo/functions/finfo-set-flags.xml b/reference/fileinfo/functions/finfo-set-flags.xml new file mode 100644 index 0000000000..a4945cd5ce --- /dev/null +++ b/reference/fileinfo/functions/finfo-set-flags.xml @@ -0,0 +1,82 @@ + + + + + + finfo_set_flags + Set libmagic configuration options + + + &reftitle.description; + + boolfinfo_set_flags + resourcefinfo + intoptions + + + finfo + + boolset_flags + intoptions + + + + + This function sets various Fileinfo options. Options can be set also + directly in finfo_open or other Fileinfo functions. + + + + + &reftitle.parameters; + + + + finfo + + + Fileinfo resource returned by finfo_open. + + + + + options + + + One or disjunction of more Fileinfo + constants. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + diff --git a/reference/fileinfo/reference.xml b/reference/fileinfo/reference.xml new file mode 100644 index 0000000000..3ee819b7bb --- /dev/null +++ b/reference/fileinfo/reference.xml @@ -0,0 +1,69 @@ + + + + + + + Fileinfo Functions + Fileinfo + + +
+ &reftitle.intro; + + The functions in this module try to guess the content type + and encoding of a file by looking for certain + magic byte sequences at specific + positions within the file. While this is not a bullet proof + approach the heuristics used do a very good job. + +
+ +
+ &reftitle.required; + + magic_open library is needed to build this extension. + +
+ + + &reference.fileinfo.configure; + +
+ &reftitle.runtime; + &no.config; +
+ +
+ &reftitle.resources; + + There is one resource used in Fileinfo extension: a magic database + descriptor returned by finfo_open. + +
+ + &reference.fileinfo.constants; +
+ &reference.fileinfo.functions; +
+ +