PHP Class Valet\Filesystem

Afficher le fichier Open project: laravel/valet Class Usage Examples

Méthodes publiques

Méthode Description
append ( string $path, string $contents, string | null $owner = null ) : void Append the contents to the given file.
appendAsUser ( string $path, string $contents ) : void Append the contents to the given file as the non-root user.
chgrp ( string $path, string $group ) Change the group of the given path.
chown ( string $path, string $user ) Change the owner of the given path.
copy ( string $from, string $to ) : void Copy the given file to a new location.
copyAsUser ( string $from, string $to ) : void Copy the given file to a new location for the non-root user.
ensureDirExists ( string $path, string | null $owner = null, integer $mode = 493 ) : void Ensure that the given directory exists.
exists ( string $path ) : boolean Determine if the given file exists.
get ( string $path ) : string Read the contents of the given file.
isBrokenLink ( string $path ) : boolean Determine if the given path is a broken symbolic link.
isDir ( string $path ) : boolean Determine if the given path is a directory.
isLink ( string $path ) : boolean Determine if the given path is a symbolic link.
mkdir ( string $path, string | null $owner = null, integer $mode = 493 ) : void Create a directory.
mkdirAsUser ( string $path, integer $mode = 493 ) : void Create a directory as the non-root user.
put ( string $path, string $contents, string | null $owner = null ) : string Write to the given file.
putAsUser ( string $path, string $contents ) : string Write to the given file as the non-root user.
readLink ( string $path ) : string Resolve the given symbolic link.
realpath ( string $path ) : string Resolve the given path.
removeBrokenLinksAt ( string $path ) : void Remove all of the broken symbolic links at the given path.
scandir ( string $path ) : array Scan the given directory path.
symlink ( string $target, string $link ) : void Create a symlink to the given target.
symlinkAsUser ( string $target, string $link ) : void Create a symlink to the given target for the non-root user.
touch ( string $path, string | null $owner = null ) : string Touch the given path.
touchAsUser ( string $path ) : void Touch the given path as the non-root user.
unlink ( string $path ) : void Delete the file at the given path.

Method Details

append() public méthode

Append the contents to the given file.
public append ( string $path, string $contents, string | null $owner = null ) : void
$path string
$contents string
$owner string | null
Résultat void

appendAsUser() public méthode

Append the contents to the given file as the non-root user.
public appendAsUser ( string $path, string $contents ) : void
$path string
$contents string
Résultat void

chgrp() public méthode

Change the group of the given path.
public chgrp ( string $path, string $group )
$path string
$group string

chown() public méthode

Change the owner of the given path.
public chown ( string $path, string $user )
$path string
$user string

copy() public méthode

Copy the given file to a new location.
public copy ( string $from, string $to ) : void
$from string
$to string
Résultat void

copyAsUser() public méthode

Copy the given file to a new location for the non-root user.
public copyAsUser ( string $from, string $to ) : void
$from string
$to string
Résultat void

ensureDirExists() public méthode

Ensure that the given directory exists.
public ensureDirExists ( string $path, string | null $owner = null, integer $mode = 493 ) : void
$path string
$owner string | null
$mode integer
Résultat void

exists() public méthode

Determine if the given file exists.
public exists ( string $path ) : boolean
$path string
Résultat boolean

get() public méthode

Read the contents of the given file.
public get ( string $path ) : string
$path string
Résultat string

isDir() public méthode

Determine if the given path is a directory.
public isDir ( string $path ) : boolean
$path string
Résultat boolean

mkdir() public méthode

Create a directory.
public mkdir ( string $path, string | null $owner = null, integer $mode = 493 ) : void
$path string
$owner string | null
$mode integer
Résultat void

mkdirAsUser() public méthode

Create a directory as the non-root user.
public mkdirAsUser ( string $path, integer $mode = 493 ) : void
$path string
$mode integer
Résultat void

put() public méthode

Write to the given file.
public put ( string $path, string $contents, string | null $owner = null ) : string
$path string
$contents string
$owner string | null
Résultat string

putAsUser() public méthode

Write to the given file as the non-root user.
public putAsUser ( string $path, string $contents ) : string
$path string
$contents string
Résultat string

realpath() public méthode

Resolve the given path.
public realpath ( string $path ) : string
$path string
Résultat string

removeBrokenLinksAt() public méthode

Remove all of the broken symbolic links at the given path.
public removeBrokenLinksAt ( string $path ) : void
$path string
Résultat void

scandir() public méthode

Scan the given directory path.
public scandir ( string $path ) : array
$path string
Résultat array

symlinkAsUser() public méthode

This uses the command line as PHP can't change symlink permissions.
public symlinkAsUser ( string $target, string $link ) : void
$target string
$link string
Résultat void

touch() public méthode

Touch the given path.
public touch ( string $path, string | null $owner = null ) : string
$path string
$owner string | null
Résultat string

touchAsUser() public méthode

Touch the given path as the non-root user.
public touchAsUser ( string $path ) : void
$path string
Résultat void