{"id":15065460,"url":"https://github.com/wp-cli/eval-command","last_synced_at":"2025-04-05T15:08:55.434Z","repository":{"id":45041270,"uuid":"85580543","full_name":"wp-cli/eval-command","owner":"wp-cli","description":"Executes arbitrary PHP code or files.","archived":false,"fork":false,"pushed_at":"2024-11-24T17:28:07.000Z","size":8435,"stargazers_count":8,"open_issues_count":2,"forks_count":13,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-29T14:12:25.792Z","etag":null,"topics":["cli","eval","hacktoberfest","wordpress","wp-cli","wp-cli-package"],"latest_commit_sha":null,"homepage":"","language":"Gherkin","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/wp-cli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-20T13:34:10.000Z","updated_at":"2024-11-24T17:28:10.000Z","dependencies_parsed_at":"2024-10-18T14:46:36.324Z","dependency_job_id":"8b3ac5d6-14b9-4678-803b-0a07a875cd28","html_url":"https://github.com/wp-cli/eval-command","commit_stats":{"total_commits":412,"total_committers":43,"mean_commits":9.581395348837209,"dds":0.6674757281553398,"last_synced_commit":"1ba2dab5be33f270f5256ceb605e5a3046194f78"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Feval-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Feval-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Feval-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Feval-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wp-cli","download_url":"https://codeload.github.com/wp-cli/eval-command/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353746,"owners_count":20925329,"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","eval","hacktoberfest","wordpress","wp-cli","wp-cli-package"],"created_at":"2024-09-25T00:38:43.145Z","updated_at":"2025-04-05T15:08:55.403Z","avatar_url":"https://github.com/wp-cli.png","language":"Gherkin","readme":"wp-cli/eval-command\n===================\n\nExecutes arbitrary PHP code or files.\n\n[![Testing](https://github.com/wp-cli/eval-command/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/eval-command/actions/workflows/testing.yml)\n\nQuick links: [Using](#using) | [Installing](#installing) | [Contributing](#contributing) | [Support](#support)\n\n## Using\n\nThis package implements the following commands:\n\n### wp eval\n\nExecutes arbitrary PHP code.\n\n~~~\nwp eval \u003cphp-code\u003e [--skip-wordpress]\n~~~\n\nNote: because code is executed within a method, global variables need\nto be explicitly globalized.\n\n**OPTIONS**\n\n\t\u003cphp-code\u003e\n\t\tThe code to execute, as a string.\n\n\t[--skip-wordpress]\n\t\tExecute code without loading WordPress.\n\n**EXAMPLES**\n\n    # Display WordPress content directory.\n    $ wp eval 'echo WP_CONTENT_DIR;'\n    /var/www/wordpress/wp-content\n\n    # Generate a random number.\n    $ wp eval 'echo rand();' --skip-wordpress\n    479620423\n\n\n\n### wp eval-file\n\nLoads and executes a PHP file.\n\n~~~\nwp eval-file \u003cfile\u003e [\u003carg\u003e...] [--skip-wordpress] [--use-include]\n~~~\n\nNote: because code is executed within a method, global variables need\nto be explicitly globalized.\n\n**OPTIONS**\n\n\t\u003cfile\u003e\n\t\tThe path to the PHP file to execute.  Use '-' to run code from STDIN.\n\n\t[\u003carg\u003e...]\n\t\tOne or more positional arguments to pass to the file. They are placed in the $args variable.\n\n\t[--skip-wordpress]\n\t\tLoad and execute file without loading WordPress.\n\n\t[--use-include]\n\t\tProcess the provided file via include instead of evaluating its contents.\n\n## Installing\n\nThis package is included with WP-CLI itself, no additional installation necessary.\n\nTo install the latest version of this package over what's included in WP-CLI, run:\n\n    wp package install git@github.com:wp-cli/eval-command.git\n\n## Contributing\n\nWe appreciate you taking the initiative to contribute to this project.\n\nContributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.\n\nFor a more thorough introduction, [check out WP-CLI's guide to contributing](https://make.wordpress.org/cli/handbook/contributing/). This package follows those policy and guidelines.\n\n### Reporting a bug\n\nThink you’ve found a bug? We’d love for you to help us get it fixed.\n\nBefore you create a new issue, you should [search existing issues](https://github.com/wp-cli/eval-command/issues?q=label%3Abug%20) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.\n\nOnce you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please [create a new issue](https://github.com/wp-cli/eval-command/issues/new). Include as much detail as you can, and clear steps to reproduce if possible. For more guidance, [review our bug report documentation](https://make.wordpress.org/cli/handbook/bug-reports/).\n\n### Creating a pull request\n\nWant to contribute a new feature? Please first [open a new issue](https://github.com/wp-cli/eval-command/issues/new) to discuss whether the feature is a good fit for the project.\n\nOnce you've decided to commit the time to seeing your pull request through, [please follow our guidelines for creating a pull request](https://make.wordpress.org/cli/handbook/pull-requests/) to make sure it's a pleasant experience. See \"[Setting up](https://make.wordpress.org/cli/handbook/pull-requests/#setting-up)\" for details specific to working on this package locally.\n\n## Support\n\nGitHub issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support\n\n\n*This README.md is generated dynamically from the project's codebase using `wp scaffold package-readme` ([doc](https://github.com/wp-cli/scaffold-package-command#wp-scaffold-package-readme)). To suggest changes, please submit a pull request against the corresponding part of the codebase.*\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-cli%2Feval-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwp-cli%2Feval-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-cli%2Feval-command/lists"}