docs/static/reference/php/Dagger/File.html
class File extends AbstractObject implements IdAble
A file.
| | $lastQuery | | from AbstractObject |
__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)
No description
from AbstractObject
null|array|string|int|float|bool
queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)
No description
from AbstractObject
asEnvFile(bool|null $expand = null)
Parse as an env file
asJSON()
Parse the file contents as JSON.
chown(string $owner)
Change the owner of the file recursively.
string
contents(int|null $offsetLines = null, int|null $limitLines = null)
Retrieves the contents of the file.
string
digest(bool|null $excludeMetadata = false)
Return the file's digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.
string
export(string $path, bool|null $allowParentDirPath = false)
Writes the file to a file path on the host.
id()
A unique identifier for this File.
string
name()
Retrieves the name of the file.
array
search(string $pattern, bool|null $literal = false, bool|null $multiline = false, bool|null $dotall = false, bool|null $insensitive = false, bool|null $skipIgnored = false, bool|null $skipHidden = false, bool|null $filesOnly = false, int|null $limit = null, array|null $paths = null, array|null $globs = null)
Searches for content matching the given regular expression or literal string.
int
size()
Retrieves the size of the file, in bytes.
stat()
Return file status
sync()
Force evaluation in the engine.
withName(string $name)
Retrieves this file with its name set to the given name.
withReplaced(string $search, string $replacement, bool|null $all = false, int|null $firstFrom = null)
Retrieves the file with content replaced with the given text.
withTimestamps(int $timestamp)
Retrieves this file with its created/modified timestamps set to the given time.
__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain) No description
| AbstractClient | $client | | | QueryBuilderChain | $queryBuilderChain | |
protected null|array|string|int|float|bool queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)No description
| QueryBuilder | $leafQueryBuilder | | | string | $leafKey | |
| null|array|string|int|float|bool | |
EnvFile asEnvFile(bool|null $expand = null)Parse as an env file
| bool|null | $expand | |
| EnvFile | |
JsonValue asJSON()Parse the file contents as JSON.
| JsonValue | |
File chown(string $owner)Change the owner of the file recursively.
| string | $owner | |
| File | |
string contents(int|null $offsetLines = null, int|null $limitLines = null)Retrieves the contents of the file.
| int|null | $offsetLines | | | int|null | $limitLines | |
| string | |
string digest(bool|null $excludeMetadata = false)Return the file's digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.
| bool|null | $excludeMetadata | |
| string | |
string export(string $path, bool|null $allowParentDirPath = false)Writes the file to a file path on the host.
| string | $path | | | bool|null | $allowParentDirPath | |
| string | |
AbstractId id()A unique identifier for this File.
| AbstractId | |
string name()Retrieves the name of the file.
| string | |
array search(string $pattern, bool|null $literal = false, bool|null $multiline = false, bool|null $dotall = false, bool|null $insensitive = false, bool|null $skipIgnored = false, bool|null $skipHidden = false, bool|null $filesOnly = false, int|null $limit = null, array|null $paths = null, array|null $globs = null)Searches for content matching the given regular expression or literal string.
Uses Rust regex syntax; escape literal ., [,], {, }, | with backslashes.
| string | $pattern | | | bool|null | $literal | | | bool|null | $multiline | | | bool|null | $dotall | | | bool|null | $insensitive | | | bool|null | $skipIgnored | | | bool|null | $skipHidden | | | bool|null | $filesOnly | | | int|null | $limit | | | array|null | $paths | | | array|null | $globs | |
| array | |
int size()Retrieves the size of the file, in bytes.
| int | |
Stat stat()Return file status
| Stat | |
FileId sync()Force evaluation in the engine.
| FileId | |
File withName(string $name)Retrieves this file with its name set to the given name.
| string | $name | |
| File | |
File withReplaced(string $search, string $replacement, bool|null $all = false, int|null $firstFrom = null)Retrieves the file with content replaced with the given text.
If 'all' is true, all occurrences of the pattern will be replaced.
If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
If neither are specified, and there are multiple matches for the pattern, this will error.
If there are no matches for the pattern, this will error.
| string | $search | | | string | $replacement | | | bool|null | $all | | | int|null | $firstFrom | |
| File | |
File withTimestamps(int $timestamp)Retrieves this file with its created/modified timestamps set to the given time.
| int | $timestamp | |
| File | |
Generated by Doctum, a API Documentation generator and fork of Sami.