Jelix 1.7.18

FileHelpersTrait

Trait for installer/configurator classes.

For methods having a target path as parameter, the path may content these Jelix shortcuts parts: 'www:', 'config:', 'var:', 'temp:', 'log:'.

Tags
since
1.7

Table of Contents

copyDirectoryContent()  : mixed
copy the whole content of a directory existing in the install/ directory of the component, to the given directory.
copyFile()  : mixed
copy a file from the install/ directory to an other.
removeDirectoryContent()  : mixed
remove the whole content of a directory from the application.
removeFile()  : mixed
delete a file from the the application.
setupModuleWebFiles()  : mixed
Install web files of a module.
expandPath()  : mixed

Methods

copyDirectoryContent()

copy the whole content of a directory existing in the install/ directory of the component, to the given directory.

public copyDirectoryContent(string $relativeSourcePath, string $targetPath[, mixed $overwrite = false ]) : mixed
Parameters
$relativeSourcePath : string

relative path to the install/ directory of the component

$targetPath : string

the path where to copy the content. the path may content Jelix shortcuts, see FileHelpersTrait

$overwrite : mixed = false
Return values
mixed

copyFile()

copy a file from the install/ directory to an other.

public copyFile(string $relativeSourcePath, string $targetPath[, mixed $overwrite = false ]) : mixed
Parameters
$relativeSourcePath : string

relative path to the install/ directory of the file to copy

$targetPath : string

the path where to copy the file. the path may content Jelix shortcuts, see FileHelpersTrait

$overwrite : mixed = false
Return values
mixed

removeDirectoryContent()

remove the whole content of a directory from the application.

public removeDirectoryContent(string $targetPath) : mixed
Parameters
$targetPath : string

the path of the directory to remove the path may content Jelix shortcuts, see FileHelpersTrait

Return values
mixed

removeFile()

delete a file from the the application.

public removeFile(string $targetPath) : mixed
Parameters
$targetPath : string

the path of the file the path may content Jelix shortcuts, see FileHelpersTrait

Return values
mixed

setupModuleWebFiles()

Install web files of a module.

public setupModuleWebFiles(string $wwwFilesMode, string $wwwDirectoryName, string $sourcePath) : mixed

It supports different way to install : copying files, creating a symbolic link or do nothing (aka you should create an alias nto the vhost of the web server)

Parameters
$wwwFilesMode : string

should be 'copy' or '' (files will be copied), 'symlink' (a sym link is created) or any other value (do nothing/remove copied files)

$wwwDirectoryName : string

the path inside the www path

$sourcePath : string

the path of the directory

Tags
throws
jException
Return values
mixed

expandPath()

protected expandPath(mixed $path) : mixed
Parameters
$path : mixed
Return values
mixed

Search results