[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/filesystem/src/ -> File.php (summary)

Part of the Joomla Framework Filesystem Package

Copyright: Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
License: GNU General Public License version 2 or later; see LICENSE
File Size: 334 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

File:: (8 methods):
  stripExt()
  makeSafe()
  copy()
  delete()
  move()
  write()
  upload()
  invalidateFileCache()


Class: File  - X-Ref

A File handling class

stripExt($file)   X-Ref
Strips the last extension off of a file name

param: string  $file  The file name
return: string  The file name without the extension

makeSafe($file, array $stripChars = [')   X-Ref
Makes the file name safe to use

param: string  $file        The name of the file [not full path]
param: array   $stripChars  Array of regex (by default will remove any leading periods)
return: string  The sanitised string

copy($src, $dest, $path = null, $useStreams = false)   X-Ref
Copies a file

param: string   $src         The path to the source file
param: string   $dest        The path to the destination file
param: string   $path        An optional base path to prefix to the file names
param: boolean  $useStreams  True to use streams
return: boolean  True on success

delete($file)   X-Ref
Delete a file or array of files

param: mixed  $file  The file name or an array of file names
return: boolean  True on success

move($src, $dest, $path = '', $useStreams = false)   X-Ref
Moves a file

param: string   $src         The path to the source file
param: string   $dest        The path to the destination file
param: string   $path        An optional base path to prefix to the file names
param: boolean  $useStreams  True to use streams
return: boolean  True on success

write($file, &$buffer, $useStreams = false, $appendToFile = false)   X-Ref
Write contents to a file

param: string   $file          The full file path
param: string   $buffer        The buffer to write
param: boolean  $useStreams    Use streams
param: boolean  $appendToFile  Append to the file and not overwrite it.
return: boolean  True on success

upload($src, $dest, $useStreams = false)   X-Ref
Moves an uploaded file to a destination folder

param: string   $src         The name of the php (temporary) uploaded file
param: string   $dest        The path (including filename) to move the uploaded file to
param: boolean  $useStreams  True to use streams
return: boolean  True on success

invalidateFileCache($file)   X-Ref
Invalidate any opcache for a newly written file immediately, if opcache* functions exist and if this was a PHP file.

param: string  $file  The path to the file just written to, to flush from opcache
return: void



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer