Blobs can be used to store binary data in Google Cloud Datastore. Example: use Google\Cloud\ServiceBuilder; $cloud = new ServiceBuilder(); $datastore = $cloud->datastore(); $blob = $datastore->blob(file_get_contents(__DIR__ .'/family-photo.jpg')); Get the value of a blob by casting to a string. echo (string) $blob;
Пример #1
0
 public function testToString()
 {
     $blob = new Blob('hello world');
     $this->assertEquals((string) $blob->get(), (string) $blob);
 }