{"id":18032697,"url":"https://github.com/sanderdlm/chop","last_synced_at":"2025-12-12T19:58:21.324Z","repository":{"id":65192308,"uuid":"587022920","full_name":"sanderdlm/chop","owner":"sanderdlm","description":"Reset the OPcache content from the CLI, without reloading PHP-FPM","archived":false,"fork":false,"pushed_at":"2025-10-22T08:23:57.000Z","size":34,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-22T10:21:40.728Z","etag":null,"topics":["cachetool","opcache","php","php-fpm"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"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/sanderdlm.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-09T19:29:03.000Z","updated_at":"2025-10-22T08:23:08.000Z","dependencies_parsed_at":"2024-04-11T09:43:06.361Z","dependency_job_id":"e3d59dbf-9aa0-4bef-8fa2-31d4ef527b0a","html_url":"https://github.com/sanderdlm/chop","commit_stats":null,"previous_names":["dreadnip/chop"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/sanderdlm/chop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanderdlm%2Fchop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanderdlm%2Fchop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanderdlm%2Fchop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanderdlm%2Fchop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanderdlm","download_url":"https://codeload.github.com/sanderdlm/chop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanderdlm%2Fchop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27690384,"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","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cachetool","opcache","php","php-fpm"],"created_at":"2024-10-30T10:15:32.008Z","updated_at":"2025-12-12T19:58:21.316Z","avatar_url":"https://github.com/sanderdlm.png","language":"PHP","readme":"# chop\nReset the OPcache content from the CLI, without reloading PHP-FPM.\n\nOperates the same way [cachetool](https://github.com/gordalina/cachetool) does, but is much smaller. Chop can only do one thing: clear the opcache content. There is no support for the APCu cache, realpath cache and none of the extra opcache commands that cachetool has.\n\nChop also has no dependencies besides [hollodotme/fast-cgi-client](https://github.com/hollodotme/fast-cgi-client). This makes it unlikely to conflict with the dependencies of your own project. Because of this, there is no need to use Chop as a PHAR. Installing it through Composer results in easier coupling with the PHP version of your application.\n\n## Installation\n\n    composer require dreadnip/chop\n\n## Usage\n\nThis is a single-command application, so calling the binary is enough:\n\n    php /path/to/your/project/vendor/bin/chop\n\nBy default, the command will print a success message or error to the console. You can suppress this output with the `-q` option.\n\n    php /path/to/your/project/vendor/bin/chop -q\n\nThe tool attempts to use sane defaults:\n\nIf no argument is passed, it'll look for a php-fpm socket file in the following places:\n```php\nprivate const POSSIBLE_SOCKET_FILE_PATTERNS = [\n    '~/.sock/*.sock',\n    '/var/run/php*.sock',\n    '/var/run/php/*.sock',\n    '/var/run/php-fpm/*.sock',\n];\n```\nThis should find your socket file on most Linux distributions. If we forgot a common location, please open an issue/PR.\n\nIf multiple socket files are found, it'll try to select one by checking the filename for both the major and minor number of your PHP version.\n\nFor example: if your server has the followning socket files, and you're running PHP 8.1, it'll select the socket file with both 8 and 1 in the filename.\n```js\nphp_80_fpm_sites.sock\n**php_81_fpm_sites.sock**\nphp_82_fpm_sites.sock\n```\n\nWhen no file socket file can be found, it will default to 127.0.0.1:9000.\n\nIf the defaults don't work for you, you can also explicitly pass an IP address or a path to a socket file using the --fcgi option:\n\n    php /path/to/your/project/vendor/bin/chop --fcgi /var/run/php-fpm.sock\n\n## Deployer integration\nDefine a task with the command\n\n    task('clear:opcache', function () {\n        run('{{bin/php}} {{ release_path }}/vendor/bin/chop');\n    });\n\nCall the task after your deployment\n\n    after('deploy:symlink', 'clear:opcache');\n\nOr run it manually\n\n    dep clear:opcache stage=production -vvv\n\n## Credit\n\nThis tool is of course inspired and based on the awesome [cachetool](https://github.com/gordalina/cachetool). \n\nJust like cachetool, the FastCGI socket code is handled by [hollodotme/fast-cgi-client](https://github.com/hollodotme/fast-cgi-client).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanderdlm%2Fchop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanderdlm%2Fchop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanderdlm%2Fchop/lists"}