{"id":13721326,"url":"https://googleapis.github.io/google-cloud-php/","last_synced_at":"2025-05-07T13:32:28.261Z","repository":{"id":37493339,"uuid":"43642389","full_name":"googleapis/google-cloud-php","owner":"googleapis","description":"Google Cloud Client Library for PHP","archived":false,"fork":false,"pushed_at":"2025-04-30T23:14:48.000Z","size":645171,"stargazers_count":1122,"open_issues_count":103,"forks_count":445,"subscribers_count":134,"default_branch":"main","last_synced_at":"2025-04-30T23:32:03.973Z","etag":null,"topics":["google-cloud-platform","php"],"latest_commit_sha":null,"homepage":"https://cloud.google.com/php/docs/reference","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googleapis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":"Support/.OwlBot.yaml","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-10-04T16:09:46.000Z","updated_at":"2025-04-30T22:58:55.000Z","dependencies_parsed_at":"2022-07-09T09:46:15.258Z","dependency_job_id":"795de72e-df95-4993-b55b-64e05834b20d","html_url":"https://github.com/googleapis/google-cloud-php","commit_stats":{"total_commits":3714,"total_committers":127,"mean_commits":"29.244094488188978","dds":0.711900915455035,"last_synced_commit":"ae81a0b27a9a6f6fc919d98417b923709152ef2c"},"previous_names":[],"tags_count":322,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgoogle-cloud-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgoogle-cloud-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgoogle-cloud-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgoogle-cloud-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googleapis","download_url":"https://codeload.github.com/googleapis/google-cloud-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252109158,"owners_count":21696211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["google-cloud-platform","php"],"created_at":"2024-08-03T01:01:15.567Z","updated_at":"2025-05-07T13:32:23.252Z","avatar_url":"https://github.com/googleapis.png","language":"PHP","funding_links":[],"categories":["Libraries and ORM"],"sub_categories":["Client Libraries"],"readme":"# Google Cloud PHP Client\n\u003e Idiomatic PHP client for [Google Cloud Platform](https://cloud.google.com/) services.\n\n## CI Status\n\nPHP Version  | Status\n------------ | ------\n[![Latest Stable Version](https://poser.pugx.org/google/cloud/v/stable)](https://packagist.org/packages/google/cloud) [![Packagist](https://img.shields.io/packagist/dm/google/cloud.svg)](https://packagist.org/packages/google/cloud) | [![Kokoro CI](https://storage.googleapis.com/cloud-devrel-public/php/badges/google-cloud-php/php74.svg)](https://storage.googleapis.com/cloud-devrel-public/php/badges/google-cloud-php/php74.html)\n\n\n\nView the [list of supported APIs and Services](https://cloud.google.com/php/docs/reference).\n\nIf you need support for other Google APIs, please check out the [Google APIs Client Library for PHP](https://github.com/google/google-api-php-client).\n\n## Quick Start\n\nWe recommend installing individual component packages. A list of available packages can be found on [Packagist](https://packagist.org/search/?q=google%2Fcloud-).\n\nFor example:\n\n```sh\n$ composer require google/cloud-storage\n$ composer require google/cloud-bigquery\n$ composer require google/cloud-datastore\n```\n\nYou can then include the autoloader and create your client:\n\n```php\nrequire 'vendor/autoload.php';\n\nuse Google\\Cloud\\Storage\\StorageClient;\n\n$storage = new StorageClient();\n\n$bucket = $storage-\u003ebucket('my_bucket');\n\n// Upload a file to the bucket.\n$bucket-\u003eupload(\n    fopen('/data/file.txt', 'r')\n);\n\n// Download and store an object from the bucket locally.\n$object = $bucket-\u003eobject('file_backup.txt');\n$object-\u003edownloadToFile('/data/file_backup.txt');\n```\n\n### Authentication\n\nAuthentication is handled by the client library automatically. You just need to provide the authentication details when creating a client. Generally, authentication is accomplished using a Service Account. For more information on obtaining Service Account credentials, see our [Authentication Guide](https://cloud.google.com/docs/authentication/production#manually).\n\nOnce you've obtained your credentials file, it may be used to create an authenticated client.\n\n```php\nrequire 'vendor/autoload.php';\n\nuse Google\\Cloud\\Storage\\StorageClient;\n\n// Authenticate using a keyfile path\n$cloud = new StorageClient([\n    'keyFilePath' =\u003e 'path/to/keyfile.json'\n]);\n\n// Authenticate using keyfile data\n$cloud = new StorageClient([\n    'keyFile' =\u003e json_decode(file_get_contents('/path/to/keyfile.json'), true)\n]);\n```\n\nIf you do not wish to embed your authentication information in your application code, you may also make use of [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials).\n\n```php\nrequire 'vendor/autoload.php';\n\nuse Google\\Cloud\\Storage\\StorageClient;\n\nputenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/keyfile.json');\n\n$cloud = new StorageClient();\n```\n\nThe `GOOGLE_APPLICATION_CREDENTIALS` environment variable may be set in your server configuration.\n\n### gRPC and Protobuf\n\nMany clients in Google Cloud PHP offer support for gRPC, either as an option or a requirement. gRPC is a high-performance RPC framework created by Google. To use gRPC in PHP, you must install the gRPC PHP extension on your server. While not required, it is also recommended that you install the protobuf extension whenever using gRPC in production.\n\n```\n$ pecl install grpc\n$ pecl install protobuf\n```\n\n* [gRPC Installation Instructions](https://cloud.google.com/php/grpc)\n* [Protobuf Installation Instructions](https://cloud.google.com/php/grpc#installing_the_protobuf_runtime_library)\n\n## Caching Access Tokens\n\nBy default the library will use a simple in-memory caching implementation, however it is possible to override this behavior by passing a [PSR-6](http://www.php-fig.org/psr/psr-6/) caching implementation in to the desired client.\n\nThe following example takes advantage of [Symfony's Cache Component](https://github.com/symfony/cache).\n\n```php\nrequire 'vendor/autoload.php';\n\nuse Google\\Cloud\\Storage\\StorageClient;\nuse Symfony\\Component\\Cache\\Adapter\\ArrayAdapter;\n\n// Please take the proper precautions when storing your access tokens in a cache no matter the implementation.\n$cache = new ArrayAdapter();\n\n$storage = new StorageClient([\n    'authCache' =\u003e $cache\n]);\n```\n\nThis library provides a PSR-6 implementation with the SystemV shared memory at `Google\\Auth\\Cache\\SysVCacheItemPool`. This implementation is only available on *nix machines, but it's the one of the fastest implementations and you can share the cache among multiple processes. The following example shows how to use it.\n\n```php\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse Google\\Cloud\\Spanner\\SpannerClient;\nuse Google\\Auth\\Cache\\SysVCacheItemPool;\n\n$cache = new SysVCacheItemPool();\n\n$spanner = new SpannerClient([\n    'authCache' =\u003e $cache\n]);\n```\n\n## PHP Versions Supported\n\nAll client libraries support PHP 8.0 and above.\n\n## Versioning\n\nThis library follows [Semantic Versioning](http://semver.org/).\n\nPlease note it is currently under active development. Any release versioned\n0.x.y is subject to backwards incompatible changes at any time.\n\n**GA**: Libraries defined at a GA quality level are stable, and will not\nintroduce backwards-incompatible changes in any minor or patch releases. We will\naddress issues and requests with the highest priority. Please note, for any\ncomponents which include generated clients the GA guarantee will only apply to\nclients which interact with stable services. For example, in a component which\nhosts V1 and V1beta1 generated clients, the GA guarantee will only apply to the\nV1 client as the service it interacts with is considered stable.\n\n**Beta**: Libraries defined at a Beta quality level are expected to be mostly\nstable and we're working towards their release candidate. We will address issues\nand requests with a higher priority.\n\n## Contributing\n\nContributions to this library are always welcome and highly encouraged.\n\nSee [CONTRIBUTING](CONTRIBUTING.md) for more information on how to get started.\n\nThis repository is not an official support channel. If you have support questions,\nfile a support request through the normal Google support channels,\nor post questions on a forum such as [StackOverflow](http://stackoverflow.com/questions/tagged/google-cloud-platform+php).\n\n## License\n\nApache 2.0 - See [LICENSE](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/googleapis.github.io%2Fgoogle-cloud-php%2F","html_url":"https://awesome.ecosyste.ms/projects/googleapis.github.io%2Fgoogle-cloud-php%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/googleapis.github.io%2Fgoogle-cloud-php%2F/lists"}