{"id":30885770,"url":"https://github.com/techdyn/google-storage-meta-bucket","last_synced_at":"2026-04-11T16:43:29.599Z","repository":{"id":57066068,"uuid":"274800841","full_name":"techdyn/google-storage-meta-bucket","owner":"techdyn","description":"A simple GCP storage bucket wrapper to automatically set metadata on uploaded files.","archived":false,"fork":false,"pushed_at":"2020-06-25T02:21:16.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-08T12:40:56.279Z","etag":null,"topics":["cloud","flysystem","gcp","gcp-storage","gcp-storage-bucket","google","liipimaginebundle","php","symfony","vichuploaderbundle"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techdyn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-25T00:59:42.000Z","updated_at":"2020-06-25T02:18:25.000Z","dependencies_parsed_at":"2022-08-24T07:50:18.642Z","dependency_job_id":null,"html_url":"https://github.com/techdyn/google-storage-meta-bucket","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/techdyn/google-storage-meta-bucket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techdyn%2Fgoogle-storage-meta-bucket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techdyn%2Fgoogle-storage-meta-bucket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techdyn%2Fgoogle-storage-meta-bucket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techdyn%2Fgoogle-storage-meta-bucket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techdyn","download_url":"https://codeload.github.com/techdyn/google-storage-meta-bucket/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techdyn%2Fgoogle-storage-meta-bucket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31687881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","flysystem","gcp","gcp-storage","gcp-storage-bucket","google","liipimaginebundle","php","symfony","vichuploaderbundle"],"created_at":"2025-09-08T12:08:50.978Z","updated_at":"2026-04-11T16:43:29.581Z","avatar_url":"https://github.com/techdyn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Cloud Storage Meta Bucket for PHP\nA simple GCP storage bucket wrapper to automatically set metadata on uploaded files.\n\nMetadata reference: https://cloud.google.com/storage/docs/metadata\n\nCreated for use with other libraries that may not allow you to configure the metadata (eg Cache-Control) for storage bucket objects.\n\nWorks with:\n- https://github.com/1up-lab/OneupFlysystemBundle\n- https://github.com/dustin10/VichUploaderBundle (using Flysystem)\n- https://github.com/liip/LiipImagineBundle (using Flysystem)\n\n### Installation\n\nRequires: https://github.com/googleapis/google-cloud-php-storage\n\nTo begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/).\n\nInstall the wrapper:\n\n```sh\n$ composer require techdyn/google-storage-meta-bucket\n```\n\n### Sample\n\n```php\nrequire 'vendor/autoload.php';\n\nuse TechDyn\\GoogleStorageMetaBucket\\Storage\\ProxyStorageClient;\n\n$storage = new ProxyStorageClient(); // ProxyStorageClient extends Google\\Cloud\\Storage\\StorageClient;\n\n$bucket = $storage-\u003ebucket('my_bucket'); // MetaBucket extends Google\\Cloud\\Storage\\Bucket\n\n// https://cloud.google.com/storage/docs/metadata\n$bucket-\u003esetOption('cacheControl', 'no-cache, max-age=60'); // $name uses metadata field written as camelCase\n\n// Upload a file to the bucket.\n$bucket-\u003eupload(\n    fopen('/data/file.txt', 'r')\n);\n```\n\n### Symfony \u0026 Flysystem\n\n```yaml\n# services.yaml\n\nparameters:\n\n    gcp_client_options:\n        projectId: 'gcp-project-id'\n        keyFilePath: '%kernel.project_dir%/config/gcp/service.json' # Optional - if not configured externally\n\n    gcp_storage_bucket: 'name-of-bucket'\n\nservices:\n  \n  google_cloud_storage.client:\n    class: TechDyn\\GoogleStorageMetaBucket\\Storage\\ProxyStorageClient\n    arguments: ['%gcp_client_options%']\n\n  google_cloud_storage.bucket:\n    class: TechDyn\\GoogleStorageMetaBucket\\Storage\\MetaBucket\n    factory: ['@google_cloud_storage.client', bucket]\n    arguments: ['%gcp_storage_bucket%']\n    calls:\n      - method: setOption\n        arguments:\n          - 'cacheControl'\n          - 'no-cache, max-age=60'\n```\n\n##### Flysystem\n\nUsing: https://github.com/1up-lab/OneupFlysystemBundle\n\n```yaml\n# packages/oneup_flysystem.yaml\n\n# Read the documentation: https://github.com/1up-lab/OneupFlysystemBundle/tree/master/Resources/doc/index.md\noneup_flysystem:\n    adapters:\n        gcp_storage_adapter:\n            googlecloudstorage:\n                client: google_cloud_storage.client\n                bucket: google_cloud_storage.bucket\n                prefix: ~\n\n    filesystems:\n        gcp_storage_fs:\n            adapter: gcp_storage_adapter\n            mount:   gcp_storage_fs\n```\n\n##### Vich Uploader\n\nUsing: https://github.com/dustin10/VichUploaderBundle\n\n```yaml\n# packages/vich_uploader.yaml\n\nvich_uploader:\n    db_driver: orm\n    storage: flysystem\n    mappings:\n        uploaded_images:\n            uri_prefix:         'https://%gcp_storage_bucket%.storage.googleapis.com' # https://name-of-bucket.storage.googleapis.com or your custom domain\n            upload_destination: gcp_storage_fs\n            namer:              vich_uploader.namer_uniqid\n            inject_on_load:     false\n            delete_on_update:   true\n            delete_on_remove:   true\n```\n\n##### Liip Imagine\n\nUsing: https://github.com/liip/LiipImagineBundle\n\n```yaml\n# packages/liip_imagine.yaml\n\n# See dos how to configure the bundle: https://symfony.com/doc/current/bundles/LiipImagineBundle/basic-usage.html\nliip_imagine:\n  driver: \"gd\" # valid drivers options include \"gd\" or \"gmagick\" or \"imagick\"\n\n  loaders:\n    gcp_loader:\n      flysystem:\n        filesystem_service: oneup_flysystem.gcp_storage_fs_filesystem\n\n  data_loader: gcp_loader\n  resolvers:\n    gcp_cache:\n      flysystem:\n        root_url: 'https://%gcp_storage_bucket%.storage.googleapis.com'\n        filesystem_service: oneup_flysystem.gcp_storage_fs_filesystem\n\n  filter_sets:\n    thumb_default:\n      data_loader: gcp_loader\n      cache: gcp_cache\n      quality: 75\n      filters:\n        downscale: { max: [64, 64], mode: outbound }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechdyn%2Fgoogle-storage-meta-bucket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechdyn%2Fgoogle-storage-meta-bucket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechdyn%2Fgoogle-storage-meta-bucket/lists"}