Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

hw_gettext(3) [php man page]

HW_GETTEXT(3)								 1							     HW_GETTEXT(3)

hw_GetText - Retrieve text document

SYNOPSIS
int hw_gettext (int $connection, int $objectID, [mixed $rootID/prefix]) DESCRIPTION
Returns the document with object ID $objectID. If the document has anchors which can be inserted, they will be inserted already. This function will only work for pure text documents. It will not open a special data connection and therefore blocks the control connec- tion during the transfer. PARAMETERS
o $connection - The connection identifier. o $objectID - The object identifier. o $rootID/prefix - The optional parameter $rootID/prefix can be a string or an integer. If it is an integer it determines how links are inserted into the document. The default is 0 and will result in links that are constructed from the name of the link's destination object. This is useful for web applications. If a link points to an object with name 'internet_movie' the HTML link will be <A href="/internet_movie">. The actual location of the source and destination object in the document hierarchy is disregarded. You will have to set up your web browser, to rewrite that URL to for example '/my_script.php/internet_movie'. 'my_script.php' will have to evaluate $PATH_INFO and retrieve the document. All links will have the prefix '/my_script.php/'. If you do not want this you can set the optional parameter $rootID/prefix to any prefix which is used instead. Is this case it has to be a string. If $rootID/prefix is an integer and unequal to 0 the link is constructed from all the names starting at the object with the id $rootID/prefix separated by a slash relative to the current object. If for example the above document 'internet_movie' is located at 'a-b-c-internet_movie' with '-' being the separator between hierarchy levels on the Hyperwave server and the source document is located at 'a-b-d-source' the resulting HTML link would be: <A HREF="../c/internet_movie">. This is useful if you want to download the whole server content onto disk and map the document hierarchy onto the file system. RETURN VALUES
Returns the text document. SEE ALSO
hw_pipedocument(3), hw_free_document(3), hw_document_bodytag(3), hw_document_size(3), hw_output_document(3). PHP Documentation Group HW_GETTEXT(3)

Check Out this Related Man Page

XDIFF_FILE_PATCH(3)							 1						       XDIFF_FILE_PATCH(3)

xdiff_file_patch - Patch a file with an unified diff

SYNOPSIS
mixed xdiff_file_patch (string $file, string $patch, string $dest, [int $flags = DIFF_PATCH_NORMAL]) DESCRIPTION
Patches a $file with a $patch and stores the result in a file. $patch has to be an unified diff created by xdiff_file_diff(3)/xdiff_string_diff(3) function. An optional $flags parameter specifies mode of operation. PARAMETERS
o $file - The original file. o $patch - The unified patch file. It has to be created using xdiff_string_diff(3), xdiff_file_diff(3) functions or compatible tools. o $dest - Path of the resulting file. o $flags - Can be either XDIFF_PATCH_NORMAL (default mode, normal patch) or XDIFF_PATCH_REVERSE (reversed patch). Starting from version 1.5.0, you can also use binary OR to enable XDIFF_PATCH_IGNORESPACE flag. RETURN VALUES
Returns FALSE if an internal error happened, string with rejected chunks if patch couldn't be applied or TRUE if patch has been success- fully applied. EXAMPLES
Example #1 xdiff_file_patch(3) example The following code applies unified diff to a file. <?php $old_version = 'my_script-1.0.php'; $patch = 'my_script.patch'; $errors = xdiff_file_patch($old_version, $patch, 'my_script-1.1.php'); if (is_string($errors)) { echo "Rejects: "; echo $errors; } ?> Example #2 Patch reversing example The following code reverses a patch. <?php $new_version = 'my_script-1.1.php'; $patch = 'my_script.patch'; $errors = xdiff_file_patch($new_version, $patch, 'my_script-1.0.php', XDIFF_PATCH_REVERSE); if (is_string($errors)) { echo "Rejects: "; echo $errors; } ?> SEE ALSO
xdiff_file_diff(3). PHP Documentation Group XDIFF_FILE_PATCH(3)
Man Page