From 0501bab7dc5982f94924e19192c1d523a45085aa Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 21 Feb 2014 23:51:43 -0800 Subject: doc update --- doc/html/include_2attach_8php.html | 135 +++++++++++++++++++++++++++++++++++-- 1 file changed, 129 insertions(+), 6 deletions(-) (limited to 'doc/html/include_2attach_8php.html') diff --git a/doc/html/include_2attach_8php.html b/doc/html/include_2attach_8php.html index 21215feb6..b0d008ed3 100644 --- a/doc/html/include_2attach_8php.html +++ b/doc/html/include_2attach_8php.html @@ -109,35 +109,50 @@ $(document).ready(function(){initNavTree('include_2attach_8php.html','');});
attach.php File Reference
+ +

File/attach API with the potential for revision control. +More...

+ + + + + + + + +

Functions

 z_mime_content_type ($filename)
 Guess the mimetype from file ending. More...
 
 attach_count_files ($channel_id, $observer, $hash= '', $filename= '', $filetype= '')
 Count files/attachments. More...
 
 attach_list_files ($channel_id, $observer, $hash= '', $filename= '', $filetype= '', $orderby= 'created desc', $start=0, $entries=0)
 Returns a list of files/attachments. More...
 
 attach_by_hash ($hash, $rev=0)
 Find an attachment by hash and revision. More...
 
 attach_by_hash_nodata ($hash, $rev=0)
 Find an attachment by hash and revision. More...
 
 attach_store ($channel, $observer_hash, $options= '', $arr=null)
 
 z_readdir ($channel_id, $observer_hash, $pathname, $parent_hash= '')
 
 attach_mkdir ($channel, $observer_hash, $arr=null)
 Create directory. More...
 
 attach_change_permissions ($channel_id, $resource, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $recurse=false)
 Changes permissions of a file. More...
 
 attach_delete ($channel_id, $resource)
 Delete a file. More...
 
 get_cloudpath ($arr)
 Returns path to file in cloud/. More...
 
 pipe_streams ($in, $out)
 
-

Function Documentation

+

Detailed Description

+

File/attach API with the potential for revision control.

+

TODO: a filesystem storage abstraction which maintains security (and 'data' contains a system filename which is inaccessible from the web). This could get around PHP storage limits and store videos and larger items, using fread or OS methods or native code to read/write or chunk it through. Also an 'append' option to the storage function might be a useful addition.

+

Function Documentation

@@ -162,6 +177,17 @@ Functions
+

Find an attachment by hash and revision.

+

Returns the entire attach structure including data.

+

This could exhaust memory so most useful only when immediately sending the data.

+
Parameters
+ + + +
$hash
$rev
+
+
+

Referenced by attach_init().

@@ -190,6 +216,17 @@ Functions
+

Find an attachment by hash and revision.

+

Returns the entire attach structure excluding data.

+
See Also
attach_by_hash()
+
Parameters
+ + + +
$hash
$ref
+
+
+

Referenced by item_post(), and send_message().

@@ -248,6 +285,20 @@ Functions
+

Changes permissions of a file.

+
Parameters
+ + + + + + + + +
$channel_id
$resource
$allow_cid
$allow_gid
$deny_cid
$deny_gid
$recurse
+
+
+

Referenced by filestorage_post().

@@ -294,6 +345,19 @@ Functions
+

Count files/attachments.

+
Parameters
+ + + + + + +
$channel_id
$observer
$hash(optional)
$filename(optional)
$filetype(optional)
+
+
+
Returns
array $ret['success'] boolean $ret['results'] amount of found results, or false $ret['message'] string with error messages if any
+
@@ -320,6 +384,15 @@ Functions
+

Delete a file.

+
Parameters
+ + + +
$channel_id
$resource
+
+
+

Referenced by RedDirectory\createFile(), RedFile\delete(), filestorage_content(), and RedFile\put().

@@ -384,6 +457,22 @@ Functions
+

Returns a list of files/attachments.

+
Parameters
+ + + + + + + + + +
$channel_id
$observer
$hash(optional)
$filename(optional)
$filetype(optional)
$orderby
$start
$entries
+
+
+
Returns
array $ret['success'] boolean $ret['results'] array with results, or false $ret['message'] string with error messages if any
+
@@ -415,18 +504,17 @@ Functions
+ +

Create directory.

attach_mkdir($channel,$observer_hash,$arr);

-

Create directory

Parameters
- +
$channelchannel array of owner
$observer_hashhash of current observer
$arrparameter array to fulfil request
$arrparameter array to fulfil request Required: $arr['filename'] $arr['folder'] // hash of parent directory, empty string for root directory Optional: $arr['hash'] // precumputed hash for this node $arr['allow_cid'] $arr['allow_gid'] $arr['deny_cid'] $arr['deny_gid']
-

Required: $arr['filename'] $arr['folder'] // hash of parent directory, empty string for root directory

-

Optional: $arr['hash'] // precumputed hash for this node $arr['allow_cid'] $arr['allow_gid'] $arr['deny_cid'] $arr['deny_gid']

Referenced by RedDirectory\createDirectory().

@@ -467,6 +555,15 @@ Functions
+
Parameters
+ + + + + +
$channelchannel array of owner
$observer_hashhash of current observer
$options(optional)
$arr(optional)
+
+

Referenced by fix_attached_file_permissions(), send_message(), and wall_attach_post().

@@ -486,6 +583,15 @@ Functions
+

Returns path to file in cloud/.

+
Parameters
+ + +
$arr
+
+
+
Returns
string with the path the file to cloud/
+

Referenced by filestorage_content().

@@ -513,6 +619,13 @@ Functions
+
Parameters
+ + + +
$in
$out
+
+

Referenced by attach_init().

@@ -532,6 +645,16 @@ Functions
+

Guess the mimetype from file ending.

+

This function takes a file name and guess the mimetype from the filename extension.

+
Parameters
+ + +
$filenamea string filename
+
+
+
Returns
string The mimetype according to a file ending.
+

Referenced by attach_store(), and RedDirectory\createFile().

@@ -575,7 +698,7 @@ Functions
Parameters
- +
integer$channel_id
string$observer_hash
string$observer_hashhash of current observer
string$pathname
string$parent_hash(optional)
-- cgit v1.2.3