{"id":15660469,"url":"https://github.com/pastuhov/php-exec-command","last_synced_at":"2025-04-30T15:50:08.831Z","repository":{"id":57036201,"uuid":"37724184","full_name":"pastuhov/php-exec-command","owner":"pastuhov","description":"Simple php command executor with param binding","archived":false,"fork":false,"pushed_at":"2017-12-21T14:37:09.000Z","size":29,"stargazers_count":25,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T15:50:02.051Z","etag":null,"topics":["command","execute","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pastuhov.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}},"created_at":"2015-06-19T13:47:25.000Z","updated_at":"2024-10-08T15:24:29.000Z","dependencies_parsed_at":"2022-08-24T06:40:13.384Z","dependency_job_id":null,"html_url":"https://github.com/pastuhov/php-exec-command","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pastuhov%2Fphp-exec-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pastuhov%2Fphp-exec-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pastuhov%2Fphp-exec-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pastuhov%2Fphp-exec-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pastuhov","download_url":"https://codeload.github.com/pastuhov/php-exec-command/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251734542,"owners_count":21635155,"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":["command","execute","php"],"created_at":"2024-10-03T13:21:52.132Z","updated_at":"2025-04-30T15:50:08.754Z","avatar_url":"https://github.com/pastuhov.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-exec-command\n\n[![Build Status](https://travis-ci.org/pastuhov/php-exec-command.svg)](https://travis-ci.org/pastuhov/php-exec-command)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/pastuhov/php-exec-command/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/pastuhov/php-exec-command/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/pastuhov/php-exec-command/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/pastuhov/php-exec-command/?branch=master)\n[![Total Downloads](https://poser.pugx.org/pastuhov/php-exec-command/downloads)](https://packagist.org/packages/pastuhov/php-exec-command)\n[![StyleCI](https://styleci.io/repos/37724184/shield)](https://styleci.io/repos/37724184)\n\nSimple php command executor with param binding.\n\n## Install\n\nVia Composer\n\n``` bash\n$ composer require pastuhov/php-exec-command\n```\n\n## Features\n\n* light weight\n* param binding\n* throws an exception if return status \u003e0\n* redirect stderr to stdout if needed\n\n## Usage\n\n```php\n    $output = Command::exec(\n        'echo {phrase}',\n        [\n            'phrase' =\u003e 'hello'\n        ]\n    );\n    // $output = 'hello'\n```\nor\n```php\n    $output = Command::exec(\n        'echo {phrase}',\n        [\n            'phrase' =\u003e [\n                'hello',\n                'world'\n            ]\n        ]\n    );\n    // $output = 'hello world'\n```\n\nor\n```php\n    try {\n        Command::exec('locate {parody}',\n            [\n                'parody' =\u003e [\n                    'pink_unicorn'\n                ]\n            ]\n        );    \n        \n        echo \"unicorn was found!\";\n    } catch (\\pastuhov\\Command\\CommandException $e) {\n        echo \"can't find unicorn :(\";\n    }\n```\n\nBy default, all arguments are escaped using\n[escapeshellarg](https://secure.php.net/manual/en/function.escapeshellarg.php).\nIf you need to pass unescaped arguments, use `{!name!}`, like so:\n\n```php\nCommand::exec('echo {!path!}', ['path' =\u003e '$PATH']);\n```\n\n## Testing\n\n``` bash\n$ composer test\n```\nor\n```bash\n$ phpunit\n```\n\n## Security\n\nIf you discover any security related issues, please email kirill@pastukhov.su instead of using the issue tracker.\n\n## Credits\n\n- [Kirill Pastukhov](https://github.com/pastuhov)\n- [All Contributors](../../contributors)\n\n## License\n\nGNU General Public License, version 2. Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpastuhov%2Fphp-exec-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpastuhov%2Fphp-exec-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpastuhov%2Fphp-exec-command/lists"}