{"id":20903527,"url":"https://github.com/phly/phly-opcache-preload","last_synced_at":"2025-05-13T04:33:19.529Z","repository":{"id":146678536,"uuid":"258538750","full_name":"phly/phly-opcache-preload","owner":"phly","description":"Opcache preload file generator.","archived":false,"fork":false,"pushed_at":"2020-05-04T18:19:00.000Z","size":38,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T18:12:11.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://discourse.laminas.dev/t/rfc-opcache-preloading-for-mezzio-and-mvc/1442","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phly.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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-04-24T14:42:06.000Z","updated_at":"2023-06-15T14:57:42.000Z","dependencies_parsed_at":"2023-04-10T01:48:15.673Z","dependency_job_id":null,"html_url":"https://github.com/phly/phly-opcache-preload","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/phly%2Fphly-opcache-preload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phly%2Fphly-opcache-preload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phly%2Fphly-opcache-preload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phly%2Fphly-opcache-preload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phly","download_url":"https://codeload.github.com/phly/phly-opcache-preload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253877265,"owners_count":21977632,"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":"2024-11-18T13:13:57.841Z","updated_at":"2025-05-13T04:33:19.520Z","avatar_url":"https://github.com/phly.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phly/phly-opcache-preload\n\n[![Build Status](https://travis-ci.com/phly/phly-opcache-preload.svg?branch=master)](https://travis-ci.com/phly/phly-opcache-preload)\n[![Coverage Status](https://coveralls.io/repos/github/laminas/laminas-opcache-preload/badge.svg?branch=master)](https://coveralls.io/github/laminas/laminas-opcache-preload?branch=master)\n\nThis library provides CLI tooling for generating an opcache preload file.\n\n\u003e ## Proof of Concept\n\u003e\n\u003e This library is a proof of concept, based on the Laminas [Opcache\n\u003e Preloading for Mezzio and MVC RFC](https://discourse.laminas.dev/t/rfc-opache-preloading-for-mezzio-and-mvc/1442).\n\u003e It will eventually live in the Laminas organization. As such, use this for\n\u003e testing purposes only.\n\n## Installation\n\nThis package may be installed globally, or locally. We recommend installing\nglobally, as it will generally be used exactly once within an application to\ngenerate the preload file, and then is no longer required.\n\nTo install globally:\n\n```bash\n$ composer global config repositories.opcache vcs https://github.com/phly/phly-opcache-preload.git\n$ composer global require \"phly/phly-opcache-preload:dev-master@dev\"\n```\n\n\u003e ### Add Composer to your $PATH\n\u003e\n\u003e To add the Composer global vendor binary directory to your path on Linux, Mac,\n\u003e and other *nix variants:\n\u003e\n\u003e ```bash\n\u003e export PATH=$(composer global config home)/vendor/bin:$PATH\n\u003e ```\n\u003e\n\u003e On Windows, follow [this tutorial](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/).\n\nTo install locally:\n\n```bash\n$ composer config repositories.opcache vcs https://github.com/phly/phly-opcache-preload.git\n$ composer require \"phly/phly-opcache-preload:dev-master@dev\"\n```\n\n## Usage\n\nGet usage information after installation via the following commands:\n\n```bash\n$ phly-opcache-preload help generate:preload-file\n$ phly-opcache-preload help generate:ini\n```\n\nGenerally speaking, use this command to generate the preload file:\n\n```bash\n$ phly-opcache-preload generate:preload-file\n```\n\nand this one to add it to a php.ini configuration file:\n\n```bash\n$ phly-opcache-preload generate:ini \u003e $PHP_INI_DIR/conf.d/999-preload.ini\n```\n\n\u003e ### Local usage\n\u003e\n\u003e If you installed locally, use `./vendor/bin/phly-opcache-preload` in the above\n\u003e examples.\n\n## Configuring preloading rules\n\n`generate:preload-file` generates a file containing:\n\n- The class `Phly\\OpcachePreload\\Preloader`.\n- Creation of an instance of that class.\n- Configuration declarations.\n- A method call to start preloading.\n\nWhen it comes to configuring the preloader, you may call any of the following\nmethods on the `Preloader` instance:\n\n- **`paths(string ...$paths): Preloader`**: Add one or more paths to preload.\n  These may be individual files, or entire subdirectory trees. When the file is\n  generated, the commandline tooling attempts to determine if you are preloading\n  for a Laminas MVC, Laminas API Tools, or Mezzio application, and will define\n  some initial paths for you accordingly. Otherwise, this will be empty.\n\n- **`ignorePaths(string ...$paths): Preloader`**: Add one or more paths to\n  ignore when preloading. As with `paths()`, these may be individual files or\n  subdirectory trees.\n\n- **`ignoreClasses(string ...$names): Preloader`**: Add one or more class names\n  to never preload. The tooling uses the composer `autoload_classmap.php` file\n  to determine if a class matches a given file, and, if so, it will skip\n  preloading that file.\n\nEach of the above may be called more than once, or with more than one argument.\n\nThe last line of the file **MUST** be `$preloader-\u003eload();` as that line\nperforms the actual preloading operations.\n\n\u003c!--\n## Documentation\n\nBrowse the documentation online at https://docs.laminas.dev/laminas-{component}/\n\n--\u003e\n\n## Support\n\n* [Issues](https://github.com/phly/phly-opcache-preload/issues/)\n* [Forum](https://discourse.laminas.dev/t/rfc-opcache-preloading-for-mezzio-and-mvc/1442)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphly%2Fphly-opcache-preload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphly%2Fphly-opcache-preload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphly%2Fphly-opcache-preload/lists"}