{"id":15042469,"url":"https://github.com/nazmulpcc/phpsh","last_synced_at":"2026-01-28T09:36:28.310Z","repository":{"id":57679117,"uuid":"272477224","full_name":"nazmulpcc/phpsh","owner":"nazmulpcc","description":"Generate shell scripts from PHP with ease","archived":false,"fork":false,"pushed_at":"2022-05-13T14:42:35.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-10T15:23:45.982Z","etag":null,"topics":["bash","php","shell-script"],"latest_commit_sha":null,"homepage":null,"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/nazmulpcc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-15T15:35:46.000Z","updated_at":"2023-07-27T09:18:38.000Z","dependencies_parsed_at":"2022-08-28T08:20:43.420Z","dependency_job_id":null,"html_url":"https://github.com/nazmulpcc/phpsh","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"spatie/package-skeleton-php","purl":"pkg:github/nazmulpcc/phpsh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmulpcc%2Fphpsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmulpcc%2Fphpsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmulpcc%2Fphpsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmulpcc%2Fphpsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nazmulpcc","download_url":"https://codeload.github.com/nazmulpcc/phpsh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmulpcc%2Fphpsh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28843942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T07:39:25.367Z","status":"ssl_error","status_checked_at":"2026-01-28T07:39:24.487Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bash","php","shell-script"],"created_at":"2024-09-24T20:47:21.394Z","updated_at":"2026-01-28T09:36:28.295Z","avatar_url":"https://github.com/nazmulpcc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PhpSh\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/nazmulpcc/phpsh.svg?style=flat-square)](https://packagist.org/packages/nazmulpcc/phpsh)\n[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/nazmulpcc/phpsh/run-tests?label=tests)](https://github.com/nazmulpcc/phpsh/actions?query=workflow%3Arun-tests+branch%3Amaster)\n[![Total Downloads](https://img.shields.io/packagist/dt/nazmulpcc/phpsh.svg?style=flat-square)](https://packagist.org/packages/nazmulpcc/phpsh)\n \n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require nazmulpcc/phpsh\n```\n\n## Why?\n\nIf writing shell scripts make you *uncomfortable* because it feels like an ecrypted alient language, PhpSh is for you.\n\n## Examples\n\n```php\nuse PhpSh\\Condition;\nuse PhpSh\\Script;\n\n$condition = Condition::create('$i')-\u003elessThan(10);\n\n(new Script())\n    -\u003eset('i', 0)\n    -\u003ewhile($condition, function (Script $script){\n        $script-\u003eecho('$i');\n        $script-\u003eincrement('i');\n    })\n    -\u003egenerate();\n```\nThe above example code will generate shell executable script like this:\n``` sh\ni=0\nwhile [ $i -lt 10 ]; do\n    echo -n $i\n    let i+=1\ndone\n```\nDon't know how to do \"if a file exists and is writable then do something\"? PhpSh got your back!\n```php\n$condition = Condition::create()\n    -\u003efileExists('/path/to/file')\n    -\u003eand()\n    -\u003ewritable('/path/to/file');\n\n(new Script())\n    -\u003eif($condition, function (Script $script){\n        $script-\u003eprintf(\"File found\\n\");\n    })-\u003eelse(function (Script $script){\n        $script-\u003eprintf(\"Oops!\\n\");\n    })\n    -\u003egenerate();\n```  \n## Testing\n\n``` bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email nazmulpcc [at] gmail.com instead of using the issue tracker.\n\n## Credits\n\n- [Nazmul Alam](https://github.com/nazmulpcc)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnazmulpcc%2Fphpsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnazmulpcc%2Fphpsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnazmulpcc%2Fphpsh/lists"}