core/fileFILE.php

WIKINDX : Bibliographic Management system.

Functions

setHeaders()

setHeaders(  type,   size,   filename,   lastmodified,   charset) : 

Set download headers

Parameters

type
size
filename
lastmodified
charset

Default is ''

Returns

createFileName()

createFileName(  dirName,   string,   extension) : mixed||string|int

create a fileName for this file. If directory based on session ID does not exist, create it.

Parameters

dirName
string

File contents

extension

File extension

Returns

mixed||string|int —

(filename, full filepath)

fileMaxSize()

fileMaxSize() : 

Get file max upload size

Returns

return_bytes()

return_bytes(  val) : 

Convert some ini values to numerical values (to bytes)

Parameters

val

Returns

dirToArray()

dirToArray(  dir) : mixed||string|int

Enumerate files and subdirectories of a directory except . and .. subdirectories

Parameters

dir

A directory to explore

Returns

mixed||string|int —

An array of file and subdirectory names

dirInDirToArray()

dirInDirToArray(  dir) : mixed||string|int

Enumerate subdirectories of a directory except . and .. subdirectories

Parameters

dir

A directory to explore

Returns

mixed||string|int —

An array of subdirectory names

fileInDirToArray()

fileInDirToArray(  dir) : mixed||string|int

Enumerate files of a directory except . and .. subdirectories

Parameters

dir

A directory to explore

Returns

mixed||string|int —

An array of filenames

fileUpload()

fileUpload(  filename = FALSE,  multiple = FALSE) : mixed||string|int

Return filename, hash, type and size of an uploaded file or an array of such information for each file uploaded

Parameters

filename
multiple

Returns

mixed||string|int —

(filename, hash, type, size) or array of these

rearrangeFilesArray()

rearrangeFilesArray( files) : mixed||string|int

Rearrange the $_FILES array for multiple file uploads

Parameters

files

Returns

mixed||string|int —

fileStore()

fileStore(  dirName,   name,  index = FALSE) : 

Store uploaded file in given directory with given name

Parameters

dirName
name
index

Returns

listFiles()

listFiles() : mixed||string|int

list and HTML format all files for sessionID

Returns

mixed||string|int —

(filesDir, fileDeleteSecs, fileArray)

tidyFiles()

tidyFiles() : 

tidy up the files directory by removing all files and folders older than 'configFileDeleteSeconds'

Returns

zip()

zip(mixed||string|int  files,   path) : 

Zip up an array of files. File is stored in files dir.

Parameters

mixed||string|int files

unqualified filenames (key is label of file, value is filename on disk)

path

file path

Returns

unqualified SHA1'ed filename of zip or FALSE if failure

command_exists()

command_exists(  command) : 

Does an unix command exist?

Parameters

command

Command to test with the default shell

Returns

TRUE on success

suhosin_function_exists()

suhosin_function_exists(  func) : 

Does a function exist ou is enabled with or without the suhosin security extension?

https://suhosin.org/stories/index.html Author webmaster@mamo-net.de

Parameters

func

Function name

Returns

TRUE if the function is enabled