CaMykS  1.0-20231201
Functions | Variables
file.php.inc File Reference

Functions

 file_write ($file_path, $content, $deleteCache=false)
 
 file_getPHPFileHeader ($desc="", $version="none")
 
 file_getPHPFileFooter ()
 
 file_getHTAccessFileHeader ($desc="", $version="none")
 
 file_getHTAccessFileEnder ()
 
 file_getContent ($file)
 
 file_download ($file, $path)
 
 file_delete ($file)
 
 file_getMimeIconURL ($mime='', $size=32)
 
 file_getMimeIcon ($mime='', $size=32, $styles='')
 
 file_getTypeDescription ($mime='', $ext=null)
 
 file_getMimeDescription ($mime='')
 
 file_getFileSize ($size)
 
 file_getMime ($file, $ext=null)
 
 file_getImageSize ($file)
 
 file_getImageType ($file)
 
 file_isImage ($file)
 
 file_readfile ($filename, $retbytes=true)
 
 file_writeConfFile ($file_path, $desc, $datas)
 
 file_search ($pattern=' *', $rootPath='./', $globFlags=0)
 
 file_md5 ($file, $contextParams=array())
 
 file_isInPath ($file='', $path='')
 
 _file_getMimeFromFinfo ($file)
 
 _file_getMimeFromMimeContentType ($file)
 
 _file_getMimeFromExtension ($file, $ext=null)
 
 file_getFileIcon ($mime='', $size=32)
 
 file_getPHPFileEnder ()
 

Variables

const FILE_ICON_EXTENSION 'gif'
 

Function Documentation

◆ file_write()

file_write (   $file_path,
  $content,
  $deleteCache = false 
)

Write given file with given content.

Parameters
string$file_path
string$content
boolean$deleteCache
Returns
boolean success

◆ file_getPHPFileHeader()

file_getPHPFileHeader (   $desc = "",
  $version = "none" 
)

Return CaMykS header for PHP file.

Parameters
string$desc
string$version
Returns
string

◆ file_getPHPFileFooter()

file_getPHPFileFooter ( )

Return CaMykS footer for PHP file.

Returns
string

◆ file_getHTAccessFileHeader()

file_getHTAccessFileHeader (   $desc = "",
  $version = "none" 
)

Return CaMykS header for htaccess file.

Parameters
string$desc
string$version
Returns
string

◆ file_getHTAccessFileEnder()

file_getHTAccessFileEnder ( )

Return CaMykS ender for htaccess file.

Returns
string

◆ file_getContent()

file_getContent (   $file)

Return file content.

Parameters
string$file
Returns
string

◆ file_download()

file_download (   $file,
  $path 
)

Download file with curl.

Parameters
string$file
string$path
Returns
void

◆ file_delete()

file_delete (   $file)

◆ file_getMimeIconURL()

file_getMimeIconURL (   $mime = '',
  $size = 32 
)

Return file type icon.

Parameters
string$mime
int$size
Returns
string

◆ file_getMimeIcon()

file_getMimeIcon (   $mime = '',
  $size = 32,
  $styles = '' 
)

Return file type icon.

Parameters
string$mime
int$size
string$styles
Returns
string

◆ file_getTypeDescription()

file_getTypeDescription (   $mime = '',
  $ext = null 
)

Return file type description.

Parameters
string$mime
string$ext
Returns
string

◆ file_getMimeDescription()

file_getMimeDescription (   $mime = '')

Return file mime description.

Parameters
string$mime
Returns
string

◆ file_getFileSize()

file_getFileSize (   $size)

Return human readable file size.

Parameters
int$size
Returns
string

◆ file_getMime()

file_getMime (   $file,
  $ext = null 
)

Return file mime type.

Parameters
string$file
string$ext
Returns
string

◆ file_getImageSize()

file_getImageSize (   $file)

Return image size in pixel as formatted string.

Parameters
string$file
Returns
string

◆ file_getImageType()

file_getImageType (   $file)

Return image type

Parameters
string$file
Returns
string

◆ file_isImage()

file_isImage (   $file)

Check if file is an image.

Parameters
string$file
Returns
boolean

◆ file_readfile()

file_readfile (   $filename,
  $retbytes = true 
)

Equivalent to php readfile, without the 2Mo limitation on PHP 5.0.0 to 5.0.4 bug.

Parameters
string$filename
boolean$retbytes
Returns
mixed

◆ file_writeConfFile()

file_writeConfFile (   $file_path,
  $desc,
  $datas 
)

Write a configration file.

Parameters
string$file_path
string$desc
array$datas
Returns
boolean success

◆ file_search()

file_search (   $pattern = '*',
  $rootPath = './',
  $globFlags = 0 
)

Search a file in a folder.

Parameters
string$pattern
string$rootPath
integer$globFlags
Returns
array

◆ file_md5()

file_md5 (   $file,
  $contextParams = array() 
)

MD5_file replacement, to avoid 403 errors.

Parameters
string$file
array$contextParams
Returns
mixed

◆ file_isInPath()

file_isInPath (   $file = '',
  $path = '' 
)

Check if folder is in path

Parameters
string$file
string$path
Returns
boolean result

◆ _file_getMimeFromFinfo()

_file_getMimeFromFinfo (   $file)
private

Return file mime from finfo method.

Parameters
string$file
Returns
string

◆ _file_getMimeFromMimeContentType()

_file_getMimeFromMimeContentType (   $file)
private

Return file mime from content_mime_type method.

Parameters
string$file
Returns
string

◆ _file_getMimeFromExtension()

_file_getMimeFromExtension (   $file,
  $ext = null 
)
private

Return file mime from file extension.

Parameters
string$file
string$ext
Returns
string

◆ file_getFileIcon()

file_getFileIcon (   $mime = '',
  $size = 32 
)
See also
file_getMimeIcon
Parameters
string$mime
int$size
Returns
string
Deprecated:
Use file_getMimeIcon instead.

◆ file_getPHPFileEnder()

file_getPHPFileEnder ( )
See also
file_getPHPFileFooter
Returns
string
Deprecated:
Use file_getPHPFileFooter instead.

Variable Documentation

◆ FILE_ICON_EXTENSION

const FILE_ICON_EXTENSION 'gif'