mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Make it a little bit easier to read.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@91514 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
948efe3655
commit
d5a8dc1fda
1 changed files with 26 additions and 16 deletions
|
@ -1,18 +1,23 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.18 $ -->
|
||||
<!-- $Revision: 1.19 $ -->
|
||||
<chapter id="features.remote-files">
|
||||
<title>Using remote files</title>
|
||||
|
||||
<para>
|
||||
As long as support for the "URL fopen wrapper" is enabled when
|
||||
you configure PHP (which it is unless you explicitly pass the
|
||||
<option>--disable-url-fopen-wrapper</option> flag to configure (for versions
|
||||
up to 4.0.3) or set <parameter>allow_url_fopen</parameter> to off in &php.ini;
|
||||
(for newer versions)),
|
||||
you can use HTTP and FTP URLs with most functions that take a
|
||||
filename as a parameter, including the <function>require</function>
|
||||
and <function>include</function> statements.
|
||||
As long as <parameter>allow_url_fopen</parameter> is enabled in
|
||||
php.ini, you can use HTTP and FTP URLs with most of the functions
|
||||
that take a filename as a parameter. In addition, URLs can be
|
||||
used with the <function>include</function>,
|
||||
<function>include_once</function>, <function>require</function> and
|
||||
<function>require_once</function> statements.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
In PHP 4.0.3 and older, in order to use URL wrappers, you were required
|
||||
to configure PHP using the configure option
|
||||
<option>--enable-url-fopen-wrapper</option>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
<note>
|
||||
<para>
|
||||
|
@ -55,8 +60,13 @@ fclose($file);
|
|||
</example>
|
||||
</para>
|
||||
<para>
|
||||
You can also write to files on an FTP as long you connect as a user
|
||||
with the correct access rights, and the file doesn't exist already.
|
||||
You can also write to files on an FTP server (provided that you
|
||||
have connected as a user with the correct access rights). You
|
||||
can only create new files using this method; if you try to overwrite
|
||||
a file that already exists, the <function>fopen</function> will
|
||||
fail.
|
||||
</para>
|
||||
<para>
|
||||
To connect as a user other than 'anonymous', you need to specify
|
||||
the username (and possibly password) within the URL, such as
|
||||
'ftp://user:password@ftp.example.com/path/to/file'. (You can use the
|
||||
|
@ -85,11 +95,11 @@ fclose ($file);
|
|||
<para>
|
||||
<note>
|
||||
<para>
|
||||
You might get the idea from the example above to use this
|
||||
technique to write to a remote log, but as mentioned above, you
|
||||
can only write to a new file using the URL fopen() wrappers. To
|
||||
do distributed logging like that, you should take a look at
|
||||
<function>syslog</function>.
|
||||
You might get the idea from the example above that you can use
|
||||
this technique to write to a remote log file. Unfortunately
|
||||
that would not work because the <function>fopen</function> call will
|
||||
fail if the remote file already exists. To do distributed logging
|
||||
like that, you should take a look at <function>syslog</function>.
|
||||
</para>
|
||||
</note>
|
||||
</para>
|
||||
|
|
Loading…
Reference in a new issue