Class Media

Description

Media access

  • version: $Id$
  • copyright: 2008
  • todo: Handle all error conditions using exceptions

Located in /system/classes/media.php (line 12)


	
			
Class Constant Summary
Variable Summary
static mixed $silos
Method Summary
static boolean copy (string $pathfrom, string $pathto)
static boolean delete (string $path)
static array dir ([string $path = ''])
static MediaAsset get (string $path, [array $qualities = null])
static MediaSilo get_silo ( &$silo, [boolean $parse_path = false], mixed $silo)
static array highlights ([mixed $path = null])
static void init_silos ()
static boolean move (string $pathfrom, string $pathto)
static array permissions (mixed $path)
static MediaAsset prepare (string $path)
static boolean put (MediaAsset $filedata, [string $path = null])
Variables
static mixed $silos = null (line 14)
Methods
static method copy (line 121)

Copy the asset using the specified from and to paths

  • return: true on success
  • access: public
static boolean copy (string $pathfrom, string $pathto)
  • string $pathfrom: The virtual path source
  • string $pathto: The virtual path destination
static method delete (line 103)

Delete the asset at the specified virtual path

  • return: true on success
  • access: public
static boolean delete (string $path)
  • string $path: The virtual path of the asset to delete
static method dir (line 24)

Retrieve an array of media assets stored at a virtual path

  • return: A list of files and directories in that path
  • access: public
static array dir ([string $path = ''])
  • string $path: The virtual path of the directory to retrieve
static method get (line 54)

Get the MediaAsset stored at a virtual path

  • return: The requested asset
  • access: public
static MediaAsset get (string $path, [array $qualities = null])
  • string $path: The virtual path of the file to retrieve
  • array $qualities: Qualities of the image to return (such as 'thumbnail' or 'size')
static method get_silo (line 190)

Return the instance of a silo

  • return: The requested silo
  • access: public
static MediaSilo get_silo ( &$silo, [boolean $parse_path = false], mixed $silo)
  • mixed $silo: A silo instance or the name of a silo
  • boolean $parse_path: If true, parse the siloname from the path and return the remainder path by reference
  • &$silo
static method highlights (line 155)

Return an array of highlighted (featured) assets from all silos

  • return: An array of MediaAsset highlight assets
  • access: public
static array highlights ([mixed $path = null])
  • mixed $path: The name of a silo or a silo instance. If empty, all silos are returned.
static method init_silos (line 213)

Initialize the internal list of silo instances

  • access: public
static void init_silos ()
static method move (line 139)

Move the asset using the specified from and to paths A shortcut for Media::copy() then Media::delete()

  • return: true on success
  • access: public
static boolean move (string $pathfrom, string $pathto)
  • string $pathfrom: The virtual path source
  • string $pathto: The virtual path destination
static method permissions (line 177)

Return the permissions available to the current user on the specified path

  • return: An array of permission constants (read, write, etc.)
  • access: public
static array permissions (mixed $path)
  • mixed $path: The name of a silo or a silo instance.
static method prepare (line 70)

Fetch an empty MediaAsset with the available metadata keys pre-allocated

  1.  $asset Media::prepare('silotype/foo/bar');
  2.  foreach($asset->get_info(as $key => $valueecho "$key : $value";

  • return: An empty, intialized asset instance
  • access: public
static MediaAsset prepare (string $path)
  • string $path: The virtual path at which the asset will be stored
static method put (line 83)

Store the asset at the specified virtual path

  • return: true on success
  • access: public
static boolean put (MediaAsset $filedata, [string $path = null])
  • MediaAsset $filedata: The asset to store
  • string $path: The virtual path where the asset will be stored
Class Constants
THUMBNAIL_HEIGHT = 100 (line 16)
THUMBNAIL_WIDTH = 200 (line 15)

Documentation generated on Thu, 30 Oct 2008 20:31:20 +0100 by phpDocumentor 1.3.2