Skip to content

Commit

Permalink
Replace function
Browse files Browse the repository at this point in the history
  • Loading branch information
snewer committed Jan 25, 2020
1 parent e068b9b commit d9950b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/AbstractBucket.php
Expand Up @@ -58,6 +58,15 @@ abstract public function getSource($path);
*/
abstract public function delete($path);

/**
* Замена содержимого файла.
*
* @param $path
* @param $binary
* @return boolean
*/
abstract public function replace($path, $binary);

/**
* Равномерно и однозначно извлекает один из $baseUrls по переданному $path.
* @param array|string $baseUrls - массив
Expand Down
7 changes: 7 additions & 0 deletions src/drivers/FileSystemDriver.php
Expand Up @@ -111,4 +111,11 @@ public function delete($path)
return @unlink($filePath);
}

/**
* @inheritdoc
*/
public function replace($path, $binary)
{
return file_put_contents($this->basePath . $path, $binary);
}
}

0 comments on commit d9950b7

Please sign in to comment.