{"id":28425080,"url":"https://github.com/swoole/library","last_synced_at":"2025-06-28T04:31:13.029Z","repository":{"id":38106635,"uuid":"223883866","full_name":"swoole/library","owner":"swoole","description":"📚 Swoole Library","archived":false,"fork":false,"pushed_at":"2025-05-03T23:17:00.000Z","size":800,"stargazers_count":246,"open_issues_count":3,"forks_count":57,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-06-05T10:48:57.665Z","etag":null,"topics":["library","php","standard-library","swoole"],"latest_commit_sha":null,"homepage":"https://wiki.swoole.com/#/library","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/swoole.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2019-11-25T07:09:14.000Z","updated_at":"2025-05-19T05:08:55.000Z","dependencies_parsed_at":"2023-12-15T07:27:56.388Z","dependency_job_id":"83dd6959-27a5-4dbc-9f40-ff52e850bdc5","html_url":"https://github.com/swoole/library","commit_stats":{"total_commits":410,"total_committers":23,"mean_commits":17.82608695652174,"dds":0.6560975609756098,"last_synced_commit":"eaf6a43f2fdd403e7d4968fd6f4bd0d1b05e48c3"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/swoole/library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swoole%2Flibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swoole%2Flibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swoole%2Flibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swoole%2Flibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swoole","download_url":"https://codeload.github.com/swoole/library/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swoole%2Flibrary/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262375592,"owners_count":23301312,"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":["library","php","standard-library","swoole"],"created_at":"2025-06-05T10:31:17.266Z","updated_at":"2025-06-28T04:31:13.014Z","avatar_url":"https://github.com/swoole.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swoole Library\n\n[![Twitter](https://badgen.net/badge/icon/twitter?icon=twitter\u0026label)](https://twitter.com/phpswoole)\n[![Discord](https://badgen.net/badge/icon/discord?icon=discord\u0026label)](https://discord.swoole.dev)\n[![Library Status](https://github.com/swoole/library/workflows/Unit%20Tests/badge.svg)](https://github.com/swoole/library/actions)\n[![License](https://img.shields.io/badge/license-apache2-blue.svg)](LICENSE)\n\n## Dockerized Local Development\n\nFirst, run one of the following commands to install development packages using _Composer_:\n\n```bash\ndocker run --rm -v \"$(pwd)\":/var/www -ti phpswoole/swoole composer update -n\n\n# or, use the official Composer Docker image:\ndocker run --rm -v \"$(pwd)\":/app -ti composer update -n --ignore-platform-reqs\n\n# or, use the local Composer if installed:\ncomposer update -n --ignore-platform-reqs\n```\n\nNext, you need to start Docker containers:\n\n```bash\ndocker compose up -d\n```\n\nAlternatively, if you need to rebuild some Docker image and to restart the containers:\n\n```bash\ndocker compose build --progress plain --no-cache\ndocker compose up -d --force-recreate\n```\n\nNow you can create a `bash` session in the `app` container:\n\n```bash\ndocker compose exec app bash\n```\n\nAnd run commands inside the container:\n\n```bash\ncomposer test\n```\n\nOr you can run commands directly inside the `app` container:\n\n```bash\ndocker compose exec app composer test\n```\n\n## Examples\n\nOnce you have Docker containers started (as discussed in previous section), you can use commands like following to run\nexamples under folder [examples](https://github.com/swoole/library/tree/master/examples).\n\n### Examples of Database Connection Pool\n\n```bash\ndocker compose exec app php examples/mysqli/base.php\ndocker compose exec app php examples/pdo/base.php\ndocker compose exec app php examples/redis/base.php\n```\n\n### Examples of FastCGI Calls\n\nThere is a fantastic example showing how to use Swoole as a proxy to serve a WordPress website using PHP-FPM. Just\nopen URL _http://\u003cspan\u003e\u003c/span\u003e127.0.0.1_ in the browser and check what you see there. Source code of the example can be\nfound [here](https://github.com/swoole/library/blob/master/examples/fastcgi/proxy/wordpress.php).\n\nHere are some more examples to make FastCGI calls to PHP-FPM:\n\n```bash\ndocker compose exec app php examples/fastcgi/greeter/call.php\ndocker compose exec app php examples/fastcgi/greeter/client.php\ndocker compose exec app php examples/fastcgi/proxy/base.php\ndocker compose exec app php examples/fastcgi/var/client.php\n```\n\n## Third Party Libraries\n\nHere are all the third party libraries used in this project:\n\n* The FastCGI part is derived from Composer package [lisachenko/protocol-fcgi](https://github.com/lisachenko/protocol-fcgi).\n\nYou can find the licensing information of these third party libraries [here](https://github.com/swoole/library/blob/master/THIRD-PARTY-NOTICES).\n\n## License\n\nThis project follows the [Apache 2 license](https://github.com/swoole/library/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswoole%2Flibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswoole%2Flibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswoole%2Flibrary/lists"}