Skip to content
PHP Ecosystem
Explore

FileHelper

API reference › yii › helpers › FileHelper

classyii\helpers\FileHelper
ExtendsBaseFileHelper
Since2.0
Sourceframework/helpers/FileHelper.php

File system helper.

PropertyTypeDescriptionDefined by
$mimeAliasesFile staticstringThe path (or alias) of a PHP file containing MIME aliases. Default: '@yii/helpers/mimeAliases.php'. Available since 2.0.14.BaseFileHelper
$mimeExtensionsFile staticstringThe path (or alias) of a PHP file containing extensions per MIME type. Default: '@yii/helpers/mimeExtensions.php'. Available since 2.0.48.BaseFileHelper
$mimeMagicFile staticstringThe path (or alias) of a PHP file containing MIME type information. Default: '@yii/helpers/mimeTypes.php'.BaseFileHelper
MethodDescriptionDefined by
changeOwnership() staticChanges the Unix user and/or group ownership of a file or directory, and optionally the mode.BaseFileHelper
copyDirectory() staticCopies a whole directory as another one.BaseFileHelper
createDirectory() staticCreates a new directory.BaseFileHelper
filterPath() staticChecks if the given file path satisfies the filtering options.BaseFileHelper
findDirectories() staticReturns the directories found under the specified directory and subdirectories.BaseFileHelper
findFiles() staticReturns the files found under the specified directory and subdirectories.BaseFileHelper
getExtensionByMimeType() staticDetermines the most common extension by given MIME type.BaseFileHelper
getExtensionsByMimeType() staticDetermines the extensions by given MIME type.BaseFileHelper
getMimeType() staticDetermines the MIME type of the specified file.BaseFileHelper
getMimeTypeByExtension() staticDetermines the MIME type based on the extension name of the specified file.BaseFileHelper
localize() staticReturns the localized version of a specified file.BaseFileHelper
normalizePath() staticNormalizes a file/directory path.BaseFileHelper
removeDirectory() staticRemoves a directory (and all its content) recursively.BaseFileHelper
unlink() staticRemoves a file or symlink in a cross-platform wayBaseFileHelper
loadMimeAliases() protected staticLoads MIME aliases from the specified file.BaseFileHelper
loadMimeExtensions() protected staticLoads MIME extensions from the specified file.BaseFileHelper
loadMimeTypes() protected staticLoads MIME types from the specified file.BaseFileHelper
normalizeOptions() protected staticBaseFileHelper