{"id":21467452,"url":"https://github.com/elusivecodes/fyrestream","last_synced_at":"2025-07-15T05:31:38.475Z","repository":{"id":62550864,"uuid":"504084917","full_name":"elusivecodes/FyreStream","owner":"elusivecodes","description":"FyreStream is a free, open-source stream library for PHP.","archived":false,"fork":false,"pushed_at":"2024-06-29T06:31:58.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-30T10:24:04.240Z","etag":null,"topics":[],"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/elusivecodes.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-16T09:02:41.000Z","updated_at":"2024-06-29T06:31:49.000Z","dependencies_parsed_at":"2024-06-01T16:43:27.626Z","dependency_job_id":"d5d89566-7ca2-4c4f-bdbb-df2deb09b24e","html_url":"https://github.com/elusivecodes/FyreStream","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreStream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreStream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreStream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreStream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elusivecodes","download_url":"https://codeload.github.com/elusivecodes/FyreStream/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226017601,"owners_count":17560544,"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-23T08:18:08.314Z","updated_at":"2024-11-23T08:18:10.454Z","avatar_url":"https://github.com/elusivecodes.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FyreStream\r\n\r\n**FyreStream** is a free, open-source stream library for *PHP*.\r\n\r\n\r\n## Table Of Contents\r\n- [Installation](#installation)\r\n- [Basic Usage](#basic-usage)\r\n- [Methods](#methods)\r\n\r\n\r\n\r\n## Installation\r\n\r\n**Using Composer**\r\n\r\n```\r\ncomposer require fyre/stream\r\n```\r\n\r\nIn PHP:\r\n\r\n```php\r\nuse Fyre\\Stream\\Stream;\r\n```\r\n\r\n\r\n## Basic Usage\r\n\r\n- `$resource` is a resource.\r\n\r\n```php\r\n$stream = new Stream($resource);\r\n```\r\n\r\n**From File**\r\n\r\n- `$filePath` is a string representing the file path.\r\n- `$mode` is a string representing the file access mode, and will default to \"*r*\".\r\n\r\n```php\r\n$stream = Stream::fromFile($filePath, $mode);\r\n```\r\n\r\n\r\n## Methods\r\n\r\n**Close**\r\n\r\nClose the resource.\r\n\r\n```php\r\n$stream-\u003eclose();\r\n```\r\n\r\n**Contents**\r\n\r\nGet the contents of the stream.\r\n\r\n```php\r\n$contents = $stream-\u003econtents();\r\n```\r\n\r\n**Ended**\r\n\r\nDetermine whether the stream has ended.\r\n\r\n```php\r\n$ended = $stream-\u003eended();\r\n```\r\n\r\n**Is Readable**\r\n\r\nDetermine whether the stream is readable.\r\n\r\n```php\r\n$isReadable = $stream-\u003eisReadable();\r\n```\r\n\r\n**Is Seekable**\r\n\r\nDetermine whether the stream is seekable.\r\n\r\n```php\r\n$isSeekable = $stream-\u003eisSeekable();\r\n```\r\n\r\n**Is Writable**\r\n\r\nDetermine whether the stream is writable.\r\n\r\n```php\r\n$isWritable = $stream-\u003eisWritable();\r\n```\r\n\r\n**Read**\r\n\r\nRead data from the stream.\r\n\r\n- `$length` is a number representing the number of bytes to read.\r\n\r\n```php\r\n$data = $stream-\u003eread($length);\r\n```\r\n\r\n**Rewind**\r\n\r\nRewind the stream.\r\n\r\n```php\r\n$stream-\u003erewind();\r\n```\r\n\r\n**Seek**\r\n\r\nMove the pointer in the stream.\r\n\r\n- `$offset` is a number representing the offset.\r\n- `$whence` is a number representing the offset origin, and will default to *SEEK_SET*.\r\n\r\n```php\r\n$stream-\u003eseek($offset, $whence);\r\n```\r\n\r\n**Size**\r\n\r\nGet the size of the stream.\r\n\r\n```php\r\n$size = $stream-\u003esize();\r\n```\r\n\r\n**Tell**\r\n\r\nGet the offset of the pointer.\r\n\r\n```php\r\n$offset = $stream-\u003etell();\r\n```\r\n\r\n**Write**\r\n\r\nWrite data to the stream.\r\n\r\n- `$data` is a string representing the data to write.\r\n\r\n```php\r\n$written = $stream-\u003ewrite($data);\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyrestream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felusivecodes%2Ffyrestream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyrestream/lists"}