{"id":16908807,"url":"https://github.com/wiardvanrij/m2-opcache-manager","last_synced_at":"2025-03-22T10:31:36.248Z","repository":{"id":62547657,"uuid":"111007485","full_name":"wiardvanrij/m2-opcache-manager","owner":"wiardvanrij","description":"Magento2 - PHP Opcache | Allows the purge/clear/flush of the PHP OpCache via the CLI and Magento2 Backend","archived":false,"fork":false,"pushed_at":"2020-06-16T15:02:04.000Z","size":30,"stargazers_count":27,"open_issues_count":1,"forks_count":6,"subscribers_count":5,"default_branch":"development","last_synced_at":"2024-10-14T18:52:53.713Z","etag":null,"topics":["cli","magento","magento-2","magento-2-extension","magento-extension","magento-module","magento2","magento2-backend","magento2-extension","magento2-module","opcache","php","php-opcache","php7"],"latest_commit_sha":null,"homepage":"https://www.sysrant.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"osl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wiardvanrij.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.TXT","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-16T18:29:11.000Z","updated_at":"2024-04-22T12:36:23.000Z","dependencies_parsed_at":"2022-11-02T22:30:28.612Z","dependency_job_id":null,"html_url":"https://github.com/wiardvanrij/m2-opcache-manager","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiardvanrij%2Fm2-opcache-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiardvanrij%2Fm2-opcache-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiardvanrij%2Fm2-opcache-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiardvanrij%2Fm2-opcache-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wiardvanrij","download_url":"https://codeload.github.com/wiardvanrij/m2-opcache-manager/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221826532,"owners_count":16887179,"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":["cli","magento","magento-2","magento-2-extension","magento-extension","magento-module","magento2","magento2-backend","magento2-extension","magento2-module","opcache","php","php-opcache","php7"],"created_at":"2024-10-13T18:53:04.192Z","updated_at":"2024-10-28T12:35:22.065Z","avatar_url":"https://github.com/wiardvanrij.png","language":"PHP","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=UDG2ZGDZ9TMEE"],"categories":[],"sub_categories":[],"readme":"# Magento2 OpCache Manager\n\nAllows the purge/clear/flush of the PHP OpCache via the CLI and Magento2 Backend\n\n# Unmaintained\nI still see a lot of activity on this repository (usage). I just wanted to note that I'm not maintaining this plugin anymore. This is because I'm not working with Magento at this point. Therefore I have no interest in making new changes/features.\nThough feel free to make pull-requests and I will process these. \n\n## Why\nBecause PHP OpCache is almost the de facto standard in current server/application setups. Most users/developers are \nusinga simple PHP script to clear the cache or simply ignore this cache. With this extension you can use it in your \nbuild/deployment process via the CLI. Also provided is an extension to the Magento2 backend. With a simple click you can\npurge the cache.\n\n## About me\nI'm a DevOps engineer for a full service digital agency in the Netherlands. When possible I try to create opensource\nscripts / extentions and tools. If you appriciate my work, please be so kind to donate so I can keep drinking beer.\n\n\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=UDG2ZGDZ9TMEE)\n\n## How the CLI works\nIt is simply not possible to clear the php OpCache via the CLI. I have created a workaround for that. Instead of actually\n running a static PHP file from the CLI, we do a curl request. Because it is a curl request, your webserver actually will \n parse this request via the \"php cgi\". This way we can clear it. \n \n The issue we now have is that we do not want robots or \"hackers\" to be able to clear this cache. Therefor on execution we \n write a sort of \"lock\" file. Obviously removing it after clearing. This way \"direct access\" to this static page is not possible.\n\n\n\n### Additional cache management extended\n\n\u003cimg alt=\"Magento2 Additional cache management\" src=\"https://sysrant.com/wp-content/uploads/2017/11/1-1.png\" style=\"width:100%\"/\u003e\n\n### OpCache purge\n\n\u003cimg alt=\"Magento2 OpCache purge\" src=\"https://sysrant.com/wp-content/uploads/2017/11/2.png\" style=\"width:100%\"/\u003e\n\n### CLI Usage\n\n```bash\nphp bin/magento opcache:status\n```\n\n\nReturns the opcache status:\n\n```bash\nbin/magento opcache:status\nArray\n(\n    [opcache_enabled] =\u003e 1\n    [cache_full] =\u003e \n    [restart_pending] =\u003e \n    [restart_in_progress] =\u003e \n    [memory_usage] =\u003e Array\n        (\n            [used_memory] =\u003e 78587744\n            [free_memory] =\u003e 2068895904\n            [wasted_memory] =\u003e 0\n            [current_wasted_percentage] =\u003e 0\n        )\n\n    [interned_strings_usage] =\u003e Array\n        (\n            [buffer_size] =\u003e 20971520\n            [used_memory] =\u003e 2283208\n            [free_memory] =\u003e 18688312\n            [number_of_strings] =\u003e 41723\n        )\n\n    [opcache_statistics] =\u003e Array\n        (\n            [num_cached_scripts] =\u003e 1289\n            [num_cached_keys] =\u003e 1365\n            [max_cached_keys] =\u003e 130987\n            [hits] =\u003e 6\n            [start_time] =\u003e 1510859030\n            [last_restart_time] =\u003e 0\n            [oom_restarts] =\u003e 0\n            [hash_restarts] =\u003e 0\n            [manual_restarts] =\u003e 0\n            [misses] =\u003e 1289\n            [blacklist_misses] =\u003e 0\n            [blacklist_miss_ratio] =\u003e 0\n            [opcache_hit_rate] =\u003e 0.46332046332046\n        )\n\n)\n\n```\n\n\n```bash\nphp bin/magento opcache:clear\n```\n\nWill clear the PHP OpCache\n\n```bash\nbin/magento opcache:clear\nCleared OpCache\n```\n\n\n## Install with Composer \n\n```bash\ncomposer require webfixit/opcache\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiardvanrij%2Fm2-opcache-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiardvanrij%2Fm2-opcache-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiardvanrij%2Fm2-opcache-manager/lists"}