CaMykS  1.0-20181201
 All Classes Files Functions Variables Pages
Functions | Variables
file.php.inc File Reference

File specific methods. More...

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'
 

Detailed Description

File specific methods.

Engine / Tool Library

Author
CaMykS Team camyk.nosp@m.s.co.nosp@m.ntact.nosp@m.@gma.nosp@m.il.co.nosp@m.m
Version
1.0.5
Date
Creation: Jun 2005
Modification: Oct 2018
Note
This program is distributed as is - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Todo:
complete file type, extension, and mime list

Function Documentation

_file_getMimeFromExtension (   $file,
  $ext = null 
)
private

Return file mime from file extension.

Parameters
string$file
string$ext
Returns
string
_file_getMimeFromFinfo (   $file)
private

Return file mime from finfo method.

Parameters
string$file
Returns
string
_file_getMimeFromMimeContentType (   $file)
private

Return file mime from content_mime_type method.

Parameters
string$file
Returns
string
file_delete (   $file)
file_download (   $file,
  $path 
)

Download file with curl.

Parameters
string$file
string$path
Returns
void
file_getContent (   $file)

Return file content.

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

Return human readable file size.

Parameters
int$size
Returns
string
file_getHTAccessFileEnder ( )

Return CaMykS ender for htaccess file.

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

Return CaMykS header for htaccess file.

Parameters
string$desc
string$version
Returns
string
file_getImageSize (   $file)

Return image size in pixel as formatted string.

Parameters
string$file
Returns
string
file_getImageType (   $file)

Return image type

Parameters
string$file
Returns
string
file_getMime (   $file,
  $ext = null 
)

Return file mime type.

Parameters
string$file
string$ext
Returns
string
file_getMimeDescription (   $mime = '')

Return file mime description.

Parameters
string$mime
Returns
string
file_getMimeIcon (   $mime = '',
  $size = 32,
  $styles = '' 
)

Return file type icon.

Parameters
string$mime
int$size
string$styles
Returns
string
file_getMimeIconURL (   $mime = '',
  $size = 32 
)

Return file type icon.

Parameters
string$mime
int$size
Returns
string
file_getPHPFileEnder ( )
See also
file_getPHPFileFooter
Returns
string
Deprecated:
Use file_getPHPFileFooter instead.
file_getPHPFileFooter ( )

Return CaMykS footer for PHP file.

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

Return CaMykS header for PHP file.

Parameters
string$desc
string$version
Returns
string
file_getTypeDescription (   $mime = '',
  $ext = null 
)

Return file type description.

Parameters
string$mime
string$ext
Returns
string
file_isImage (   $file)

Check if file is an image.

Parameters
string$file
Returns
boolean
file_isInPath (   $file = '',
  $path = '' 
)

Check if folder is in path

Parameters
string$file
string$path
Returns
boolean result
file_md5 (   $file,
  $contextParams = array() 
)

MD5_file replacement, to avoid 403 errors.

Parameters
string$file
array$contextParams
Returns
mixed
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_search (   $pattern = '*',
  $rootPath = './',
  $globFlags = 0 
)

Search a file in a folder.

Parameters
string$pattern
string$rootPath
integer$globFlags
Returns
array
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_writeConfFile (   $file_path,
  $desc,
  $datas 
)

Write a configration file.

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

Variable Documentation

const FILE_ICON_EXTENSION 'gif'