{"id":37262720,"url":"https://github.com/php-runtime/google-cloud","last_synced_at":"2026-01-15T23:22:57.733Z","repository":{"id":62538270,"uuid":"361888377","full_name":"php-runtime/google-cloud","owner":"php-runtime","description":"[READ ONLY] Runtime for Google Cloud","archived":false,"fork":false,"pushed_at":"2025-12-18T07:37:27.000Z","size":31,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-21T15:39:58.891Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"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/php-runtime.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["nyholm"]}},"created_at":"2021-04-26T20:41:40.000Z","updated_at":"2025-12-18T07:35:00.000Z","dependencies_parsed_at":"2025-02-18T20:24:26.988Z","dependency_job_id":"676290ce-ab15-4c47-96a2-47e0532d8e2f","html_url":"https://github.com/php-runtime/google-cloud","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/php-runtime/google-cloud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-runtime%2Fgoogle-cloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-runtime%2Fgoogle-cloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-runtime%2Fgoogle-cloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-runtime%2Fgoogle-cloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-runtime","download_url":"https://codeload.github.com/php-runtime/google-cloud/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-runtime%2Fgoogle-cloud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2026-01-15T23:22:57.320Z","updated_at":"2026-01-15T23:22:57.727Z","avatar_url":"https://github.com/php-runtime.png","language":"PHP","readme":"# Google Cloud Runtime\n\nA runtime for [Google Cloud](https://cloud.google.com/).\n\nIf you are new to the Symfony Runtime component, see the \"The Long Story\" down below.\n\n## Installation\n\nThis runtime layer is special. It includes a `router.php` to enable the use of\nSymfony Runtime component. You need to install this package **and** the runtime you\nwant to use.\n\nTo use with native or Symfony application.\n\n```\ncomposer require runtime/google-cloud symfony/runtime\n```\n\nIf you want to use it with PSR-7.\n```\ncomposer require runtime/google-cloud runtime/psr-nyholm\n```\n\n## Usage\n\nDefine the environment variable `FUNCTION_SOURCE`.\n\n```\n# Default value\nFUNCTION_SOURCE=index.php\n```\n\nNote that Google Cloud **requires** you to have an index.php file. If you are running\nSymfony you probably want to define `FUNCTION_SOURCE=public/index.php` but you\nstill need to create an `index.php`.\n\n```php\n\u003c?php\n// index.php\n// This file is needed for google cloud\n```\n\n## Using CloudEvent\n\n```php\n// index.php\nuse Google\\CloudFunctions\\CloudEvent;\n\nrequire_once dirname(__DIR__).'/vendor/autoload_runtime.php';\n\nreturn function(CloudEvent $cloudevent) {\n    // Print the whole CloudEvent\n    $stdout = fopen('php://stdout', 'wb');\n    fwrite($stdout, $cloudevent);\n};\n```\n\n## Troubleshooting\n\n### Cache/Build Directory\n\nNote that Google Cloud will only deploy files that are not in `.gitignore`. You\nneed to remove the `var/` entry before deployment to be able to warm up the cache etc.\n\n### Define Symfony Environment\n\nDefine environment variable `APP_ENV=prod` to use Symfony production mode.\n\n```\ngcloud functions deploy helloHttp \\\n --runtime php74 \\\n --trigger-http \\\n --allow-unauthenticated \\\n --set-env-vars \"FUNCTION_SOURCE=public/index.php,APP_ENV=prod\"\n```\n\n## The Long Story\n\nThis section is for you who are new to Symfony Runtime component.\n\nSymfony Runtime component will be released with Symfony 5.3 in May 2021. Here is\nthe [official documentation](https://symfony.com/doc/5.3/components/runtime.html)\nthere is also a compressed version in the [main readme](https://github.com/php-runtime/runtime).\n\nEvery Symfony application from Symfony 5.3 will be created with this component as\ndefault. The component makes sure your application is decoupled from the global state.\nWhich means your application is very portable. With some config (or automatic mapping)\na `RuntimeInterface` is used as the \"glue\" between Nginx and your application.\n\nOf course, different `RuntimeInterface` \"glue\" between different things. One Runtime\nis for **Google Cloud**, one for **Bref/AWS**, one for **Swoole**, one for **RoadRunner**\netc. The point is that your application does not care what runtime it is. This means\nthat you can run your application locally with a normal web server (like Nginx) and\ndeploy it to Google Cloud with zero changes and still be sure everything works.\n\n### Google Cloud Runtime Specifically\n\nSince Google Cloud is very similar to a \"normal web server\", this runtime only\ncontains 2 things:\n1. `router.php` which is a requirement from Google Cloud. Its job is just to redirect\nthe request to the front controller. It is not used locally.\n2. Support for `CloudEvent`. If you write an application that expects a `Google\\CloudFunctions\\CloudEvent`\nthis runtime will automatically detect that and create such object for you.\n\nIt will support native PHP applications and Symfony HttpFoundation type applications\nout-of-the-box. To support PSR-7/PSR-15 or Laravel, one also need to install one additional\nruntime. See [main readme](https://github.com/php-runtime/runtime) for more information.\n","funding_links":["https://github.com/sponsors/nyholm"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-runtime%2Fgoogle-cloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-runtime%2Fgoogle-cloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-runtime%2Fgoogle-cloud/lists"}