PHPackages                             google/cloud-tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. google/cloud-tools

ActiveLibrary[Testing &amp; Quality](/categories/testing)

google/cloud-tools
==================

PHP tools for Google Cloud Platform

v0.16.1(10mo ago)24902.7k—4.1%20[12 PRs](https://github.com/GoogleCloudPlatform/php-tools/pulls)5Apache-2.0PHPPHP &gt;=8.0CI passing

Since May 13Pushed 2mo ago23 watchersCompare

[ Source](https://github.com/GoogleCloudPlatform/php-tools)[ Packagist](https://packagist.org/packages/google/cloud-tools)[ Docs](https://github.com/GoogleCloudPlatform/php-tools)[ RSS](/packages/google-cloud-tools/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (16)Versions (47)Used By (5)

Utilities for Google Cloud Platform
===================================

[](#utilities-for-google-cloud-platform)

Install
-------

[](#install)

Add `google/cloud-tools` to the `require-dev` section of your `composer.json`.

You can also run the following command:

```
$ composer require google/cloud-tools --dev

```

Utilities
---------

[](#utilities)

### flex\_exec

[](#flex_exec)

The cli script `src/Utils/Flex/flex_exec` is a tool for running a command with using the same Docker image as the application running on App Engine Flex.

It spins up a Docker image of a Deployed App Engine Flexible App, and runs a command in that image. For example, if you are running Laravel application, you can invoke a command like `php artisan migrate` in the image.

If the Flex application is requesting the cloudsql access (`beta_settings`, `cloud_sql_instances`), this tool also provides the connection to the same Cloud SQL instances.

The command runs on virtual machines provided by [Google Cloud Container Builder](https://cloud.google.com/container-builder/docs/), and has access to the credentials of the Cloud Container Builder service account.

### Prerequisites

[](#prerequisites)

To use flex\_exec, you will need:

- An app deployed to Google App Engine Flex
- The gcloud SDK installed and configured. See
- The `google/cloud-tools` composer package

You may also need to grant the Cloud Container Builder service account any permissions needed by your command. For accessing Cloud SQL, you need to add `Cloud SQL Client` permission to the service account.

You can find the service account configuration in the IAM tab in the Cloud Console under the name `[your-project-number]@cloudbuild.gserviceaccount.com`.

### Resource usage and billing

[](#resource-usage-and-billing)

The tool uses virtual machine resources provided by Google Cloud Container Builder. Although a certain number of usage minutes per day is covered under a free tier, additional compute usage beyond that time is billed to your Google Cloud account. For more details, see:

If your command makes API calls or utilizes other cloud resources, you may also be billed for that usage. However, `flex_exec` does not use actual App Engine instances, and you will not be billed for additional App Engine instance usage.

### Example

[](#example)

```
src/Utils/Flex/flex_exec run -- php artisan migrate

```

Testing Utilities
-----------------

[](#testing-utilities)

There are various test utilities in the `Google\Cloud\TestUtils` namespace.

Test examples
-------------

[](#test-examples)

The example test cases are available in [`test/fixtures/appengine-standard`](https://github.com/GoogleCloudPlatform/php-tools/tree/main/test/fixtures/appengine-standard) directory.

### Environment variables

[](#environment-variables)

There are multiple environment variables to control the behavior of our test traits.

#### All Traits

[](#all-traits)

- `GOOGLE_PROJECT_ID`: The project id for deploying the application.
- `GOOGLE_VERSION_ID`: The version id for deploying the application.

#### AppEngineDeploymentTrait

[](#appenginedeploymenttrait)

- `GOOGLE_DEPLOYMENT_DELAY`: Number of seconds to wait after the deployment has been triggered before continuing to execute tests.
- `GOOGLE_KEEP_DEPLOYMENT`: Set to `true` to keep deployed app in place after test completion.
- `GOOGLE_SKIP_DEPLOYMENT`: Set to `true` if you want to skip deployment.
- `RUN_DEPLOYMENT_TESTS`: Set to `true` if you want to run deploy tests.

#### DevAppserverTestTrait

[](#devappservertesttrait)

- `LOCAL_TEST_TARGETS`: You can specify multiple yaml files if your test need multiple services.
- `PHP_CGI_PATH`: Path to `php-cgi` for running dev\_appserver.
- `RUN_DEVSERVER_TESTS`: Set to `true` if you want to run tests.

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance71

Regular maintenance activity

Popularity50

Moderate usage in the ecosystem

Community32

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 81.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~101 days

Recently: every ~293 days

Total

34

Last Release

307d ago

PHP version history (2 changes)v0.1.0PHP &gt;=5.5

v0.14.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/a8713415b20b4be4cec8f8b22741e3cd05f76eee9e38de1de5bf32727349b7c5?d=identicon)[bshaffer](/maintainers/bshaffer)

![](https://www.gravatar.com/avatar/3901206952845568d7557a60855b097f6d1bafaa7a24020cfcf5bb8de74f9d28?d=identicon)[google-cloud](/maintainers/google-cloud)

---

Top Contributors

[![bshaffer](https://avatars.githubusercontent.com/u/103941?v=4)](https://github.com/bshaffer "bshaffer (88 commits)")[![grayside](https://avatars.githubusercontent.com/u/283489?v=4)](https://github.com/grayside "grayside (7 commits)")[![renovate-bot](https://avatars.githubusercontent.com/u/25180681?v=4)](https://github.com/renovate-bot "renovate-bot (4 commits)")[![pattishin](https://avatars.githubusercontent.com/u/1331216?v=4)](https://github.com/pattishin "pattishin (2 commits)")[![google-admin](https://avatars.githubusercontent.com/u/3605123?v=4)](https://github.com/google-admin "google-admin (1 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (1 commits)")[![jeromegamez](https://avatars.githubusercontent.com/u/67554?v=4)](https://github.com/jeromegamez "jeromegamez (1 commits)")[![sevealex](https://avatars.githubusercontent.com/u/5730767?v=4)](https://github.com/sevealex "sevealex (1 commits)")[![chingor13](https://avatars.githubusercontent.com/u/32483?v=4)](https://github.com/chingor13 "chingor13 (1 commits)")[![wallcrosstype](https://avatars.githubusercontent.com/u/11752118?v=4)](https://github.com/wallcrosstype "wallcrosstype (1 commits)")[![glasnt](https://avatars.githubusercontent.com/u/813732?v=4)](https://github.com/glasnt "glasnt (1 commits)")

---

Tags

testappenginegcp

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/google-cloud-tools/health.svg)

```
[![Health](https://phpackages.com/badges/google-cloud-tools/health.svg)](https://phpackages.com/packages/google-cloud-tools)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19562.3M1.3k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M343](/packages/drupal-core-recommended)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
