We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was testing with google cloud storage and seems that content is uploaded twice using StreamWrapper.
The test:
<?php use Gaufrette\Adapter\GoogleCloudStorage; use Gaufrette\Filesystem; use Gaufrette\StreamWrapper; require_once(__DIR__ . '/../vendor/autoload.php'); const AUTH_FILE = './google-cloud.json'; const BUCKET_NAME = 'testing'; const LOCAL_FILE = __DIR__.'/test.txt'; // Create filesystem $googleClient = new \Google_Client(); $googleClient->setAuthConfig(AUTH_FILE); $googleClient->addScope(\Google_Service_Storage::DEVSTORAGE_FULL_CONTROL); $service = new \Google_Service_Storage($googleClient); $adapter = new class($service, BUCKET_NAME) extends GoogleCloudStorage { public function write($key, $content) { echo 'write strlen ' . strlen($content) . PHP_EOL; return parent::write($key, $content); } }; $filesystem = new Filesystem($adapter); // Register wrapper $map = StreamWrapper::getFilesystemMap(); $map->set(BUCKET_NAME, $filesystem); StreamWrapper::register(); // Upload file copy(LOCAL_FILE, 'gaufrette://' . BUCKET_NAME . '/test.txt');
The output is:
jnunez@xxx:~$ php ./test.php write strlen 0 write strlen 5 write strlen 5
Changing
copy(LOCAL_FILE, 'gaufrette://' . BUCKET_NAME . '/test.txt');
by
$filesystem->write('/test.txt', file_get_contents(LOCAL_FILE));
jnunez@xxx:~$ php ./test.php write strlen 5
Is there a bug?
The text was updated successfully, but these errors were encountered:
PedroTroller
No branches or pull requests
I was testing with google cloud storage and seems that content is uploaded twice using StreamWrapper.
The test:
The output is:
jnunez@xxx:~$ php ./test.php write strlen 0 write strlen 5 write strlen 5
Changing
by
The output is:
jnunez@xxx:~$ php ./test.php write strlen 5
Is there a bug?
The text was updated successfully, but these errors were encountered: