{"id":28578291,"url":"https://github.com/digitalocean/sample-functions-php-helloworld","last_synced_at":"2025-06-11T01:09:29.819Z","repository":{"id":43860563,"uuid":"459338091","full_name":"digitalocean/sample-functions-php-helloworld","owner":"digitalocean","description":"A PHP helloworld sample function for Cloud Functions","archived":false,"fork":false,"pushed_at":"2023-11-18T12:20:31.000Z","size":5,"stargazers_count":17,"open_issues_count":2,"forks_count":26,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-01-15T00:20:04.569Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitalocean.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-14T21:55:53.000Z","updated_at":"2024-11-28T14:32:19.000Z","dependencies_parsed_at":"2022-08-12T10:50:38.297Z","dependency_job_id":null,"html_url":"https://github.com/digitalocean/sample-functions-php-helloworld","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fsample-functions-php-helloworld","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fsample-functions-php-helloworld/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fsample-functions-php-helloworld/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fsample-functions-php-helloworld/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitalocean","download_url":"https://codeload.github.com/digitalocean/sample-functions-php-helloworld/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fsample-functions-php-helloworld/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259178542,"owners_count":22817388,"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":[],"created_at":"2025-06-11T01:09:29.104Z","updated_at":"2025-06-11T01:09:29.811Z","avatar_url":"https://github.com/digitalocean.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sample Function: PHP \"Hello World\"\n\n## Introduction\n\nThis repository contains a sample \"Hello World\" function written in PHP. You can deploy it on DigitalOcean's App Platform as a Serverless Function component or as a standalone Function. Documentation is available at https://docs.digitalocean.com/products/functions.\n\n### Requirements\n\n* You need a DigitalOcean account. If you don't already have one, you can sign up at [https://cloud.digitalocean.com/registrations/new](https://cloud.digitalocean.com/registrations/new).\n* To deploy from the command line, you will need the [DigitalOcean `doctl` CLI](https://github.com/digitalocean/doctl/releases).\n\n## Deploying the Function\n\n```\n# clone this repo\ngit clone git@github.com:digitalocean/sample-functions-php-helloworld.git\n```\n\n```\n# deploy the project, using a remote build so that compiled executable matched runtime environment\ndoctl serverless deploy sample-functions-php-helloworld --remote-build\n```\n\nThe output from the deploy command will resemble the following.\n```\nDeploying 'sample-functions-php-helloworld'\n  to namespace 'fn-...'\n  on host '...'\nDeployment status recorded in 'sample-functions-php-helloworld/.deployed'\n\nDeployed functions ('doctl sls fn get \u003cfuncName\u003e --url' for URL):\n  - sample/hello\n```\n\n## Using the Function\n```\ndoctl serverless functions invoke sample/hello\n```\n\nThis will return the default response from the function.\n```\n{\n  \"body\": \"Hello stranger!\"\n}\n```\n\nYou can pass a parameter to your function using the `-p` command line argument.\n```\ndoctl serverless functions invoke sample/hello -p name:functions\n{\n  \"body\": \"Hello functions!\"\n}\n```\n\nUse this command to retrieve the URL for your function and use it as an API.\n```\ndoctl sls fn get sample/hello --url\n```\n\nYou can use that API directly in your browser, with `curl` or with an API platform such as Postman.\nParameters may be passed as query parameters, or as JSON body. Here are some examples using `curl`.\n\n```\ncurl `doctl sls fn get sample/hello --url`?name=query\n```\n\n```\ncurl -H 'Content-Type: application/json' -d '{\"name\":\"body\"}' `doctl sls fn get sample/hello --url`\n```\n\n### Learn More\n\nYou can learn more about Functions by reading the [Functions Documentation](https://docs.digitalocean.com/products/functions). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalocean%2Fsample-functions-php-helloworld","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalocean%2Fsample-functions-php-helloworld","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalocean%2Fsample-functions-php-helloworld/lists"}