mirror of
https://github.com/getgrav/grav.git
synced 2026-06-27 20:09:01 +02:00
Added FileInterface::touch() method
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
# v1.7.99-feature
|
||||
## mm/dd/2022
|
||||
|
||||
1. [](#new)
|
||||
* Added `FileInterface::touch()` method
|
||||
2. [](#improved)
|
||||
* By default, add media to only pages which have been initialized in pages loop
|
||||
|
||||
|
||||
@@ -341,6 +341,15 @@ class AbstractFile implements FileInterface
|
||||
return @unlink($this->filepath);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @see FileInterface::touch()
|
||||
*/
|
||||
public function touch(int $mtime = null): bool
|
||||
{
|
||||
return @touch($this->filepath, $mtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $dir
|
||||
* @return bool
|
||||
|
||||
@@ -177,4 +177,13 @@ interface FileInterface extends Serializable
|
||||
* @api
|
||||
*/
|
||||
public function delete(): bool;
|
||||
|
||||
/**
|
||||
* Touch file in the filesystem.
|
||||
*
|
||||
* @param int|null $mtime
|
||||
* @return bool Returns `true` if the file was successfully touched, `false` otherwise.
|
||||
* @api
|
||||
*/
|
||||
public function touch(int $mtime = null): bool;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user