aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2015-03-24 10:05:41 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2015-03-24 10:16:54 +0100
commit5740c9ac5215ccecada6e5ec9ca91d453c422e78 (patch)
tree2978e7d3dda315210c5786aea69967d9aed75ed4
parent01e36d8e1bf6b93c92f1067652ae0d69daf9c30b (diff)
downloadStream-5740c9ac5215ccecada6e5ec9ca91d453c422e78.zip
Stream-5740c9ac5215ccecada6e5ec9ca91d453c422e78.tar.gz
Stream-5740c9ac5215ccecada6e5ec9ca91d453c422e78.tar.bz2
Add `stream_metadata` in the stream wrapper.
This method allows to change stream options. It is called to set metadata on the stream, when one of the following functions is called one a stream URL: `touch`, `chmod`, `chown` or `chgrp`. It has been introduced in PHJP5.4, so we can bring it into the existing interfaces now.
-rw-r--r--Wrapper/IWrapper/Stream.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/Wrapper/IWrapper/Stream.php b/Wrapper/IWrapper/Stream.php
index 215abdf..e270dc3 100644
--- a/Wrapper/IWrapper/Stream.php
+++ b/Wrapper/IWrapper/Stream.php
@@ -110,6 +110,26 @@ interface Stream {
public function stream_lock ( $operation );
/**
+ * Change stream options.
+ * This method is called to set metadata on the stream. It is called when
+ * one of the following functions is called one a stream URL: touch, chmod,
+ * chown or chgrp.
+ *
+ * @access public
+ * @param string $path The file path or URL to set metadata.
+ * @param int $option One of the following:
+ * * STREAM_META_TOUCH,
+ * * STREAM_META_OWNER_NAME,
+ * * STREAM_META_OWNER,
+ * * STREAM_META_GROUP_NAME,
+ * * STREAM_META_GROUP,
+ * * STREAM_META_ACCESS.
+ * @param mixed $value An array or a scalar depending of the option.
+ * @return bool
+ */
+ public function stream_metadata ( $path, $option, $value );
+
+ /**
* Open file or URL.
* This method is called immediately after the wrapper is initialized (f.e.
* by fopen() and file_get_contents()).