Agile Toolkit  4.2
Agile Toolkit is a powerful web development framework. Inspired by GUI Applications development
DatabaseStorage Class Reference

Public Member Functions

 init ()
 getFileList ()
 getFiles ()
 getFilespaces ()
 getFilespacePath ()
 getFilespaceId ($filesize=false)
 getFilesize ($file_id)
 getFilenum ($file_id)
 getFilename ($file_id)
 deleteFile ($file_id)
 downloadFile ($file_id)
 uploadFile ($files_array, $saveas_name='')
 beforeSave ($file)
 afterSave ($file)
 getFileTypeId ($filetype)
 realFilePath ($file_id)

Protected Member Functions

 saveFile ($file)
 _real_filename ($file_id, $filenum='', $create_dir=true)

Protected Attributes

 $files
 $filespaces
 $filetypes
 $deleted_files

Detailed Description

Class for file storage using database. Actually files are stored on disk, in specific directory structure: Each directory contains 255 files at the most Each filename is a hex number (from 00 to FF) Original file names are stored in database along with real storage info 4 tables needed to store file data: filespace: info about filespaces (directories, local or network discs, etc.) filetype filedelnum: deleted files storage info. Needed to reuse deleted file numbers file: currently stored files

Benefits: no long names that could cause troubles no overfilled directories that could cause access time increase ability to use different types of datastorages, including network disks

Created on 27.10.2006 by *Camper* (camper@adevel.com)


Member Function Documentation

_real_filename ( file_id,
filenum = '',
create_dir = true 
) [protected]

return filename in filespace, create directories if necessary

afterSave ( file)
beforeSave ( file)
deleteFile ( file_id)
downloadFile ( file_id)

Returns file data by filespace id and file id

getFilename ( file_id)
getFilenum ( file_id)
getFiles ( )
getFilesize ( file_id)
getFilespaceId ( filesize = false)
getFileTypeId ( filetype)

Returns an ID of filetype by name

init ( )
realFilePath ( file_id)
saveFile ( file) [protected]

Save file into storage. Takes an array as argument (see AbstractStorage::file property)

uploadFile ( files_array,
saveas_name = '' 
)

Field Documentation

$deleted_files [protected]
$files [protected]
$filespaces [protected]
$filetypes [protected]

The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Enumerations