{"id":18249913,"url":"https://github.com/phan/docker","last_synced_at":"2025-04-04T16:30:59.700Z","repository":{"id":66261053,"uuid":"276978406","full_name":"phan/docker","owner":"phan","description":"Dockerization of the Phan PHP static analysis tool","archived":false,"fork":false,"pushed_at":"2022-11-19T14:09:23.000Z","size":51,"stargazers_count":2,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"php8","last_synced_at":"2025-03-20T15:12:07.533Z","etag":null,"topics":["docker","phan","php","static-analysis"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phan.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-07-03T20:02:27.000Z","updated_at":"2023-01-29T01:11:49.000Z","dependencies_parsed_at":"2023-03-12T06:30:55.073Z","dependency_job_id":null,"html_url":"https://github.com/phan/docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phan%2Fdocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phan%2Fdocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phan%2Fdocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phan%2Fdocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phan","download_url":"https://codeload.github.com/phan/docker/tar.gz/refs/heads/php8","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247209279,"owners_count":20901742,"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":["docker","phan","php","static-analysis"],"created_at":"2024-11-05T09:41:50.957Z","updated_at":"2025-04-04T16:30:59.695Z","avatar_url":"https://github.com/phan.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phan/docker\n\nAn installation of PHP8 and [Phan][phan] in a super tiny [Alpine Linux][alpine]\nDocker image. The image is just 33 MB and runs interactively on the files\noutside your container, making it easy to statically analyze PHP code.\n\n[phan/docker](https://github.com/phan/docker) is a fork of [cloudflare/docker-phan](cloudflare-docker-phan)\n\n## Motivations\n\nPhan requires PHP7.2+ and specific PHP extensions to be installed.\nThese docker images use either php 8 or php 7.\n\nBy packaging Phan inside a Docker image, we can separate the runtime and\nconfiguration of the tool from your application’s environment and requirements.\n\n## Getting phan/docker\n\nThe easiest way to use `phan/docker` is to create a shell function for “phan”\nthat makes makes it nearly transparent that phan is running inside Docker.\n\n```sh\nphan() { docker run -v $PWD:/mnt/src --rm -u \"$(id -u):$(id -g)\" phanphp/phan:latest $@; return $?; }\n```\n\n(You may replace “latest” with a tagged Phan release such as `5` or `5.2` or `5.2.1` to use a specific version of Phan.)\n\n## Running phan/docker\n\u003e If you’re just getting started with Phan, you should follow Phan’s excellent\n[Tutorial for Analyzing A Large Sloppy Code Base][phan-tutorial] to setup the\ninitial configuration for your project.\n\nAll of Phan’s command line flags can be passed to `phan/docker`.\n\n## Example\n\nTo create an “analysis.txt” in the current directory for further processing\n\n``` sh\nphan -po analysis.txt\n```\n\nTo run phan on a project that already has a `.phan/config.php` set up (assuming no symlinks)\n\n```sh\ncd /path/to/project\n# short for: docker run -v $PWD:/mnt/src --rm -u \"$(id -u):$(id -g)\" phanphp/phan:latest\nphan\n```\n\n## Building\n\nDocker images are built with the `build` script based on the awesome building\nand testing framework put into place by the [`docker-alpine`][docker-alpine]\ncontributors. See [BUILD.md][build-docs] for more information.\n\n## Phan reports that classes from a PHP module are missing\n\n### Configuring Stubs\n\nThis aims to be a minimal docker image, and does not include many common PHP modules(extensions).\n\nSee https://github.com/phan/phan/wiki/How-To-Use-Stubs#internal-stubs for how to generate stubs from installed extensions and configure phan to use those stubs if the extension is not installed.\n\n### Extending phan/docker with extra PHP modules\n\nInstalling the PHP modules may give phan better type information than stubs in some cases.\n\nSee [`examples/installing_extensions`](https://github.com/phan/docker/tree/master/examples/installing_extensions) for how to do that.\n\n## License\n\n[BSD 2-Clause License][bsd-2-clause]\n\n[phan]: https://github.com/phan/phan\n[alpine]: http://www.alpinelinux.org/\n[phan-tutorial]: https://github.com/phan/phan/wiki/Tutorial-for-Analyzing-a-Large-Sloppy-Code-Base\n[docker-alpine]: https://github.com/gliderlabs/docker-alpine\n[build-docs]: BUILD.md\n[bsd-2-clause]: https://tldrlegal.com/license/bsd-2-clause-license-(freebsd)#summary\n[cloudflare-docker-phan]: https://github.com/cloudflare/docker-phan\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphan%2Fdocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphan%2Fdocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphan%2Fdocker/lists"}