Skip to content

Instantly share code, notes, and snippets.

@dbu
Created August 3, 2016 09:03
Show Gist options
  • Save dbu/2c1d7b2b862979b5b3ccebda4969d6e7 to your computer and use it in GitHub Desktop.
Save dbu/2c1d7b2b862979b5b3ccebda4969d6e7 to your computer and use it in GitHub Desktop.
use League\Flysystem\Util;
public function read($path)
{
$path = Util::normalizePath($path);
if (! ($object = $this->flysystem->getAdapter()->read($path))) {
return false;
}
return $object['contents'];
}
public function write($path, $contents)
{
$path = Util::normalizePath($path);
return (bool) $this->flysystem->getAdapter()->write($path, $contents, $this->config);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment