Public Member Functions

Stream Class Reference

Basic Stream. More...

Inheritance diagram for Stream:
BEAppModel AppModel

List of all members.

Public Member Functions

 getIdFromFilename ($filename)
 Get id from filename.
 getCategoryMediaType ($mimeType, $modelType)
 Get default category media type from mime and model.
 updateStreamFields ($id=null)
 update fields in streams table
 clearMediaCache ($id=null)
 Clears media cache, using both new cache structure ($mediaRoot/cache) and old structure.
 getMediaProvider ($uri)
 return media provider array or false if $uri it's not managed
 getMimeType ($path, $filename=null)
 get mime type by finfo_open (if function exist) or by file extension
 getMimeTypeByExtension ($filename)
 get mime type by file extension
 setMimeTypes ()
 set Stream::mimeTypes array using bedita-app/config/mimi.types.php file
 getMimeTypes ()
 get Stream::mimeTypes
 appendStreamFields (array $objects, $options=array())
 append stream fields to objects array
 copyFileToMediaFolder ($source, $destPath)
 Copy $name to $destPath using BEdita media logic (it's not a direct copy of the file) Create md5-named subfolders for file.

Detailed Description

Basic Stream.

Version:
$Revision$ $LastChangedBy$ $LastChangedDate$

$Id$

Definition at line 31 of file stream.php.


Member Function Documentation

Stream::appendStreamFields ( array $  objects,
options = array() 
)

append stream fields to objects array

Parameters:
array $objects
array $options

Definition at line 310 of file stream.php.

Stream::clearMediaCache ( id = null  ) 

Clears media cache, using both new cache structure ($mediaRoot/cache) and old structure.

See: https://github.com/bedita/bedita/issues/352

Parameters:
int $id, object id of which clear cache
Returns:
mixed, false if no stream was found empty array if cleaning operation proceeds without errors array with errors if something goes wrong. Itcontains: 'failed' => array of objects data on which clear media failed. Each item contains: 'id' => object id, 'error' => message error

Definition at line 182 of file stream.php.

References BeLib::getObject().

Stream::copyFileToMediaFolder ( source,
destPath 
)

Copy $name to $destPath using BEdita media logic (it's not a direct copy of the file) Create md5-named subfolders for file.

Return new relative path to file

Parameters:
string $source file
string $destPath folder
Returns:
string new relative path to file

Definition at line 332 of file stream.php.

Stream::getCategoryMediaType ( mimeType,
modelType 
)

Get default category media type from mime and model.

Parameters:
string $mimeType, stream mime type
string $modelType, model type: "Image", "Video",...

Definition at line 58 of file stream.php.

Stream::getIdFromFilename ( filename  ) 

Get id from filename.

Parameters:
string $filename

Definition at line 43 of file stream.php.

Stream::getMediaProvider ( uri  ) 

return media provider array or false if $uri it's not managed

Parameters:
$uri 
Returns:
mixed array("provider" => "", "uri" => "", "video_uid" => "") or false if not found

Definition at line 232 of file stream.php.

Referenced by updateStreamFields().

Stream::getMimeType ( path,
filename = null 
)

get mime type by finfo_open (if function exist) or by file extension

Parameters:
$path full path of file
$filename 
Returns:
string or false if mime_type not found

Definition at line 252 of file stream.php.

References getMimeTypeByExtension().

Referenced by updateStreamFields().

Stream::getMimeTypeByExtension ( filename  ) 

get mime type by file extension

Parameters:
$filename 
Returns:
string or false if mime_type not found

Definition at line 275 of file stream.php.

References setMimeTypes().

Referenced by getMimeType().

Stream::getMimeTypes (  ) 

get Stream::mimeTypes

Returns:
array of mime type

Definition at line 300 of file stream.php.

Stream::setMimeTypes (  ) 

set Stream::mimeTypes array using bedita-app/config/mimi.types.php file

Returns:
void

Definition at line 291 of file stream.php.

Referenced by getMimeTypeByExtension().

Stream::updateStreamFields ( id = null  ) 

update fields in streams table

Parameters:
int $id, if empty update all streams
Returns:
array of updated streams (empty array if no array updated)

Definition at line 84 of file stream.php.

References getMediaProvider(), and getMimeType().


The documentation for this class was generated from the following file:
Generated on Fri Dec 11 2015 15:29:47 by Doxygen 1.7.1  BEditaBEdita 3.7 Corylus