{"id":17689312,"url":"https://github.com/m1guelpf/php-fly-api","last_synced_at":"2025-05-13T01:37:27.396Z","repository":{"id":62521034,"uuid":"107886430","full_name":"m1guelpf/php-fly-api","owner":"m1guelpf","description":"A PHP Client for the Fly.io API","archived":false,"fork":false,"pushed_at":"2019-11-16T18:46:33.000Z","size":14,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T17:12:29.203Z","etag":null,"topics":["client","fly","fly-io","guzzle","php"],"latest_commit_sha":null,"homepage":"","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/m1guelpf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-22T17:16:55.000Z","updated_at":"2022-05-13T17:45:29.000Z","dependencies_parsed_at":"2022-11-02T14:46:13.277Z","dependency_job_id":null,"html_url":"https://github.com/m1guelpf/php-fly-api","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1guelpf%2Fphp-fly-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1guelpf%2Fphp-fly-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1guelpf%2Fphp-fly-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1guelpf%2Fphp-fly-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m1guelpf","download_url":"https://codeload.github.com/m1guelpf/php-fly-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243281141,"owners_count":20266150,"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":["client","fly","fly-io","guzzle","php"],"created_at":"2024-10-24T11:47:20.264Z","updated_at":"2025-03-12T19:32:04.405Z","avatar_url":"https://github.com/m1guelpf.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Fly.io API Client\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/m1guelpf/fly-api.svg?style=flat-square)](https://packagist.org/packages/m1guelpf/fly-api)\n[![Software License](https://img.shields.io/github/license/m1guelpf/php-fly-api.svg?style=flat-square)](LICENSE.md)\n[![Build Status](https://img.shields.io/travis/m1guelpf/php-fly-api/master.svg?style=flat-square)](https://travis-ci.org/m1guelpf/php-fly-api)\n[![Total Downloads](https://img.shields.io/packagist/dt/m1guelpf/fly-api.svg?style=flat-square)](https://packagist.org/packages/m1guelpf/fly-api)\n\nThis package makes it easy to interact with [the Fly.io API](https://fly.io/docs/api/).\n\n## Requirements\n\nThis package requires PHP \u003e= 5.5.\n\n## Installation\n\nYou can install the package via composer:\n\n``` bash\ncomposer require m1guelpf/fly-api\n```\n\n## Usage\n\nYou must pass a Guzzle client and the API token to the constructor of `M1guelpf\\FlyAPI\\Fly`.\n\n``` php\n$fly = new \\M1guelpf\\FlyAPI\\Fly('YOUR_FLY_API_TOKEN');\n```\n\nor you can skip the token and use the `connect()` method later\n\n``` php\n$fly = new \\M1guelpf\\FlyAPI\\Fly();\n\n$fly-\u003econnect('YOUR_FLY_API_TOKEN');\n```\n\n### Get Hostnames\n``` php\n$fly-\u003egetHostnames($slug);\n```\n\n### Create Hostname\n``` php\n$fly-\u003ecreateHostname($slug, $hostname);\n```\n\n### Get Hostname\n``` php\n$fly-\u003egetHostname($slug, $hostname);\n```\n\n### Create Backend\n``` php\n$fly-\u003ecreateBackend($slug, $name, $type, $settings);\n```\n\n### Create Rule\n``` php\n$fly-\u003ecreateRule($slug, $hostname, $backend_id, $action_type, $path, $priority, $path_replacement);\n```\n\n### Get the Guzzle Client\n\n``` php\n$fly-\u003egetClient();\n```\n\n### Set the Guzzle Client\n\n``` php\n$client = new \\GuzzleHttp\\Client(); // Example Guzzle client\n$fly-\u003esetClient($client);\n```\nwhere $client is an instance of `\\GuzzleHttp\\Client`.\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Testing\n\n``` bash\n$ composer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email soy@miguelpiedrafita.com instead of using the issue tracker.\n\n## Credits\n\n- [Miguel Piedrafita](https://github.com/m1guelpf)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License. Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm1guelpf%2Fphp-fly-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm1guelpf%2Fphp-fly-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm1guelpf%2Fphp-fly-api/lists"}