Class FileRepository

Description

File repository provides a wrapper for storing files in a specific repository. It provides methos for adding, updating and removing files. Every file is reprepsented by a file ID and can be accessed by it

  • version: 1.0

Located in /library/filerepository/FileRepository.class.php (line 10)


	
			
Method Summary
static string addFile (string $source, [array $attributes = null], [string $backend_name = null])
static boolean cleanUp ([string $backend_name = null])
static integer countFiles ([string $backend_name = null])
static boolean deleteFile (string $file_id, [string $backend_name = null])
static FileRepository_Backend getBackend ([string $backend_name = null])
static mixed getFileAttribute (string $file_id, string $attribute_name, [mixed $default = null], [string $backend_name = null])
static array getFileAttributes (string $file_id, [string $backend_name = null])
static string getFileContent (stirng $file_id, [string $backend_name = null])
static boolean isInRepository (string $file_id, [string $backend_name = null])
static array listFiles ([string $backend_name = null])
static null setBackend (FileRepository_Backend $value, [ $backend_name = null])
static null setFileAttribute (string $file_id, string $attribute_name, mixed $attribute_value, [string $backend_name = null])
static boolean updateFileContent (string $file_id, string $source, [string $backend_name = null])
Methods
static method addFile (line 106)

Add file to the repository

  • return: File ID
static string addFile (string $source, [array $attributes = null], [string $backend_name = null])
  • string $source: File path of source file
  • array $attributes
  • string $backend_name: Backend name. If NULL default backend will be used
static method cleanUp (line 139)

Clean up the repository - delete all files

static boolean cleanUp ([string $backend_name = null])
  • string $backend_name: Backend name. If NULL default backend will be used
static method countFiles (line 46)

Return number of files from the repository

static integer countFiles ([string $backend_name = null])
  • string $backend_name: Backend name. If NULL default backend will be used
static method deleteFile (line 129)

Delete specific file from repository

static boolean deleteFile (string $file_id, [string $backend_name = null])
  • string $file_id
  • string $backend_name: Backend name. If NULL default backend will be used
static method getBackend (line 165)

Get backend

static FileRepository_Backend getBackend ([string $backend_name = null])
  • string $backend_name: If NULL default backend will be returned. Else backend named $backend_name will be returned if avialble
static method getFileAttribute (line 81)

Return value of specifi file attribute. If attrbute is not available return $default

static mixed getFileAttribute (string $file_id, string $attribute_name, [mixed $default = null], [string $backend_name = null])
  • string $file_id
  • string $attribute_name
  • mixed $default
  • string $backend_name: Backend name. If NULL default backend will be used
static method getFileAttributes (line 68)

Return all file attributes

static array getFileAttributes (string $file_id, [string $backend_name = null])
  • string $file_id
  • string $backend_name: Backend name. If NULL default backend will be used
static method getFileContent (line 57)

Return content of specific file

static string getFileContent (stirng $file_id, [string $backend_name = null])
  • stirng $file_id: File ID
  • string $backend_name: Backend name. If NULL default backend will be used
static method isInRepository (line 150)

Check if $file_id is in repository

static boolean isInRepository (string $file_id, [string $backend_name = null])
  • string $file_id
  • string $backend_name: Backend name. If NULL default backend will be used
static method listFiles (line 36)

Return all file IDs that are stored in repository

static array listFiles ([string $backend_name = null])
  • string $backend_name: Backend name. If NULL default backend will be used
static method setBackend (line 184)

Set backend value

  • throws: InvalidInstanceError
static null setBackend (FileRepository_Backend $value, [ $backend_name = null])
static method setFileAttribute (line 94)

Set value of specific attribute

static null setFileAttribute (string $file_id, string $attribute_name, mixed $attribute_value, [string $backend_name = null])
  • string $file_id
  • string $attribute_name
  • mixed $attribute_value: Resources and objects are not supported!
  • string $backend_name: Backend name. If NULL default backend will be used
static method updateFileContent (line 118)

Update content of specific file with content from $source file

static boolean updateFileContent (string $file_id, string $source, [string $backend_name = null])
  • string $file_id
  • string $source
  • string $backend_name: Backend name. If NULL default backend will be used

Documentation generated on Wed, 23 Jan 2008 01:58:37 +0000 by phpDocumentor 1.4.0