Google Cloud Storage for PHP

Overview

Google Cloud Storage for PHP

Idiomatic PHP client for Cloud Storage.

Latest Stable Version Packagist

NOTE: This repository is part of Google Cloud PHP. Any support requests, bug reports, or development contributions should be directed to that project.

Allows world-wide storage and retrieval of any amount of data at any time. You can use Cloud Storage for a range of scenarios including serving website content, storing data for archival and disaster recovery, or distributing large data objects to users via direct download.

Installation

To begin, install the preferred dependency manager for PHP, Composer.

Now to install just this component:

$ composer require google/cloud-storage

Or to install the entire suite of components at once:

$ composer require google/cloud

Authentication

Please see our Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests.

Sample

require 'vendor/autoload.php';

use Google\Cloud\Storage\StorageClient;

$storage = new StorageClient();

$bucket = $storage->bucket('my_bucket');

// Upload a file to the bucket.
$bucket->upload(
    fopen('/data/file.txt', 'r')
);

// Using Predefined ACLs to manage object permissions, you may
// upload a file and give read access to anyone with the URL.
$bucket->upload(
    fopen('/data/file.txt', 'r'),
    [
        'predefinedAcl' => 'publicRead'
    ]
);

// Download and store an object from the bucket locally.
$object = $bucket->object('file_backup.txt');
$object->downloadToFile('/data/file_backup.txt');

Stream Wrapper

require 'vendor/autoload.php';

use Google\Cloud\Storage\StorageClient;

$storage = new StorageClient();
$storage->registerStreamWrapper();

$contents = file_get_contents('gs://my_bucket/file_backup.txt');

Version

This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority.

Next Steps

  1. Understand the official documentation.
  2. Take a look at in-depth usage samples.
You might also like...
Upload attachments to content storage platform like Aliyun OSS, Tencent COS

Overview Yun storage provides a layer that mediates between a user or configured storage frontend and one or several storage backends. Note: jichangfe

A Qiniu Storage filesystem for Laravel

Laravel filesystem Qiniu Qiniu storage for Laravel based on overtrue/flysystem-qiniu. Requirement PHP = 5.5.9 Installation $ composer require "overtr

High-performance, low-memory-footprint, single-file embedded database for key/value storage

LDBA - a fast, pure PHP, key-value database. Information LDBA is a high-performance, low-memory-footprint, single-file embedded database for key/value

This Repo is a storage of Postman collections for Magento

Magento Postman repository This Repository is a storage of Postman collections for Magento. If you have what to share, you are welcome to contribute a

File uploads with validation and storage strategies

Upload This component simplifies file validation and uploading. Usage Assume a file is uploaded with this HTML form: form method="POST" enctype="mult

File Storage Api

flux-file-storage-api File Storage Api Installation Native Download RUN (mkdir -p /%path%/libs/flux-file-storage-api && cd /%path%/libs/flux-file-stor

Like Cloud Drive Run on Raspbian + Nginx + PHP

Raspberry-Pi-Cloud Like Cloud Drive Run on Raspbian + Nginx + PHP I Made a Project Called Raspberry-Pi-Cloud. it's on testing stage help me to test it

Opensource php wrapper to WhatsApp Cloud API.

WhatsApp Latest Cloud API Wrapper for PHP Opensource php wrapper to WhatsApp Cloud API. Features supported Sending messages Sending Media (images, aud

Idiomatic PHP client for Cloud Firestore.

Cloud Firestore for PHP Idiomatic PHP client for Cloud Firestore. API documentation NOTE: This repository is part of Google Cloud PHP. Any support req

Comments
  • Configure Renovate

    Configure Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    :vertical_traffic_light: To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • composer.json (composer)

    Configuration Summary

    Based on the default config's presets, Renovate will:

    • Start dependency updates only once this Configure Renovate PR is merged
    • Separate major versions of dependencies into individual branches/PRs
    • Do not separate patch and minor upgrades into separate PRs for the same dependency
    • Upgrade to unstable versions only if the existing version is unstable
    • Raise PRs immediately (after branch is created)
    • Use renovate/ as prefix for all branch names
    • If semantic commits detected, use semantic commit type fix for dependencies and chore for all others
    • Keep existing branches updated even when not scheduled
    • Disable automerging feature - wait for humans to merge all PRs
    • Ignore node_modules, bower_components, vendor and various test/tests directories
    • Update existing lock files only when package.json is modified
    • Autodetect whether to pin dependencies or maintain ranges
    • Rate limit PR creation to a maximum of two per hour
    • Limit to maximum 20 open PRs at any time
    • Group known monorepo packages together
    • Use curated list of recommended non-monorepo package groupings

    :abcd: Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


    What to Expect

    With your current configuration, Renovate will create 2 Pull Requests:

    chore(deps): pin dependencies
    chore(deps): update dependency squizlabs/php_codesniffer to v3

    :question: Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Renovate Bot. View repository job log here.

    cla: yes 
    opened by renovate-bot 1
Releases(v1.30.1)
Owner
Google APIs
Clients for Google APIs and tools that help produce them.
Google APIs
A collection of samples that demonstrate how to call Google Cloud services from PHP.

PHP Docs Samples A collection of samples that demonstrate how to call Google Cloud services from PHP. See our other Google Cloud Platform github repos

Google Cloud Platform 875 Dec 29, 2022
A collection of samples that demonstrate how to call Google Cloud services from PHP.

PHP Docs Samples A collection of samples that demonstrate how to call Google Cloud services from PHP. See our other Google Cloud Platform github repos

Google Cloud Platform 796 Dec 22, 2021
Google Cloud Orchestration Airflow for PHP

Google Cloud Orchestration Airflow for PHP Idiomatic PHP client for Google Cloud Orchestration Airflow. API documentation NOTE: This repository is par

Google APIs 1 Apr 28, 2022
Google Cloud Optimization for PHP

Google Cloud Optimization for PHP Idiomatic PHP client for Google Cloud Optimization. API documentation NOTE: This repository is part of Google Cloud

Google APIs 0 Sep 2, 2022
Google Cloud Essential Contacts for PHP

Google Cloud Essential Contacts for PHP Idiomatic PHP client for Google Cloud Essential Contacts. API documentation NOTE: This repository is part of G

Google APIs 1 Apr 28, 2022
Google Cloud Eventarc Publishing for PHP

Google Cloud Eventarc Publishing for PHP Idiomatic PHP client for Google Cloud Eventarc Publishing. API documentation NOTE: This repository is part of

Google APIs 0 Apr 28, 2022
Google Cloud Database Migration Service for PHP

Google Cloud Database Migration Service for PHP Idiomatic PHP client for Google Cloud Database Migration Service. API documentation NOTE: This reposit

Google APIs 1 Apr 30, 2022
Microsoft Azure Storage Library for PHP

Microsoft Azure Storage PHP Client Libraries This project will be in Community Support and Azure Storage team commits to validate and release every qu

Microsoft Azure 201 Nov 30, 2022
A simple mailable trait and interface to export mails to a storage disk once being sent.

Laravel Mail Export This package can export any mail sent with Laravel's Mailable class to any desired filesystem disk and path as a .eml file. This c

Pod Point 80 Nov 6, 2022
Greyhole uses Samba to create a storage pool of all your available hard drives, and allows you to create redundant copies of the files you store.

Greyhole Greyhole is an application that uses Samba to create a storage pool of all your available hard drives (whatever their size, however they're c

Guillaume Boudreau 245 Dec 18, 2022