/home/techb158/ileadtechnology.com/vendor/spatie/laravel-backup/src/Tasks/Backup
Edit: /home/techb158/ileadtechnology.com/vendor/spatie/laravel-backup/src/Tasks/Backup/Manifest.php (1453B)
manifestPath = $manifestPath;
touch($manifestPath);
}
public function path(): string
{
return $this->manifestPath;
}
/**
* @param array|string $filePaths
*
* @return $this
*/
public function addFiles($filePaths): self
{
if (is_string($filePaths)) {
$filePaths = [$filePaths];
}
foreach ($filePaths as $filePath) {
if (! empty($filePath)) {
file_put_contents($this->manifestPath, $filePath.PHP_EOL, FILE_APPEND);
}
}
return $this;
}
/**
* @return \Generator|string[]
*/
public function files()
{
$file = new SplFileObject($this->path());
while (! $file->eof()) {
$filePath = $file->fgets();
if (! empty($filePath)) {
yield trim($filePath);
}
}
}
public function count(): int
{
$file = new SplFileObject($this->manifestPath, 'r');
$file->seek(PHP_INT_MAX);
return $file->key();
}
}