From 65d4ed89fbe6a7f3fd0d9d4c4ce3a53cfcf2a61c Mon Sep 17 00:00:00 2001 From: Mehdi Achour Date: Sun, 22 Mar 2009 20:18:33 +0000 Subject: [PATCH] Switch to new documentation style git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@277593 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../stream/functions/stream-filter-append.xml | 135 ++- .../functions/stream-filter-prepend.xml | 132 ++- .../functions/stream-filter-register.xml | 302 ++++--- .../stream/functions/stream-filter-remove.xml | 77 +- .../stream/functions/stream-get-contents.xml | 38 +- .../stream/functions/stream-get-filters.xml | 40 +- .../stream/functions/stream-get-line.xml | 82 +- .../stream/functions/stream-get-meta-data.xml | 137 ++- .../functions/stream-get-transports.xml | 35 +- .../stream/functions/stream-get-wrappers.xml | 28 +- reference/stream/functions/stream-select.xml | 219 +++-- .../stream/functions/stream-set-blocking.xml | 104 ++- .../stream/functions/stream-set-timeout.xml | 103 ++- .../functions/stream-set-write-buffer.xml | 80 +- .../functions/stream-socket-recvfrom.xml | 137 ++- .../stream/functions/stream-socket-sendto.xml | 120 ++- .../stream/functions/stream-socket-server.xml | 156 +++- .../functions/stream-wrapper-register.xml | 850 +++++++++--------- .../tidy/functions/tidy-clean-repair.xml | 45 +- .../tidy/functions/tidy-config-count.xml | 38 +- reference/tidy/functions/tidy-construct.xml | 84 +- reference/tidy/functions/tidy-diagnose.xml | 48 +- reference/tidy/functions/tidy-error-count.xml | 48 +- reference/tidy/functions/tidy-get-body.xml | 58 +- reference/tidy/functions/tidy-get-config.xml | 53 +- .../tidy/functions/tidy-get-error-buffer.xml | 47 +- reference/tidy/functions/tidy-get-head.xml | 52 +- .../tidy/functions/tidy-get-html-ver.xml | 34 +- reference/tidy/functions/tidy-get-html.xml | 51 +- reference/tidy/functions/tidy-get-root.xml | 36 +- reference/tidy/functions/tidy-get-status.xml | 38 +- reference/tidy/functions/tidy-getopt.xml | 51 +- reference/tidy/functions/tidy-is-xhtml.xml | 30 +- reference/tidy/functions/tidy-is-xml.xml | 30 +- reference/tidy/functions/tidy-parse-file.xml | 84 +- .../tidy/functions/tidy-parse-string.xml | 84 +- reference/tidy/functions/tidy-repair-file.xml | 91 +- .../tidy/functions/tidy-repair-string.xml | 80 +- reference/tidy/functions/tidy-setopt.xml | 67 +- .../tidy/functions/tidyNode-hasChildren.xml | 21 +- .../tidy/functions/tidyNode-hasSiblings.xml | 21 +- reference/tidy/functions/tidyNode-isAsp.xml | 20 +- .../tidy/functions/tidyNode-isComment.xml | 21 +- reference/tidy/functions/tidyNode-isHtml.xml | 21 +- reference/tidy/functions/tidyNode-isJste.xml | 21 +- reference/tidy/functions/tidyNode-isPhp.xml | 21 +- reference/tidy/functions/tidyNode-isText.xml | 21 +- 47 files changed, 2890 insertions(+), 1201 deletions(-) diff --git a/reference/stream/functions/stream-filter-append.xml b/reference/stream/functions/stream-filter-append.xml index e0117809dd..a695221e31 100644 --- a/reference/stream/functions/stream-filter-append.xml +++ b/reference/stream/functions/stream-filter-append.xml @@ -1,12 +1,12 @@ - + stream_filter_append Attach a filter to a stream - - Description + + &reftitle.description; resourcestream_filter_append resourcestream @@ -16,33 +16,99 @@ Adds filtername to the list of filters - attached to stream. This filter will be - added with the specified params - to the end of the list and - will therefore be called last during stream operations. To - add a filter to the beginning of the list, use - stream_filter_prepend. + attached to stream. + + + + &reftitle.parameters; - By default, stream_filter_append will - attach the filter to the read filter chain - if the file was opened for reading (i.e. File Mode: - r, and/or +). The filter - will also be attached to the write filter chain - if the file was opened for writing (i.e. File Mode: - w, a, and/or +). - STREAM_FILTER_READ, - STREAM_FILTER_WRITE, and/or - STREAM_FILTER_ALL can also be passed to the - read_write parameter to override this behavior. + + + stream + + + The target stream. + + + + + filtername + + + The filter name. + + + + + read_write + + + By default, stream_filter_append will + attach the filter to the read filter chain + if the file was opened for reading (i.e. File Mode: + r, and/or +). The filter + will also be attached to the write filter chain + if the file was opened for writing (i.e. File Mode: + w, a, and/or +). + STREAM_FILTER_READ, + STREAM_FILTER_WRITE, and/or + STREAM_FILTER_ALL can also be passed to the + read_write parameter to override this behavior. + + + + + params + + + This filter will be added with the specified + params to the end of + the list and will therefore be called last during stream operations. + To add a filter to the beginning of the list, use + stream_filter_prepend. + + + + + + + + &reftitle.returnvalues; - As of PHP 5.1.0, this function returns a resource which - can be used to refer to this filter instance during a call - to stream_filter_remove. - Prior to PHP 5.1.0, this function returns &true; on success - or &false; on failure. + Returns a resource which can be used to refer to this filter + instance during a call to stream_filter_remove. + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 5.1.0 + + Prior to PHP 5.1.0, this function returns &true; on success + or &false; on failure. + + + + + + + + + + &reftitle.examples; Controlling where filters are applied @@ -84,6 +150,10 @@ Guvf vf n grfg + + + + &reftitle.notes; When using custom (user) filters @@ -108,12 +178,15 @@ Guvf vf n grfg STREAM_FILTER_WRITE to get both filter resources. - - See also - stream_filter_register, - stream_filter_prepend, and - stream_get_filters. - + + + + &reftitle.seealso; + + stream_filter_register + stream_filter_prepend + stream_get_filters + diff --git a/reference/stream/functions/stream-filter-prepend.xml b/reference/stream/functions/stream-filter-prepend.xml index e60c1b00f6..fc28f37ebd 100644 --- a/reference/stream/functions/stream-filter-prepend.xml +++ b/reference/stream/functions/stream-filter-prepend.xml @@ -1,12 +1,12 @@ - + stream_filter_prepend Attach a filter to a stream - - Description + + &reftitle.description; resourcestream_filter_prepend resourcestream @@ -16,35 +16,100 @@ Adds filtername to the list of filters - attached to stream. This filter will be - added with the specified params - to the beginning of the list and - will therefore be called first during stream operations. To - add a filter to the end of the list, use - stream_filter_append. + attached to stream. + + + + &reftitle.parameters; - By default, stream_filter_prepend will - attach the filter to the read filter chain - if the file was opened for reading (i.e. File Mode: - r, and/or +). The filter - will also be attached to the write filter chain - if the file was opened for writing (i.e. File Mode: - w, a, and/or +). - STREAM_FILTER_READ, - STREAM_FILTER_WRITE, and/or - STREAM_FILTER_ALL can also be passed to the - read_write parameter to override this behavior. - See stream_filter_append for an example of - using this parameter. + + + stream + + + The target stream. + + + + + filtername + + + The filter name. + + + + + read_write + + + By default, stream_filter_prepend will + attach the filter to the read filter chain + if the file was opened for reading (i.e. File Mode: + r, and/or +). The filter + will also be attached to the write filter chain + if the file was opened for writing (i.e. File Mode: + w, a, and/or +). + STREAM_FILTER_READ, + STREAM_FILTER_WRITE, and/or + STREAM_FILTER_ALL can also be passed to the + read_write parameter to override this behavior. + See stream_filter_append for an example of + using this parameter. + + + + + params + + + This filter will be added with the specified params + to the beginning of the list and will therefore be + called first during stream operations. To add a filter to the end of the + list, use stream_filter_append. + + + + + + + + &reftitle.returnvalues; - As of PHP 5.1.0, this function returns a resource which - can be used to refer to this filter instance during a call - to stream_filter_remove. - Prior to PHP 5.1.0, this function returns &true; on success - or &false; on failure. + Returns a resource which can be used to refer to this filter + instance during a call to stream_filter_remove. + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 5.1.0 + + Prior to PHP 5.1.0, this function returns &true; on success + or &false; on failure. + + + + + + + + + + &reftitle.notes; When using custom (user) filters @@ -71,11 +136,14 @@ STREAM_FILTER_WRITE to get both filter resources. - - See also - stream_filter_register, and - stream_filter_append. - + + + + &reftitle.seealso; + + stream_filter_register + stream_filter_append + diff --git a/reference/stream/functions/stream-filter-register.xml b/reference/stream/functions/stream-filter-register.xml index b7cf74140e..78cff8e321 100644 --- a/reference/stream/functions/stream-filter-register.xml +++ b/reference/stream/functions/stream-filter-register.xml @@ -1,12 +1,12 @@ - + stream_filter_register - Register a stream filter implemented as a PHP class derived from php_user_filter + Register a user defined stream filter - - Description + + &reftitle.description; boolstream_filter_register stringfiltername @@ -18,139 +18,171 @@ filesystem functions (such as fopen, fread etc.). + + + + &reftitle.parameters; - To implement a filter, you need to define a class as an extension of - php_user_filter with a number of member functions - as defined below. When performing read/write operations on the stream - to which your filter is attached, PHP will pass the data through your - filter (and any other filters attached to that stream) so that the - data may be modified as desired. You must implement the methods - exactly as described below - doing otherwise will lead to undefined - behaviour. + + + filtername + + + The filter name to be registered. + + + + + classname + + + To implement a filter, you need to define a class as an extension of + php_user_filter with a number of member functions + as defined below. When performing read/write operations on the stream + to which your filter is attached, PHP will pass the data through your + filter (and any other filters attached to that stream) so that the + data may be modified as desired. You must implement the methods + exactly as described below - doing otherwise will lead to undefined + behaviour. + + + intfilter + resourcein + resourceout + intconsumed + boolclosing + + + This method is called whenever data is read from or written to + the attached stream (such as with fread or fwrite). + in is a resource pointing to a bucket brigade + which contains one or more bucket objects containing data to be filtered. + out is a resource pointing to a second bucket brigade + into which your modified buckets should be placed. + consumed, which must always + be declared by reference, should be incremented by the length of the data + which your filter reads in and alters. In most cases this means you will + increment consumed by $bucket->datalen for each $bucket. + If the stream is in the process of closing (and therefore this is the last pass + through the filterchain), the closing parameter will be + set to &true; The filter method must return one of + three values upon completion. + + + + + Return Value + Meaning + + + + + PSFS_PASS_ON + + Filter processed successfully with data available in the + out bucket brigade. + + + + PSFS_FEED_ME + + Filter processed successfully, however no data was available to + return. More data is required from the stream or prior filter. + + + + PSFS_ERR_FATAL (default) + + The filter experienced an unrecoverable error and cannot continue. + + + + + + + + boolonCreate + + + + This method is called during instantiation of the filter class + object. If your filter allocates or initializes any other resources + (such as a buffer), this is the place to do it. Your implementation of + this method should return &false; on failure, or &true; on success. + + + When your filter is first instantiated, and + yourfilter->onCreate() is called, a number of properties + will be available as shown in the table below. + + + + + + + Property + Contents + + + + + FilterClass->filtername + + A string containing the name the filter was instantiated with. + Filters may be registered under multiple names or under wildcards. + Use this property to determine which name was used. + + + + FilterClass->params + + The contents of the params parameter passed + to stream_filter_append + or stream_filter_prepend. + + + + + + + + voidonClose + + + + This method is called upon filter shutdown (typically, this is also + during stream shutdown), and is executed after + the flush method is called. If any resources + were allocated or initialzed during onCreate + this would be the time to destroy or dispose of them. + + + + + + + + + &reftitle.returnvalues; + + &return.success; stream_filter_register will return &false; if the filtername is already defined. + - - intfilter - resourcein - resourceout - intconsumed - boolclosing - + + &reftitle.examples; - This method is called whenever data is read from or written to - the attached stream (such as with fread or fwrite). - in is a resource pointing to a bucket brigade - which contains one or more bucket objects containing data to be filtered. - out is a resource pointing to a second bucket brigade - into which your modified buckets should be placed. - consumed, which must always - be declared by reference, should be incremented by the length of the data - which your filter reads in and alters. In most cases this means you will - increment consumed by $bucket->datalen for each $bucket. - If the stream is in the process of closing (and therefore this is the last pass - through the filterchain), the closing parameter will be - set to &true; The filter method must return one of - three values upon completion. - - - - - - Return Value - Meaning - - - - - PSFS_PASS_ON - - Filter processed successfully with data available in the - out bucket brigade. - - - - PSFS_FEED_ME - - Filter processed successfully, however no data was available to - return. More data is required from the stream or prior filter. - - - - PSFS_ERR_FATAL (default) - - The filter experienced an unrecoverable error and cannot continue. - - - - - - - - - boolonCreate - - - - This method is called during instantiation of the filter class - object. If your filter allocates or initializes any other resources - (such as a buffer), this is the place to do it. Your implementation of - this method should return &false; on failure, or &true; on success. - - - When your filter is first instantiated, and - yourfilter->onCreate() is called, a number of properties - will be available as shown in the table below. - - - - - - - Property - Contents - - - - - FilterClass->filtername - A string containing the name the filter was instantiated with. - Filters may be registered under multiple names or under wildcards. - Use this property to determine which name was used. - - - FilterClass->params - The contents of the params parameter passed - to stream_filter_append - or stream_filter_prepend. - - - - - - - - voidonClose - - - - This method is called upon filter shutdown (typically, this is also - during stream shutdown), and is executed after - the flush method is called. If any resources - were allocated or initialzed during onCreate - this would be the time to destroy or dispose of them. - - - - The example below implements a filter named strtoupper - on the foo-bar.txt stream which will capitalize - all letter characters written to/read from that stream. - Filter for capitalizing characters on foo-bar.txt stream + + The example below implements a filter named strtoupper + on the foo-bar.txt stream which will capitalize + all letter characters written to/read from that stream. + + - - See also - stream_wrapper_register, - stream_filter_prepend, and - stream_filter_append. - + + &reftitle.seealso; + + + stream_wrapper_register + stream_filter_append + stream_filter_prepend + + diff --git a/reference/stream/functions/stream-filter-remove.xml b/reference/stream/functions/stream-filter-remove.xml index 4392262c39..8dc7c64605 100644 --- a/reference/stream/functions/stream-filter-remove.xml +++ b/reference/stream/functions/stream-filter-remove.xml @@ -1,23 +1,50 @@ - + stream_filter_remove Remove a filter from a stream - - Description + + &reftitle.description; boolstream_filter_remove resourcestream_filter - - Removes a stream filter previously added to a stream - with stream_filter_prepend or - stream_filter_append. Any data - remaining in the filter's internal buffer will be flushed - through to the next filter before removing it. - + + Removes a stream filter previously added to a stream with + stream_filter_prepend or + stream_filter_append. Any data remaining in the + filter's internal buffer will be flushed through to the next filter before + removing it. + + + + + &reftitle.parameters; + + + + stream_filter + + + The stream filter to be removed. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; Dynamicly refiltering a stream @@ -36,23 +63,29 @@ rewind($fp); fpassthru($fp); fclose($fp); -/* Expected Output - --------------- - -Guvf vf a test - - */ ?> ]]> + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + stream_filter_register + stream_filter_append + stream_filter_prepend + - - See also - stream_filter_register, - stream_filter_append, and - stream_filter_prepend. - diff --git a/reference/stream/functions/stream-get-contents.xml b/reference/stream/functions/stream-get-contents.xml index 67d7516af4..db6fe4e77f 100644 --- a/reference/stream/functions/stream-get-contents.xml +++ b/reference/stream/functions/stream-get-contents.xml @@ -1,12 +1,12 @@ - + stream_get_contents Reads remainder of a stream into a string - - Description + + &reftitle.description; stringstream_get_contents resourcehandle @@ -47,7 +47,7 @@ offset (integer) - Seek to the specified offset before reading. Added in PHP 5.1.0. + Seek to the specified offset before reading. @@ -62,6 +62,30 @@ + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 5.1.0 + + The offset was added. + + + + + + + + &reftitle.examples; @@ -93,6 +117,11 @@ if ($stream = fopen('http://www.example.net', 'r')) { + + &reftitle.notes; + ¬e.bin-safe; + + &reftitle.seealso; @@ -102,7 +131,6 @@ if ($stream = fopen('http://www.example.net', 'r')) { fpassthru - ¬e.bin-safe; diff --git a/reference/stream/functions/stream-get-filters.xml b/reference/stream/functions/stream-get-filters.xml index 1c53ee5c74..8d485da151 100644 --- a/reference/stream/functions/stream-get-filters.xml +++ b/reference/stream/functions/stream-get-filters.xml @@ -1,20 +1,31 @@ - + stream_get_filters Retrieve list of registered filters - - Description + + &reftitle.description; arraystream_get_filters - Returns an indexed array containing the name of all stream filters - available on the running system. + Retrieve the list of registered filters on the running system. + + + + &reftitle.returnvalues; + + Returns an indexed array containing the name of all stream filters + available. + + + + + &reftitle.examples; Using <function>stream_get_filters</function> @@ -26,10 +37,7 @@ print_r($streamlist); ?> ]]> - - Output will be similar to the following. - Note: there may be more or fewer filters in your version of PHP. - + &example.outputs.similar; - - See also - stream_filter_register, and - stream_get_wrappers. - + + + &reftitle.seealso; + + stream_filter_register + stream_get_wrappers + + + + stream_get_line Gets line from stream resource up to a given delimiter - - Description + + &reftitle.description; stringstream_get_line resourcehandle intlength stringending + + Gets a line from the given handle. + + + Reading ends when length bytes have been read, when + the string specified by ending is found (which is + not included in the return value), or on EOF + (whichever comes first). + + + This function is nearly identical to fgets except in + that it allows end of line delimiters other than the standard \n, \r, and + \r\n, and does not return the delimiter itself. + + + + + &reftitle.parameters; + + + + handle + + + A valid file handle. + + + + + length + + + The number of bytes to read from the handle. + + + + + ending + + + An optional string delimiter. + + + + + + + + + &reftitle.returnvalues; Returns a string of up to length bytes read from the file - pointed to by handle. Reading ends when - length bytes have been read, when the string specified by - ending is found (which is not included - in the return value), or on EOF (whichever comes first). + pointed to by handle. If an error occurs, returns &false;. - - This function is nearly identical to fgets - except in that it allows end of line delimiters other than the - standard \n, \r, and \r\n, and does not - return the delimiter itself. - - - See also fread, - fgets, and - fgetc. - + + + &reftitle.seealso; + + fread + fgets + fgetc + + + + stream_get_meta_data Retrieves header/meta data from streams/file pointers - - Description + + &reftitle.description; arraystream_get_meta_data resourcestream - + Returns information about an existing stream. - The stream can be any stream created by fopen, - fsockopen and pfsockopen. + + + + + &reftitle.parameters; + + + + stream + + + The stream can be any stream created by fopen, + fsockopen and pfsockopen. + + + + + + + + + &reftitle.returnvalues; + The result array contains the following items: - + - timed_out (bool) - &true; if the stream + timed_out (bool) - &true; if the stream timed out while waiting for data on the last call to fread or fgets. - blocked (bool) - &true; if the stream is + blocked (bool) - &true; if the stream is in blocking IO mode. See stream_set_blocking. - eof (bool) - &true; if the stream has reached + eof (bool) - &true; if the stream has reached end-of-file. Note that for socket streams this member can be &true; - even when unread_bytes is non-zero. To + even when unread_bytes is non-zero. To determine if there is more data to be read, use feof instead of reading this item. - unread_bytes (int) - the number of bytes + unread_bytes (int) - the number of bytes currently contained in the PHP's own internal buffer. @@ -51,81 +72,107 @@ - - - The following items were added in PHP 4.3.0: - - - stream_type (string) - a label describing + stream_type (string) - a label describing the underlying implementation of the stream. - wrapper_type (string) - a label describing + wrapper_type (string) - a label describing the protocol wrapper implementation layered over the stream. See for more information about wrappers. - wrapper_data (mixed) - wrapper specific + wrapper_data (mixed) - wrapper specific data attached to this stream. See for more information about wrappers and their wrapper data. - filters (array) - and array containing + filters (array) - and array containing the names of any filters that have been stacked onto this stream. Documentation on filters can be found in the Filters appendix. - - - - This function was introduced in PHP 4.3.0, but prior to this version, - socket_get_status could be used to retrieve - the first four items, for socket based streams only. - - - In PHP 4.3.0 and later, - socket_get_status is an alias for this function. - - - - This function does NOT work on sockets created by the Socket extension. - - - - The following items were added in PHP 5.0.0: - - - mode (string) - the type of access required for + mode (string) - the type of access required for this stream (see Table 1 of the fopen() reference) - seekable (bool) - whether the current stream can + seekable (bool) - whether the current stream can be seeked. - uri (string) - the URI/filename associated with this + uri (string) - the URI/filename associated with this stream. + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 5.0.0 + + The following entries were added in the returned array: + mode, seekable, + and uri. + + + + 4.3.0 + + The following entries were added in the returned array: + stream_type, wrapper_type, + wrapper_data, and filters. + + + + 4.3.0 + + socket_get_status is an alias for this function. + Prior to PHP 4.3.0, it was used to retrieve the first four items, for + socket based streams only. + + + + + + + + + + &reftitle.notes; + + This function does NOT work on sockets created by the Socket extension. + + + + + stream_get_transports Retrieve list of registered socket transports - - Description + + &reftitle.description; arraystream_get_transports @@ -15,6 +15,17 @@ Returns an indexed array containing the name of all socket transports available on the running system. + + + + &reftitle.returnvalues; + + Returns an indexed array of socket transports names. + + + + + &reftitle.examples; Using <function>stream_get_transports</function> @@ -26,10 +37,7 @@ print_r($xportlist); ?> ]]> - - Output will be similar to the following. - Note: there may be more or fewer transports in your version of PHP. - + &example.outputs.similar; - - See also - stream_get_filters, and - stream_get_wrappers. - + + + + &reftitle.seealso; + + stream_get_filters + stream_get_wrappers + diff --git a/reference/stream/functions/stream-get-wrappers.xml b/reference/stream/functions/stream-get-wrappers.xml index 85b9f94795..3d3fd96204 100644 --- a/reference/stream/functions/stream-get-wrappers.xml +++ b/reference/stream/functions/stream-get-wrappers.xml @@ -1,20 +1,31 @@ - + stream_get_wrappers Retrieve list of registered streams - - Description + + &reftitle.description; arraystream_get_wrappers + + Retrieve list of registered streams available on the running system. + + + + + &reftitle.returnvalues; Returns an indexed array containing the name of all stream wrappers available on the running system. + + + + &reftitle.examples; <function>stream_get_wrappers</function> example @@ -58,10 +69,13 @@ if (in_array('compress.bzip2', stream_get_wrappers())) { - - See also - stream_wrapper_register. - + + + + &reftitle.seealso; + + stream_wrapper_register + diff --git a/reference/stream/functions/stream-select.xml b/reference/stream/functions/stream-select.xml index 9954b2cf36..5ff442755a 100644 --- a/reference/stream/functions/stream-select.xml +++ b/reference/stream/functions/stream-select.xml @@ -1,13 +1,13 @@ - + stream_select Runs the equivalent of the select() system call on the given arrays of streams with a timeout specified by tv_sec and tv_usec - - Description + + &reftitle.description; intstream_select arrayread @@ -16,89 +16,138 @@ inttv_sec inttv_usec0 - + The stream_select function accepts arrays of streams and waits for them to change status. Its operation is equivalent to that of the socket_select function except in that it acts on streams. - - - The streams listed in the read array will be watched to - see if characters become available for reading (more precisely, to see if - a read will not block - in particular, a stream resource is also ready on - end-of-file, in which case an fread will return - a zero length string). - - - The streams listed in the write array will be - watched to see if a write will not block. - - - The streams listed in the except array will be - watched for high priority exceptional ("out-of-band") data arriving. - - - - When stream_select returns, the arrays - read, write and - except are modified to indicate which stream - resource(s) actually changed status. - - - - The tv_sec and tv_usec - together form the timeout parameter, - tv_sec specifies the number of seconds while - tv_usec the number of microseconds. - The timeout is an upper bound on the amount of time - that stream_select will wait before it returns. - If tv_sec and tv_usec are - both set to 0, stream_select will - not wait for data - instead it will return immediately, indicating the - current status of the streams. - If tv_sec is &null; stream_select - can block indefinitely, returning only when an event on one of the - watched streams occurs (or if a signal interrupts the system call). - - + + + + + &reftitle.parameters; + + + + read + + + The streams listed in the read array will be watched to + see if characters become available for reading (more precisely, to see if + a read will not block - in particular, a stream resource is also ready on + end-of-file, in which case an fread will return + a zero length string). + + + + + write + + + The streams listed in the write array will be + watched to see if a write will not block. + + + + + except + + + The streams listed in the except array will be + watched for high priority exceptional ("out-of-band") data arriving. + + + + When stream_select returns, the arrays + read, write and + except are modified to indicate which stream + resource(s) actually changed status. + + + + You do not need to pass every array to + stream_select. You can leave it out and use an + empty array or &null; instead. Also do not forget that those arrays are + passed by reference and will be modified after + stream_select returns. + + + + + tv_sec + + + The tv_sec and tv_usec + together form the timeout parameter, + tv_sec specifies the number of seconds while + tv_usec the number of microseconds. + The timeout is an upper bound on the amount of time + that stream_select will wait before it returns. + If tv_sec and tv_usec are + both set to 0, stream_select will + not wait for data - instead it will return immediately, indicating the + current status of the streams. + + + If tv_sec is &null; stream_select + can block indefinitely, returning only when an event on one of the + watched streams occurs (or if a signal interrupts the system call). + + + + Using a timeout value of 0 allows you to + instantaneously poll the status of the streams, however, it is NOT a + good idea to use a 0 timeout value in a loop as it + will cause your script to consume too much CPU time. + + + It is much better to specify a timeout value of a few seconds, although + if you need to be checking and running other code concurrently, using a + timeout value of at least 200000 microseconds will + help reduce the CPU usage of your script. + + + Remember that the timeout value is the maximum time that will elapse; + stream_select will return as soon as the + requested streams are ready for use. + + + + + + tv_usec + + + See tv_sec description. + + + + + + + + + &reftitle.returnvalues; + On success stream_select returns the number of stream resources contained in the modified arrays, which may be zero if the timeout expires before anything interesting happens. On error &false; is returned and a warning raised (this can happen if the system call is interrupted by an incoming signal). - + + - - - Using a timeout value of 0 allows you to - instantaneously poll the status of the streams, however, it is NOT a - good idea to use a 0 timeout value in a loop as it - will cause your script to consume too much CPU time. - - - It is much better to specify a timeout value of a few seconds, although - if you need to be checking and running other code concurrently, using a - timeout value of at least 200000 microseconds will - help reduce the CPU usage of your script. - - - Remember that the timeout value is the - maximum time that will elapse; stream_select will - return as soon as the requested streams are ready for use. - - - - You do not need to pass every array to - stream_select. You can leave it out and use an - empty array or &null; instead. Also do not forget that those arrays are - passed by reference and will be modified after - stream_select returns. - + + &reftitle.examples; - This example checks to see if data has arrived for reading on either - $stream1 or $stream2. - Since the timeout value is 0 it will return - immediately: - + + <function>stream_select</function> Example + + This example checks to see if data has arrived for reading on either + $stream1 or $stream2. + Since the timeout value is 0 it will return + immediately: + + ]]> - + + + + + + &reftitle.notes; Due to a limitation in the current Zend Engine it is not possible to pass a @@ -168,10 +222,13 @@ if (false === stream_select($r, $w, $e, 0)) { and return &false; under Windows. - - See also - stream_set_blocking. - + + + + &reftitle.seealso; + + stream_set_blocking + diff --git a/reference/stream/functions/stream-set-blocking.xml b/reference/stream/functions/stream-set-blocking.xml index 63e3397aa8..93edb6514f 100644 --- a/reference/stream/functions/stream-set-blocking.xml +++ b/reference/stream/functions/stream-set-blocking.xml @@ -1,47 +1,105 @@ - + stream_set_blocking Set blocking/non-blocking mode on a stream - - Description + + &reftitle.description; boolstream_set_blocking resourcestream intmode - If mode is 0, the given stream - will be switched to non-blocking mode, and if 1, it - will be switched to blocking mode. This affects calls like - fgets and fread - that read from the stream. In non-blocking mode an - fgets call will always return right away - while in blocking mode it will wait for data to become available - on the stream. + Sets blocking or non-blocking mode on a stream. + + This function works for any stream that supports non-blocking mode + (currently, regular files and socket streams). + + + + + &reftitle.parameters; + + + + stream + + + The stream. + + + + + mode + + + If mode is 0, the given stream + will be switched to non-blocking mode, and if 1, it + will be switched to blocking mode. This affects calls like + fgets and fread + that read from the stream. In non-blocking mode an + fgets call will always return right away + while in blocking mode it will wait for data to become available + on the stream. + + + + + + + + + &reftitle.returnvalues; &return.success; + + + + &reftitle.changelog; - This function was previously called as - set_socket_blocking and later - socket_set_blocking but this usage is deprecated. + + + + + &Version; + &Description; + + + + + 4.3.0 + + Prior to PHP 4.3.0, this function only worked on socket based streams. + + + + + + + + + &reftitle.notes; - - Prior to PHP 4.3, this function only worked on socket based streams. - Since PHP 4.3, this function works for any stream that supports - non-blocking mode (currently, regular files and socket streams). - + + This function was previously called as + set_socket_blocking and later + socket_set_blocking but this usage is deprecated. + - - See also - stream_select. - + + + + &reftitle.seealso; + + stream_select + diff --git a/reference/stream/functions/stream-set-timeout.xml b/reference/stream/functions/stream-set-timeout.xml index 6eb421fe75..9261169c44 100644 --- a/reference/stream/functions/stream-set-timeout.xml +++ b/reference/stream/functions/stream-set-timeout.xml @@ -1,13 +1,13 @@ - + stream_set_timeout Set timeout period on a stream - - Description + + &reftitle.description; boolstream_set_timeout resourcestream @@ -17,13 +17,83 @@ Sets the timeout value on stream, expressed in the sum of seconds and - microseconds. &return.success; + microseconds. When the stream times out, the 'timed_out' key of the array returned by stream_get_meta_data is set to &true;, although no error/warning is generated. + + + + &reftitle.parameters; + + + + stream + + + The target stream. + + + + + seconds + + + The seconds part of the timeout to be set. + + + + + microseconds + + + The microseconds part of the timeout to be set. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 4.3.0 + + As of PHP 4.3, this function can (potentially) work on any kind of + stream. In PHP 4.3, socket based streams are still the only kind + supported in the PHP core, although streams from other extensions + may support this function. + + + + + + + + + + &reftitle.examples; <function>stream_set_timeout</function> example @@ -54,14 +124,10 @@ if (!$fp) { - - - As of PHP 4.3, this function can (potentially) work on any kind of - stream. In PHP 4.3, socket based streams are still the only kind - supported in the PHP core, although streams from other extensions - may support this function. - - + + + + &reftitle.notes; This function doesn't work with advanced operations like @@ -74,11 +140,14 @@ if (!$fp) { set_socket_timeout and later socket_set_timeout but this usage is deprecated. - - See also - fsockopen and - fopen. - + + + + &reftitle.seealso; + + fsockopen + fopen + diff --git a/reference/stream/functions/stream-set-write-buffer.xml b/reference/stream/functions/stream-set-write-buffer.xml index 80228e0402..106df3cf9b 100644 --- a/reference/stream/functions/stream-set-write-buffer.xml +++ b/reference/stream/functions/stream-set-write-buffer.xml @@ -1,40 +1,73 @@ - + stream_set_write_buffer Sets file buffering on the given stream - - Description + + &reftitle.description; intstream_set_write_buffer resourcestream intbuffer + + Sets the buffering for write operations on the given stream + to buffer bytes. + Output using fwrite is normally buffered at 8K. This means that if there are two processes wanting to write to the same output stream (a file), each is paused after 8K of data to allow the other to write. - stream_set_write_buffer - sets the buffering for write operations on the given filepointer - stream to buffer bytes. - If buffer is 0 then write operations are - unbuffered. This ensures that all writes with - fwrite are completed before other processes - are allowed to write to that output stream. - - - The function returns 0 on success, or EOF if the request cannot - be honored. + + + + &reftitle.parameters; + + + + stream + + + The file pointer. + + + + + buffer + + + The number of bytes to buffer. If buffer + is 0 then write operations are unbuffered. This ensures that all writes + with fwrite are completed before other processes are + allowed to write to that output stream. + + + + + + + + + &reftitle.returnvalues; + + Returns 0 on success, or EOF if the request cannot be honored. + + + + + &reftitle.examples; - The following example demonstrates how to use - stream_set_write_buffer to create an unbuffered stream. <function>stream_set_write_buffer</function> example + + The following example demonstrates how to use + stream_set_write_buffer to create an unbuffered stream. + - - - See also - fopen and - fwrite. - + + + &reftitle.seealso; + + fopen + fwrite + + + + stream_socket_recvfrom Receives data from a socket, connected or not - - Description + + &reftitle.description; stringstream_socket_recvfrom resourcesocket @@ -17,38 +17,86 @@ stream_socket_recvfrom accepts data from a remote socket up to length bytes. - If address is provided it will be populated with - the address of the remote socket. + + + + &reftitle.parameters; - The value of flags can be any combination - of the following: - - Possible values for <parameter>flags</parameter> - - - - STREAM_OOB - - Process OOB (out-of-band) data. - - - - STREAM_PEEK - - Retrieve data from the socket, but do not consume the buffer. - Subsequent calls to fread or - stream_socket_recvfrom will see - the same data. - - - - -
+ + + socket + + + The remote socket. + + + + + length + + + The number of bytes to receive from the socket. + + + + + flags + + + The value of flags can be any combination + of the following: + + Possible values for <parameter>flags</parameter> + + + + STREAM_OOB + + Process OOB (out-of-band) data. + + + + STREAM_PEEK + + Retrieve data from the socket, but do not consume the buffer. + Subsequent calls to fread or + stream_socket_recvfrom will see + the same data. + + + + +
+
+
+
+ + address + + + If address is provided it will be populated with + the address of the remote socket. + + + +
- - <function>stream_socket_recvfrom</function> example - +
+ + + &reftitle.returnvalues; + + Returns the read data, as a string + + + + + &reftitle.examples; + + + <function>stream_socket_recvfrom</function> example + ]]> - - + + + + + + + &reftitle.notes; If a message received is longer than the length @@ -88,13 +141,17 @@ fclose($server); data directly from the socket and bypass the stream buffer. - - See also - stream_socket_sendto, - stream_socket_client, and - stream_socket_server. - + + + &reftitle.seealso; + + stream_socket_sendto + stream_socket_client + stream_socket_server + + +
+ stream_socket_sendto Sends a message to a socket, whether it is connected or not - - Description + + &reftitle.description; intstream_socket_sendto resourcesocket @@ -15,32 +15,82 @@ stringaddress - The function stream_socket_sendto sends - the data specified by data through the - socket specified by socket. The address - specified when the socket stream was created will be used unless - an alternate address is specified in address. + Sends the specified data through the + socket. + + + + &reftitle.parameters; - The value of flags can be any combination - of the following: - - possible values for <parameter>flags</parameter> - - - - STREAM_OOB - - Process OOB (out-of-band) data. - - - - -
+ + + socket + + + The socket to send data to. + + + + + data + + + The data to be sent. + + + + + flags + + + The value of flags can be any combination + of the following: + + possible values for <parameter>flags</parameter> + + + + STREAM_OOB + + Process OOB (out-of-band) data. + + + + +
+
+
+
+ + address + + + The address specified when the socket stream was created will be used + unless an alternate address is specified in address. + + + If specified, it must be in dotted quad (or [ipv6]) format. + + + +
- - <function>stream_socket_sendto</function> Example - +
+ + + &reftitle.returnvalues; + + Returns a result code, as an integer. + + + + + &reftitle.examples; + + + <function>stream_socket_sendto</function> Example + ]]> - - - - See also - stream_socket_recvfrom, - stream_socket_client, and - stream_socket_server. + + + + + &reftitle.seealso; + + stream_socket_recvfrom + stream_socket_client + stream_socket_server + +
+ stream_socket_server Create an Internet or Unix domain server socket - - Description + + &reftitle.description; resourcestream_socket_server stringlocal_socket @@ -17,50 +17,102 @@ Creates a stream or datagram socket on the specified - local_socket. The type of socket created - is determined by the transport specified using standard URL formatting: - transport://target. For Internet Domain sockets - (AF_INET) such as TCP and UDP, the target portion - of the remote_socket parameter should consist of - a hostname or IP address followed by a colon and a port number. For Unix - domain sockets, the target portion should point - to the socket file on the filesystem. - - flags is a bitmask field which may be set to any - combination of socket creation flags. The default value of flags is - STREAM_SERVER_BIND | STREAM_SERVER_LISTEN. + local_socket. - - - For UDP sockets, you must use STREAM_SERVER_BIND as - the flags parameter. - - This function only creates a socket, to begin accepting connections use stream_socket_accept. + + + + &reftitle.parameters; - If the call fails, it will return &false; and if the optional - errno and errstr - arguments are present they will be set to indicate the actual - system level error that occurred in the system-level - socket(), bind(), and - listen() calls. If the value returned in - errno is 0 and the - function returned &false;, it is an indication that the error - occurred before the bind() call. This is - most likely due to a problem initializing the socket. Note that - the errno and - errstr arguments will always be passed by - reference. + + + local_socket + + + The type of socket created is determined by the transport specified + using standard URL formatting: transport://target. + + + For Internet Domain sockets (AF_INET) such as TCP and UDP, the + target portion of the + remote_socket parameter should consist of a + hostname or IP address followed by a colon and a port number. For + Unix domain sockets, the target portion should + point to the socket file on the filesystem. + + + Depending on the environment, Unix domain sockets may not be available. + A list of available transports can be retrieved using + stream_get_transports. See + for a list of bulitin transports. + + + + + errno + + + If the optional errno and errstr + arguments are present they will be set to indicate the actual system + level error that occurred in the system-level socket(), + bind(), and listen() calls. If + the value returned in errno is + 0 and the function returned &false;, it is an + indication that the error occurred before the bind() + call. This is most likely due to a problem initializing the socket. + Note that the errno and + errstr arguments will always be passed by reference. + + + + + errstr + + + See errno description. + + + + + flags + + + A bitmask field which may be set to any combination of socket creation + flags. The default value of flags is STREAM_SERVER_BIND + | STREAM_SERVER_LISTEN. + + + + For UDP sockets, you must use STREAM_SERVER_BIND as + the flags parameter. + + + + + + context + + + + + + + + + + &reftitle.returnvalues; - Depending on the environment, Unix domain sockets may not be available. - A list of available transports can be retrieved using - stream_get_transports. See - for a list of bulitin transports. + Returns the created stream, or &false; on error. + + + + &reftitle.examples; Using TCP server sockets @@ -113,16 +165,26 @@ do { + + + + &reftitle.notes; &ipv6.brackets; - - See also stream_socket_client, - stream_set_blocking, - stream_set_timeout, - fgets, - fgetss, fwrite, - fclose, feof, and - the Curl extension. - + + + + &reftitle.seealso; + + stream_socket_client + stream_set_blocking + stream_set_timeout + fgets + fgetss + fwrite + fclose + feof + Curl extension + diff --git a/reference/stream/functions/stream-wrapper-register.xml b/reference/stream/functions/stream-wrapper-register.xml index 2d2c9d8f0d..6fd2d392f1 100644 --- a/reference/stream/functions/stream-wrapper-register.xml +++ b/reference/stream/functions/stream-wrapper-register.xml @@ -1,459 +1,483 @@ - + stream_wrapper_register Register a URL wrapper implemented as a PHP class - - Description + + &reftitle.description; boolstream_wrapper_register stringprotocol stringclassname - stream_wrapper_register allows you to implement - your own protocol handlers and streams for use with all the other - filesystem functions (such as fopen, + Allows you to implement your own protocol handlers and streams for use + with all the other filesystem functions (such as fopen, fread etc.). + + + + &reftitle.parameters; - To implement a wrapper, you need to define a class with a number of - member functions, as defined below. When someone fopens your stream, - PHP will create an instance of classname and - then call methods on that instance. You must implement the methods - exactly as described below - doing otherwise will lead to undefined - behaviour. + + + protocol + + + The wrapper name to be registered. + + + + + classname + + + To implement a wrapper, you need to define a class with a number of + member functions, as defined below. When someone fopens your stream, + PHP will create an instance of classname and + then call methods on that instance. You must implement the methods + exactly as described below - doing otherwise will lead to undefined + behaviour. + + + The instance of classname will be populated + with a context property referencing a + Context Resource which may be accessed with + stream_context_get_options. + If no context was passed to the stream creation function, + context will be set to &null;. + + + boolstream_open + stringpath + stringmode + intoptions + stringopened_path + + + This method is called immediately after your stream object is + created. path specifies the URL that was + passed to fopen and that this object is + expected to retrieve. You can use parse_url + to break it apart. + + + mode is the mode used to open the file, + as detailed for fopen. You are responsible + for checking that mode is valid for the + path requested. + + + options holds additional flags set + by the streams API. It can hold one or more of the following + values OR'd together. + + + + + Flag + Description + + + + + STREAM_USE_PATH + If path is relative, search + for the resource using the include_path. + + + + STREAM_REPORT_ERRORS + If this flag is set, you are responsible for raising + errors using trigger_error during + opening of the stream. If this flag is not set, you + should not raise any errors. + + + + + + + + If the path is opened successfully, + and STREAM_USE_PATH is set in options, + you should set opened_path to the full + path of the file/resource that was actually opened. + + + If the requested resource was opened successfully, you should + return &true;, otherwise you should return &false; + + + + voidstream_close + + + + This method is called when the stream is closed, using + fclose. You must release any resources + that were locked or allocated by the stream. + + + + stringstream_read + intcount + + + This method is called in response to fread + and fgets calls on the stream. You + must return up-to count bytes of data + from the current read/write position as a string. + If there are less than count + bytes available, return as many as are available. If no + more data is available, return either &false; or an + empty string. + You must also update the read/write position of the stream + by the number of bytes that were successfully read. + + + + intstream_write + stringdata + + + This method is called in response to fwrite + calls on the stream. You should store data + into the underlying storage used by your stream. If there is not + enough room, try to store as many bytes as possible. + You should return the number of bytes that were successfully + stored in the stream, or 0 if none could be stored. + You must also update the read/write position of the stream + by the number of bytes that were successfully written. + + + + boolstream_eof + + + + This method is called in response to feof + calls on the stream. You should return &true; if the read/write + position is at the end of the stream and if no more data is available + to be read, or &false; otherwise. + + + + intstream_tell + + + + This method is called in response to ftell + calls on the stream. You should return the current read/write + position of the stream. + + + + boolstream_seek + intoffset + intwhence + + + This method is called in response to fseek + calls on the stream. You should update the read/write position + of the stream according to offset and + whence. See fseek + for more information about these parameters. + Return &true; if the position was updated, &false; otherwise. + + + + boolstream_flush + + + + This method is called in response to fflush + calls on the stream. If you have cached data in your stream + but not yet stored it into the underlying storage, you should + do so now. + Return &true; if the cached data was successfully stored (or + if there was no data to store), or &false; if the data could + not be stored. + + + + arraystream_stat + + + + This method is called in response to fstat + calls on the stream and should return an array containing the same + values as appropriate for the stream. + + + + resourcestream_cast + intcast_as + + + This method is called in response to stream_select + calls on the stream and should return the underlying stream resource used + by the wrapper, or &false;. The + cast_as parameter can be + STREAM_CAST_FOR_SELECT when + stream_select is calling + stream_cast or + STREAM_CAST_AS_STREAM when + stream_cast is called for other uses. + + + + boolstream_set_option + intoption + intarg1 + intarg2 + + + This method is called to set options on the stream. Possible values + for option are: + + STREAM_OPTION_BLOCKING: The method is called + in response to stream_set_blocking. + arg1 is the requested blocking mode. + STREAM_OPTION_READ_TIMEOUT: The method is + called in response to stream_set_timeout. + arg1 is the timeout in seconds, and + arg2 is the timeout in microseconds. + STREAM_OPTION_WRITE_BUFFER: The method is + called in response to stream_set_write_buffer. + arg1 is the buffer mode + (STREAM_BUFFER_NONE or + STREAM_BUFFER_FULL) and arg2 + is the requested buffer size. + + + + stream_set_option should return &false; on failure or + if the option is not implemented, &true; otherwise. + + + boolunlink + stringpath + + + This method is called in response to unlink + calls on URL paths associated with the wrapper and should attempt + to delete the item specified by path. + It should return &true; on success or &false; on failure. + In order for the appropriate error message to be returned, + do not define this method if your wrapper does not support unlinking. + + + boolrename + stringpath_from + stringpath_to + + + This method is called in response to rename + calls on URL paths associated with the wrapper and should attempt + to rename the item specified by path_from + to the specification given by path_to. + It should return &true; on success or &false; on failure. + In order for the appropriate error message to be returned, + do not define this method if your wrapper does not support renaming. + + + + boolmkdir + stringpath + intmode + intoptions + + + This method is called in response to mkdir + calls on URL paths associated with the wrapper and should attempt + to create the directory specified by path. + It should return &true; on success or &false; on failure. + In order for the appropriate error message to be returned, + do not define this method if your wrapper does not support + creating directories. Posible values for options + include STREAM_REPORT_ERRORS and + STREAM_MKDIR_RECURSIVE. + + + + boolrmdir + stringpath + intoptions + + + This method is called in response to rmdir + calls on URL paths associated with the wrapper and should attempt + to remove the directory specified by path. + It should return &true; on success or &false; on failure. + In order for the appropriate error message to be returned, + do not define this method if your wrapper does not support + removing directories. Possible values for options + include STREAM_REPORT_ERRORS. + + + + booldir_opendir + stringpath + intoptions + + + This method is called immediately when your stream object is created for + examining directory contents with opendir. + path specifies the URL that was + passed to opendir and that this object is + expected to explore. You can use parse_url + to break it apart. + + + + arrayurl_stat + stringpath + intflags + + + This method is called in response to stat + calls on the URL paths associated with the wrapper and should + return as many elements in common with the system function as + possible. Unknown or unavailable values should be set to a + rational value (usually 0). + + + flags holds additional flags set + by the streams API. It can hold one or more of the following + values OR'd together. + + + + + Flag + Description + + + + + STREAM_URL_STAT_LINK + + For resources with the ability to link to other resource + (such as an HTTP Location: forward, or a filesystem + symlink). This flag specified that only information + about the link itself should be returned, not the + resource pointed to by the link. This flag is set in + response to calls to lstat, + is_link, or filetype. + + + + STREAM_URL_STAT_QUIET + If this flag is set, your wrapper should not raise any + errors. If this flag is not set, you are responsible for + reporting errors using the trigger_error + function during stating of the path. + + + + + + + + + stringdir_readdir + + + + This method is called in response to readdir + and should return a string representing the next filename in the + location opened by dir_opendir. + + + + booldir_rewinddir + + + + This method is called in response to rewinddir + and should reset the output generated by dir_readdir. + i.e.: The next call to dir_readdir should return + the first entry in the location returned by dir_opendir. + + + + booldir_closedir + + + + This method is called in response to closedir. + You should release any resources which were locked or allocated during + the opening and use of the directory stream. + + + + + + + + + &reftitle.returnvalues; + + &return.success; - - - As of PHP 5.0.0 the instance of - classname will be populated with a - context property referencing a - Context Resource which may be accessed - with stream_context_get_options. - If no context was passed to the stream creation function, - context will be set to &null;. - - stream_wrapper_register will return &false; if the protocol already has a handler. + - - boolstream_open - stringpath - stringmode - intoptions - stringopened_path - + + &reftitle.changelog; - This method is called immediately after your stream object is - created. path specifies the URL that was - passed to fopen and that this object is - expected to retrieve. You can use parse_url - to break it apart. - - - mode is the mode used to open the file, - as detailed for fopen. You are responsible - for checking that mode is valid for the - path requested. - - - options holds additional flags set - by the streams API. It can hold one or more of the following - values OR'd together. - Flag - Description + &Version; + &Description; - STREAM_USE_PATH - If path is relative, search - for the resource using the include_path. - - - - STREAM_REPORT_ERRORS - If this flag is set, you are responsible for raising - errors using trigger_error during - opening of the stream. If this flag is not set, you - should not raise any errors. - - - - - - - - If the path is opened successfully, - and STREAM_USE_PATH is set in options, - you should set opened_path to the full - path of the file/resource that was actually opened. - - - If the requested resource was opened successfully, you should - return &true;, otherwise you should return &false; - - - - voidstream_close - - - - This method is called when the stream is closed, using - fclose. You must release any resources - that were locked or allocated by the stream. - - - - stringstream_read - intcount - - - This method is called in response to fread - and fgets calls on the stream. You - must return up-to count bytes of data - from the current read/write position as a string. - If there are less than count - bytes available, return as many as are available. If no - more data is available, return either &false; or an - empty string. - You must also update the read/write position of the stream - by the number of bytes that were successfully read. - - - - intstream_write - stringdata - - - This method is called in response to fwrite - calls on the stream. You should store data - into the underlying storage used by your stream. If there is not - enough room, try to store as many bytes as possible. - You should return the number of bytes that were successfully - stored in the stream, or 0 if none could be stored. - You must also update the read/write position of the stream - by the number of bytes that were successfully written. - - - - boolstream_eof - - - - This method is called in response to feof - calls on the stream. You should return &true; if the read/write - position is at the end of the stream and if no more data is available - to be read, or &false; otherwise. - - - - intstream_tell - - - - This method is called in response to ftell - calls on the stream. You should return the current read/write - position of the stream. - - - - boolstream_seek - intoffset - intwhence - - - This method is called in response to fseek - calls on the stream. You should update the read/write position - of the stream according to offset and - whence. See fseek - for more information about these parameters. - Return &true; if the position was updated, &false; otherwise. - - - - boolstream_flush - - - - This method is called in response to fflush - calls on the stream. If you have cached data in your stream - but not yet stored it into the underlying storage, you should - do so now. - Return &true; if the cached data was successfully stored (or - if there was no data to store), or &false; if the data could - not be stored. - - - - arraystream_stat - - - - This method is called in response to fstat - calls on the stream and should return an array containing the same - values as appropriate for the stream. - - - - resourcestream_cast - intcast_as - - - This method is called in response to stream_select - calls on the stream and should return the underlying stream resource used - by the wrapper, or &false;. The - cast_as parameter can be - STREAM_CAST_FOR_SELECT when - stream_select is calling - stream_cast or - STREAM_CAST_AS_STREAM when - stream_cast is called for other uses. - - - - Userspace wrapper stream_cast method is not supported prior to - PHP 5.3.0. - - - - - boolstream_set_option - intoption - intarg1 - intarg2 - - - This method is called to set options on the stream. Possible values - for option are: - - STREAM_OPTION_BLOCKING: The method is called - in response to stream_set_blocking. - arg1 is the requested blocking mode. - STREAM_OPTION_READ_TIMEOUT: The method is - called in response to stream_set_timeout. - arg1 is the timeout in seconds, and - arg2 is the timeout in microseconds. - STREAM_OPTION_WRITE_BUFFER: The method is - called in response to stream_set_write_buffer. - arg1 is the buffer mode - (STREAM_BUFFER_NONE or - STREAM_BUFFER_FULL) and arg2 - is the requested buffer size. - - - - stream_set_option should return &false; on failure or - if the option is not implemented, &true; otherwise. - - - - Userspace wrapper stream_set_option method is not supported prior to - PHP 5.3.0. - - - - - boolunlink - stringpath - - - This method is called in response to unlink - calls on URL paths associated with the wrapper and should attempt - to delete the item specified by path. - It should return &true; on success or &false; on failure. - In order for the appropriate error message to be returned, - do not define this method if your wrapper does not support unlinking. - - - - Userspace wrapper unlink method is not supported prior to - PHP 5.0.0. - - - - - boolrename - stringpath_from - stringpath_to - - - This method is called in response to rename - calls on URL paths associated with the wrapper and should attempt - to rename the item specified by path_from - to the specification given by path_to. - It should return &true; on success or &false; on failure. - In order for the appropriate error message to be returned, - do not define this method if your wrapper does not support renaming. - - - - Userspace wrapper rename method is not supported prior to - PHP 5.0.0. - - - - - boolmkdir - stringpath - intmode - intoptions - - - This method is called in response to mkdir - calls on URL paths associated with the wrapper and should attempt - to create the directory specified by path. - It should return &true; on success or &false; on failure. - In order for the appropriate error message to be returned, - do not define this method if your wrapper does not support - creating directories. Posible values for options - include STREAM_REPORT_ERRORS and - STREAM_MKDIR_RECURSIVE. - - - - Userspace wrapper mkdir method is not supported prior to - PHP 5.0.0. - - - - - boolrmdir - stringpath - intoptions - - - This method is called in response to rmdir - calls on URL paths associated with the wrapper and should attempt - to remove the directory specified by path. - It should return &true; on success or &false; on failure. - In order for the appropriate error message to be returned, - do not define this method if your wrapper does not support - removing directories. Possible values for options - include STREAM_REPORT_ERRORS. - - - - Userspace wrapper rmdir method is not supported prior to - PHP 5.0.0. - - - - - booldir_opendir - stringpath - intoptions - - - This method is called immediately when your stream object is created for - examining directory contents with opendir. - path specifies the URL that was - passed to opendir and that this object is - expected to explore. You can use parse_url - to break it apart. - - - - arrayurl_stat - stringpath - intflags - - - This method is called in response to stat - calls on the URL paths associated with the wrapper and should - return as many elements in common with the system function as - possible. Unknown or unavailable values should be set to a - rational value (usually 0). - - - flags holds additional flags set - by the streams API. It can hold one or more of the following - values OR'd together. - - - - - Flag - Description - - - - - STREAM_URL_STAT_LINK + 5.3.0 - For resources with the ability to link to other resource - (such as an HTTP Location: forward, or a filesystem - symlink). This flag specified that only information - about the link itself should be returned, not the - resource pointed to by the link. This flag is set in - response to calls to lstat, - is_link, or filetype. + Added the following userspace wrappers: stream_set_option, stream_cast. - STREAM_URL_STAT_QUIET - If this flag is set, your wrapper should not raise any - errors. If this flag is not set, you are responsible for - reporting errors using the trigger_error - function during stating of the path. + 5.0.0 + + Added the following userspace wrappers: rmdir, mkdir, rename, unlink. + + + + 5.0.0 + + Added the context property. + - - stringdir_readdir - - + + &reftitle.examples; - This method is called in response to readdir - and should return a string representing the next filename in the - location opened by dir_opendir. - - - - booldir_rewinddir - - - - This method is called in response to rewinddir - and should reset the output generated by dir_readdir. - i.e.: The next call to dir_readdir should return - the first entry in the location returned by dir_opendir. - - - - booldir_closedir - - - - This method is called in response to closedir. - You should release any resources which were locked or allocated during - the opening and use of the directory stream. - - - - - The example below implements a var:// protocol handler that - allows read/write access to a named global variable using - standard filesystem stream functions such as fread. - The var:// protocol implemented below, given the URL - "var://foo" will read/write data to/from $GLOBALS["foo"]. - A Stream for reading/writing global variables + + The example below implements a var:// protocol handler that allows + read/write access to a named global variable using standard filesystem + stream functions such as fread. The var:// protocol + implemented below, given the URL "var://foo" will read/write data + to/from $GLOBALS["foo"]. + - + &reftitle.changelog; diff --git a/reference/tidy/functions/tidy-clean-repair.xml b/reference/tidy/functions/tidy-clean-repair.xml index 77ac25b347..35d4f3396d 100644 --- a/reference/tidy/functions/tidy-clean-repair.xml +++ b/reference/tidy/functions/tidy-clean-repair.xml @@ -1,12 +1,12 @@ - + tidy_clean_repair Execute configured cleanup and repair operations on parsed markup - - Description + + &reftitle.description; Procedural style: booltidy_clean_repair @@ -21,6 +21,33 @@ This function cleans and repairs the given tidy object. + + + + &reftitle.parameters; + + + + object + + + The tidy object. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; <function>tidy_clean_repair</function> example @@ -52,10 +79,14 @@ echo $tidy; - - See also tidy_repair_file and - tidy_repair_string. - + + + + &reftitle.seealso; + + tidy_repair_file + tidy_repair_string + diff --git a/reference/tidy/functions/tidy-config-count.xml b/reference/tidy/functions/tidy-config-count.xml index 9d8644cd8c..044fcf7356 100644 --- a/reference/tidy/functions/tidy-config-count.xml +++ b/reference/tidy/functions/tidy-config-count.xml @@ -1,21 +1,47 @@ - + tidy_config_count Returns the Number of Tidy configuration errors encountered for specified document - - Description + + &reftitle.description; inttidy_config_count tidyobject - tidy_config_count returns the number of errors - encountered in the configuration of the specified tidy - object. + Returns the number of errors encountered in the configuration of the + specified tidy object. + + + + &reftitle.parameters; + + + + object + + + The tidy object. + + + + + + + + + &reftitle.returnvalues; + + Returns the number of errors. + + + + + &reftitle.examples; <function>tidy_config_count</function> example diff --git a/reference/tidy/functions/tidy-construct.xml b/reference/tidy/functions/tidy-construct.xml index 01e33139aa..95f5e11b90 100755 --- a/reference/tidy/functions/tidy-construct.xml +++ b/reference/tidy/functions/tidy-construct.xml @@ -1,12 +1,12 @@ - + tidy::__construct Constructs a new tidy object - - Description + + &reftitle.description; tidytidy::__construct stringfilename @@ -17,12 +17,69 @@ tidy::__construct constructs a new tidy object. + + + + &reftitle.parameters; - If the filename parameter is given, this function - will also read that file and initialize the object with the file, - acting like tidy_parse_file. + + + filename + + + If the filename parameter is given, this function + will also read that file and initialize the object with the file, + acting like tidy_parse_file. + + + + + config + + + The config config can be passed either as an + array or as a string. If a string is passed, it is interpreted as the + name of the configuration file, otherwise, it is interpreted as the + options themselves. + + + Check http://tidy.sourceforge.net/docs/quickref.html for an + explanation about each option. + + + + + encoding + + + The encoding parameter sets the encoding for + input/output documents. The possible values for encoding are: ascii, + latin0, latin1, raw, utf8, iso2022, mac, win1252, ibm858, utf16, + utf16le, utf16be, big5 and shiftjis. + + + + + use_include_path + + + Search for the file in the include_path. + + + + - &tidy.conf-enc; + + + + &reftitle.returnvalues; + + Returns the new tidy instance. + + + + + &reftitle.examples; <function>tidy::__construct</function> example @@ -67,11 +124,16 @@ line 8 column 14 - Warning: discarding unexpected - - See also tidy_parse_file and - tidy_parse_string. - + + + &reftitle.seealso; + + tidy_parse_file + tidy_parse_string + + + + tidy_diagnose Run configured diagnostics on parsed and repaired markup - - Description + + &reftitle.description; Procedural style: booltidy_diagnose @@ -18,13 +18,36 @@ - tidy_diagnose runs diagnostic tests on the given - tidy object, adding some more information about - the document in the error buffer. + Runs diagnostic tests on the given tidy object, + adding some more information about the document in the error buffer. + + + + &reftitle.parameters; - &return.success; + + + object + + + The tidy object. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; <function>tidy_diagnose</function> example @@ -66,10 +89,15 @@ Info: Document content looks like XHTML 1.0 Strict - - See also tidy_get_error_buffer. - + + + &reftitle.seealso; + + tidy_get_error_buffer + + + + tidy_error_count Returns the Number of Tidy errors encountered for specified document - - Description + + &reftitle.description; inttidy_error_count tidyobject - tidy_error_count returns the number of Tidy errors - encountered for the specified document. + Returns the number of Tidy errors encountered for the specified document. + + + + &reftitle.parameters; + + + + object + + + The tidy object. + + + + + + + + + &reftitle.returnvalues; + + Returns the number of errors. + + + + + &reftitle.examples; <function>tidy_error_count</function> example @@ -46,10 +72,14 @@ line 1 column 1 - Warning: inserting missing 'title' element - - See also tidy_access_count and - tidy_warning_count. - + + + + &reftitle.seealso; + + tidy_access_count + tidy_warning_count + diff --git a/reference/tidy/functions/tidy-get-body.xml b/reference/tidy/functions/tidy-get-body.xml index 568d4c016b..dfbae4b208 100644 --- a/reference/tidy/functions/tidy-get-body.xml +++ b/reference/tidy/functions/tidy-get-body.xml @@ -1,12 +1,12 @@ - + tidy_get_body Returns a tidyNode Object starting from the <body> tag of the tidy parse tree - - Description + + &reftitle.description; Procedural style: tidyNodetidy_get_body @@ -21,6 +21,39 @@ This function returns a tidyNode object starting from the <body> tag of the tidy parse tree. + + + + &reftitle.parameters; + + + + object + + + The tidy object. + + + + + + + + + &reftitle.returnvalues; + + Returns the detected HTML version. + + + + This function is not yet implemented in the Tidylib itself, so it always + return 0. + + + + + + &reftitle.examples; <function>tidy_get_body</function> example @@ -54,12 +87,21 @@ echo $body->value; - ¬e.tidy.ze2; - - See also tidy_get_head and - tidy_get_html. - + + + &reftitle.notes; + ¬e.tidy.ze2; + + + + &reftitle.seealso; + + tidy_get_head + tidy_get_html + + + + tidy_get_config Get current Tidy configuration - - Description + + &reftitle.description; Procedural style: arraytidy_get_config @@ -18,14 +18,44 @@ - tidy_get_config returns an array with the - configuration options in use by the given tidy + Gets the list of the configuration options in use by the given tidy object. For an explanation about each option, visit &url.tidy.conf;. + + + + &reftitle.parameters; + + + + object + + + The tidy object. + + + + + + + + + &reftitle.returnvalues; + + Returns an array of configuration options. + + + For an explanation about each option, visit &url.tidy.conf;. + + + + + &reftitle.examples; <function>tidy_get_config</function> example @@ -135,11 +165,16 @@ Array - - See also tidy_reset_config and - tidy_save_config. - + + + &reftitle.seealso; + + tidy_reset_config + tidy_save_config + + + + tidy_get_error_buffer Return warnings and errors which occurred parsing the specified document - - Description + + &reftitle.description; Procedural style: stringtidy_get_error_buffer @@ -21,6 +21,33 @@ tidy_get_error_buffer returns warnings and errors which occurred parsing the specified document. + + + + &reftitle.parameters; + + + + object + + + The tidy object. + + + + + + + + + &reftitle.returnvalues; + + Returns the error buffer as a string. + + + + + &reftitle.examples; <function>tidy_get_error_buffer</function> example @@ -46,11 +73,15 @@ line 1 column 1 - Warning: inserting missing 'title' element - - See also tidy_access_count, - tidy_error_count and - tidy_warning_count. - + + + + &reftitle.seealso; + + tidy_access_count + tidy_error_count + tidy_warning_count + diff --git a/reference/tidy/functions/tidy-get-head.xml b/reference/tidy/functions/tidy-get-head.xml index 29e5741140..f8c57e046c 100644 --- a/reference/tidy/functions/tidy-get-head.xml +++ b/reference/tidy/functions/tidy-get-head.xml @@ -1,12 +1,12 @@ - + tidy_get_head Returns a tidyNode Object starting from the <head> tag of the tidy parse tree - - Description + + &reftitle.description; Procedural style: tidyNodetidy_get_head @@ -21,6 +21,33 @@ This function returns a tidyNode object starting from the <head> tag of the tidy parse tree. + + + + &reftitle.parameters; + + + + object + + + The tidy object. + + + + + + + + + &reftitle.returnvalues; + + Returns the tidyNode object. + + + + + &reftitle.examples; <function>tidy_get_head</function> example @@ -54,12 +81,21 @@ echo $head->value; - ¬e.tidy.ze2; - - See also tidy_get_body and - tidy_get_html. - + + + &reftitle.notes; + ¬e.tidy.ze2; + + + + &reftitle.seealso; + + tidy_get_body + tidy_get_html + + + + tidy_get_html_ver Get the Detected HTML version for the specified document - - Description + + &reftitle.description; Procedural style: inttidy_get_html_ver @@ -18,8 +18,31 @@ - tidy_get_html_ver returns the detected HTML version - for the specified tidy object. + Returns the detected HTML version for the specified tidy + object. + + + + + &reftitle.parameters; + + + + object + + + The tidy object. + + + + + + + + + &reftitle.returnvalues; + + Returns the detected HTML version. @@ -28,6 +51,7 @@ + + tidy_get_html Returns a tidyNode Object starting from the <html> tag of the tidy parse tree - - Description + + &reftitle.description; Procedural style: tidyNodetidy_get_html @@ -21,6 +21,33 @@ This function returns a tidyNode object starting from the <html> tag of the tidy parse tree. + + + + &reftitle.parameters; + + + + object + + + The tidy object. + + + + + + + + + &reftitle.returnvalues; + + Returns the tidyNode object. + + + + + &reftitle.examples; <function>tidy_get_html</function> example @@ -59,11 +86,19 @@ echo $html->value; - ¬e.tidy.ze2; - - See also tidy_get_body and - tidy_get_head. - + + + + &reftitle.notes; + ¬e.tidy.ze2; + + + + &reftitle.seealso; + + tidy_get_body + tidy_get_head + diff --git a/reference/tidy/functions/tidy-get-root.xml b/reference/tidy/functions/tidy-get-root.xml index 3146074f27..7fdf7786a6 100644 --- a/reference/tidy/functions/tidy-get-root.xml +++ b/reference/tidy/functions/tidy-get-root.xml @@ -1,12 +1,12 @@ - + tidy_get_root Returns a tidyNode object representing the root of the tidy parse tree - - Description + + &reftitle.description; Procedural style: tidyNodetidy_get_root @@ -20,6 +20,33 @@ Returns a tidyNode object representing the root of the tidy parse tree. + + + + &reftitle.parameters; + + + + object + + + The tidy object. + + + + + + + + + &reftitle.returnvalues; + + Returns the tidyNode object. + + + + + &reftitle.examples; dump nodes @@ -67,7 +94,10 @@ function dump_nodes($node, $indent) { + + + &reftitle.notes; ¬e.tidy.ze2; diff --git a/reference/tidy/functions/tidy-get-status.xml b/reference/tidy/functions/tidy-get-status.xml index a2b999ccab..5a53e6d3e8 100644 --- a/reference/tidy/functions/tidy-get-status.xml +++ b/reference/tidy/functions/tidy-get-status.xml @@ -1,12 +1,12 @@ - + tidy_get_status Get status of specified document - - Description + + &reftitle.description; Procedural style: inttidy_get_status @@ -18,10 +18,36 @@ - tidy_get_status returns the status for the specified - tidy object. It returns 0 if no error/warning - was raised, 1 for warnings or accessibility errors, or 2 for errors. + Returns the status for the specified tidy object. + + + + &reftitle.parameters; + + + + object + + + The tidy object. + + + + + + + + + &reftitle.returnvalues; + + Returns 0 if no error/warning was raised, 1 for warnings or accessibility + errors, or 2 for errors. + + + + + &reftitle.examples; <function>tidy_get_status</function> example diff --git a/reference/tidy/functions/tidy-getopt.xml b/reference/tidy/functions/tidy-getopt.xml index b14a0ba86a..171027137b 100644 --- a/reference/tidy/functions/tidy-getopt.xml +++ b/reference/tidy/functions/tidy-getopt.xml @@ -1,12 +1,12 @@ - + tidy_getopt Returns the value of the specified configuration option for the tidy document - - Description + + &reftitle.description; Procedural style: mixedtidy_getopt @@ -19,13 +19,46 @@ stringoption - tidy_getopt returns the value of the specified - option for the specified tidy - object. The return type depends on the type - of the specified option. You will find a list with - each configuration option and their types at: &url.tidy.conf;. + Returns the value of the specified option for the + specified tidy object. + + + + &reftitle.parameters; + + + + object + + + The tidy object. + + + + + option + + + You will find a list with each configuration option and their types + at: &url.tidy.conf;. + + + + + + + + + &reftitle.returnvalues; + + Returns the value of the specified option. + The return type depends on the type of the specified one. + + + + + &reftitle.examples; <function>tidy_getopt</function> example diff --git a/reference/tidy/functions/tidy-is-xhtml.xml b/reference/tidy/functions/tidy-is-xhtml.xml index 19c0cffe0d..a0818cba59 100644 --- a/reference/tidy/functions/tidy-is-xhtml.xml +++ b/reference/tidy/functions/tidy-is-xhtml.xml @@ -1,12 +1,12 @@ - + tidy_is_xhtml Indicates if the document is a XHTML document - - Description + + &reftitle.description; Procedural style: booltidy_is_xhtml @@ -17,6 +17,29 @@ booltidy->isXhtml + + Tells if the document is a XHTML document. + + + + + &reftitle.parameters; + + + + object + + + The tidy object. + + + + + + + + + &reftitle.returnvalues; This function returns &true; if the specified tidy object is a XHTML document, or &false; otherwise. @@ -28,6 +51,7 @@ + + tidy_is_xml Indicates if the document is a generic (non HTML/XHTML) XML document - - Description + + &reftitle.description; Procedural style: booltidy_is_xml @@ -17,6 +17,29 @@ booltidy->isXml + + Tells if the document is a generic (non HTML/XHTML) XML document. + + + + + &reftitle.parameters; + + + + object + + + The tidy object. + + + + + + + + + &reftitle.returnvalues; This function returns &true; if the specified tidy object is a generic XML document (non HTML/XHTML), @@ -29,6 +52,7 @@ + + tidy_parse_file Parse markup in file or URI - - Description + + &reftitle.description; Procedural style: tidytidy_parse_file @@ -26,7 +26,62 @@ This function parses the given file. - &tidy.conf-enc; + + + + &reftitle.parameters; + + + + filename + + + If the filename parameter is given, this function + will also read that file and initialize the object with the file, + acting like tidy_parse_file. + + + + + config + + + The config config can be passed either as an + array or as a string. If a string is passed, it is interpreted as the + name of the configuration file, otherwise, it is interpreted as the + options themselves. + + + Check http://tidy.sourceforge.net/docs/quickref.html for an + explanation about each option. + + + + + encoding + + + The encoding parameter sets the encoding for + input/output documents. The possible values for encoding are: ascii, + latin0, latin1, raw, utf8, iso2022, mac, win1252, ibm858, utf16, + utf16le, utf16be, big5 and shiftjis. + + + + + use_include_path + + + Search for the file in the include_path. + + + + + + + + + &reftitle.examples; <function>tidy_parse_file</function> example @@ -46,13 +101,22 @@ if(!empty($tidy->errorBuffer)) { - ¬e.tidy.2only; - - See also tidy_parse_string, - tidy_repair_file and - tidy_repair_string. - + + + &reftitle.notes; + ¬e.tidy.2only; + + + + &reftitle.seealso; + + tidy_parse_string + tidy_repair_file + tidy_repair_string + + + + tidy_parse_string Parse a document stored in a string - - Description + + &reftitle.description; Procedural style: tidytidy_parse_string @@ -22,10 +22,61 @@ stringencoding - tidy_parse_string parses a document stored in a - string. + Parses a document stored in a string. - &tidy.conf-enc; + + + + &reftitle.parameters; + + + + input + + + The data to be parsed. + + + + + config + + + The config config can be passed either as an + array or as a string. If a string is passed, it is interpreted as the + name of the configuration file, otherwise, it is interpreted as the + options themselves. + + + Check http://tidy.sourceforge.net/docs/quickref.html for an + explanation about each option. + + + + + encoding + + + The encoding parameter sets the encoding for + input/output documents. The possible values for encoding are: ascii, + latin0, latin1, raw, utf8, iso2022, mac, win1252, ibm858, utf16, + utf16le, utf16be, big5 and shiftjis. + + + + + + + + + &reftitle.returnvalues; + + Returns a new tidy instance. + + + + + &reftitle.examples; <function>tidy_parse_string</function> example @@ -80,13 +131,22 @@ echo $tidy; - ¬e.tidy.2only; - - See also tidy_parse_file, - tidy_repair_file and - tidy_repair_string. - + + + &reftitle.notes; + ¬e.tidy.2only; + + + + &reftitle.seealso; + + tidy_parse_file + tidy_repair_file + tidy_repair_string + + + + tidy_repair_file Repair a file and return it as a string - - Description + + &reftitle.description; stringtidy_repair_file stringfilename @@ -15,9 +15,69 @@ booluse_include_pathfalse - This function repairs the given file and returns it as a string. + Repairs the given file and returns it as a string. - &tidy.conf-enc; + + + + &reftitle.parameters; + + + + filename + + + The file to be repaired. + + + + + config + + + The config config can be passed either as an + array or as a string. If a string is passed, it is interpreted as the + name of the configuration file, otherwise, it is interpreted as the + options themselves. + + + Check http://tidy.sourceforge.net/docs/quickref.html for an + explanation about each option. + + + + + encoding + + + The encoding parameter sets the encoding for + input/output documents. The possible values for encoding are: ascii, + latin0, latin1, raw, utf8, iso2022, mac, win1252, ibm858, utf16, + utf16le, utf16be, big5 and shiftjis. + + + + + use_include_path + + + Search for the file in the include_path. + + + + + + + + + &reftitle.returnvalues; + + Returns the repaired contents as a string. + + + + + &reftitle.examples; <function>tidy_repair_file</function> example @@ -35,13 +95,22 @@ file_put_contents($file, $repaired); - ¬e.tidy.2only; - - See also tidy_parse_file, - tidy_parse_string and - tidy_repair_string. - + + + &reftitle.notes; + ¬e.tidy.2only; + + + + &reftitle.seealso; + + tidy_parse_file + tidy_parse_string + tidy_repair_string + + + + tidy_repair_string Repair a string using an optionally provided configuration file - - Description + + &reftitle.description; stringtidy_repair_string stringdata @@ -16,7 +16,59 @@ This function repairs the given string. - &tidy.conf-enc; + + + + &reftitle.parameters; + + + + data + + + The data to be repaired. + + + + + config + + + The config config can be passed either as an + array or as a string. If a string is passed, it is interpreted as the + name of the configuration file, otherwise, it is interpreted as the + options themselves. + + + Check http://tidy.sourceforge.net/docs/quickref.html for an + explanation about each option. + + + + + encoding + + + The encoding parameter sets the encoding for + input/output documents. The possible values for encoding are: ascii, + latin0, latin1, raw, utf8, iso2022, mac, win1252, ibm858, utf16, + utf16le, utf16be, big5 and shiftjis. + + + + + + + + + &reftitle.returnvalues; + + Returns the repaired string. + + + + + &reftitle.examples; <function>tidy_repair_string</function> example @@ -60,12 +112,20 @@ echo $tidy; - ¬e.tidy.2only; - - See also tidy_parse_file, - tidy_parse_string and - tidy_repair_file. - + + + + &reftitle.notes; + ¬e.tidy.2only; + + + + &reftitle.seealso; + + tidy_parse_file + tidy_parse_string + tidy_repair_file + diff --git a/reference/tidy/functions/tidy-setopt.xml b/reference/tidy/functions/tidy-setopt.xml index 5fce952e07..bcc331ff2f 100644 --- a/reference/tidy/functions/tidy-setopt.xml +++ b/reference/tidy/functions/tidy-setopt.xml @@ -1,12 +1,12 @@ - + tidy_setopt Updates the configuration settings for the specified tidy document - - Description + + &reftitle.description; booltidy_setopt stringoption @@ -15,9 +15,43 @@ tidy_setopt updates the specified option with a new value. - You will find a list with each configuration option at: &url.tidy.conf;. + + + + &reftitle.parameters; + + + + option + + + The tidy option name. A list of available configuration options may + be found at: &url.tidy.conf;. + + + + + value + + + The tidy option name. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; <function>tidy_setopt</function> example @@ -34,14 +68,23 @@ tidy_setopt('indent', FALSE); - - See also tidy_getopt, - tidy_get_config, - tidy_reset_config and - tidy_save_config. - - ¬e.tidy.1only; + + + &reftitle.notes; + ¬e.tidy.1only; + + + + &reftitle.seealso; + + tidy_getopt + tidy_get_config + tidy_reset_config + tidy_save_config + + + + tidyNode->hasChildren Returns true if this node has children - - Description + + &reftitle.description; booltidyNode->hasChildren + + Tells if the current node has children. + + + + + &reftitle.returnvalues; + + Returns &true; if the node has children, &false; otherwise. + + - &warn.undocumented.func; - + + &reftitle.notes; This function was named tidy_node->has_children in diff --git a/reference/tidy/functions/tidyNode-hasSiblings.xml b/reference/tidy/functions/tidyNode-hasSiblings.xml index c59d6b8847..23fd6841c7 100644 --- a/reference/tidy/functions/tidyNode-hasSiblings.xml +++ b/reference/tidy/functions/tidyNode-hasSiblings.xml @@ -1,19 +1,30 @@ - + tidyNode->hasSiblings Returns true if this node has siblings - - Description + + &reftitle.description; booltidyNode->hasSiblings + + Tells if the current node has siblings. + + + + + &reftitle.returnvalues; + + Returns &true; if the node has siblings, &false; otherwise. + + - &warn.undocumented.func; - + + &reftitle.notes; This function was named tidy_node->has_siblings in diff --git a/reference/tidy/functions/tidyNode-isAsp.xml b/reference/tidy/functions/tidyNode-isAsp.xml index c9bf354881..a8579fe1cd 100755 --- a/reference/tidy/functions/tidyNode-isAsp.xml +++ b/reference/tidy/functions/tidyNode-isAsp.xml @@ -1,20 +1,30 @@ - + tidyNode->isAsp Returns true if this node is ASP - - Description + + &reftitle.description; booltidyNode->isAsp - This functions returns &true; if the current node is ASP, or &false; - otherwise. + Tells wether the current node is ASP. + + + + &reftitle.returnvalues; + + Returns &true; if the node is ASP, &false; otherwise. + + + + + &reftitle.notes; This function was named tidy_node->is_asp in diff --git a/reference/tidy/functions/tidyNode-isComment.xml b/reference/tidy/functions/tidyNode-isComment.xml index a051d61520..83ef3c0d37 100644 --- a/reference/tidy/functions/tidyNode-isComment.xml +++ b/reference/tidy/functions/tidyNode-isComment.xml @@ -1,19 +1,30 @@ - + tidyNode->isComment Returns true if this node represents a comment - - Description + + &reftitle.description; booltidyNode->isComment + + Tells if the current node is a comment. + + + + + &reftitle.returnvalues; + + Returns &true; if the node is a comment, &false; otherwise. + + - &warn.undocumented.func; - + + &reftitle.notes; This function was named tidy_node->is_comment in diff --git a/reference/tidy/functions/tidyNode-isHtml.xml b/reference/tidy/functions/tidyNode-isHtml.xml index 2baf203b65..89028bcaf3 100644 --- a/reference/tidy/functions/tidyNode-isHtml.xml +++ b/reference/tidy/functions/tidyNode-isHtml.xml @@ -1,19 +1,30 @@ - + tidyNode->isHtml Returns true if this node is part of a HTML document - - Description + + &reftitle.description; booltidyNode->isHtml + + Tells if the current node is part of HTML document. + + + + + &reftitle.returnvalues; + + Returns &true; if the node is part of a HTML document, &false; otherwise. + + - &warn.undocumented.func; - + + &reftitle.notes; This function was named tidy_node->is_html in diff --git a/reference/tidy/functions/tidyNode-isJste.xml b/reference/tidy/functions/tidyNode-isJste.xml index 4484bd0d5d..839db4c76c 100644 --- a/reference/tidy/functions/tidyNode-isJste.xml +++ b/reference/tidy/functions/tidyNode-isJste.xml @@ -1,19 +1,30 @@ - + tidyNode->isJste Returns true if this node is JSTE - - Description + + &reftitle.description; booltidyNode->isJste + + Tells if the current node is JSTE. + + + + + &reftitle.returnvalues; + + Returns &true; if the node is JSTE, &false; otherwise. + + - &warn.undocumented.func; - + + &reftitle.notes; This function was named tidy_node->is_jste in diff --git a/reference/tidy/functions/tidyNode-isPhp.xml b/reference/tidy/functions/tidyNode-isPhp.xml index aad6890a61..02b6bd614d 100644 --- a/reference/tidy/functions/tidyNode-isPhp.xml +++ b/reference/tidy/functions/tidyNode-isPhp.xml @@ -1,19 +1,30 @@ - + tidyNode->isPhp Returns true if this node is PHP - - Description + + &reftitle.description; booltidyNode->isPhp + + Tells if the current node is PHP. + + + + + &reftitle.returnvalues; Returns &true; if the current node is PHP code, &false; otherwise. + + + + &reftitle.examples; get the PHP code from a mixed HTML/PHP document @@ -74,6 +85,10 @@ echo 'hello world!'; + + + + &reftitle.notes; This function was named tidy_node->is_php in diff --git a/reference/tidy/functions/tidyNode-isText.xml b/reference/tidy/functions/tidyNode-isText.xml index ea077437ed..d3a5583d64 100644 --- a/reference/tidy/functions/tidyNode-isText.xml +++ b/reference/tidy/functions/tidyNode-isText.xml @@ -1,19 +1,30 @@ - + tidyNode->isText Returns true if this node represents text (no markup) - - Description + + &reftitle.description; booltidyNode->isText + + Tells if the node represents a text (no markup). + + + + + &reftitle.returnvalues; + + Returns &true; if the node represent a text, &false; otherwise. + + - &warn.undocumented.func; - + + &reftitle.notes; This function was named tidy_node->is_text in