{"id":15286538,"url":"https://github.com/pastuhov/php-file-stream","last_synced_at":"2025-04-13T03:32:37.310Z","repository":{"id":57036205,"uuid":"37640230","full_name":"pastuhov/php-file-stream","owner":"pastuhov","description":"May be used for sitemap.xml or YML files creation.","archived":false,"fork":false,"pushed_at":"2017-02-17T14:01:45.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T20:49:31.231Z","etag":null,"topics":["file","sitemap","xml","yml"],"latest_commit_sha":null,"homepage":"","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-18T05:53:24.000Z","updated_at":"2021-04-29T16:53:40.000Z","dependencies_parsed_at":"2022-08-23T20:51:00.844Z","dependency_job_id":null,"html_url":"https://github.com/pastuhov/php-file-stream","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-file-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pastuhov%2Fphp-file-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pastuhov%2Fphp-file-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pastuhov%2Fphp-file-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pastuhov","download_url":"https://codeload.github.com/pastuhov/php-file-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248659641,"owners_count":21141152,"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":["file","sitemap","xml","yml"],"created_at":"2024-09-30T15:16:22.135Z","updated_at":"2025-04-13T03:32:37.291Z","avatar_url":"https://github.com/pastuhov.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-file-stream\n\n[![Build Status](https://travis-ci.org/pastuhov/php-file-stream.svg)](https://travis-ci.org/pastuhov/php-file-stream)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/pastuhov/php-file-stream/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/pastuhov/php-file-stream/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/pastuhov/php-file-stream/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/pastuhov/php-file-stream/?branch=master)\n[![Total Downloads](https://poser.pugx.org/pastuhov/php-file-stream/downloads)](https://packagist.org/packages/pastuhov/php-file-stream)\n\nA PHP class to generate sitemap files for large web-sites or YML (Yandex Market Language) files\n\n## Install\n\nVia Composer\n\n``` bash\n$ composer require pastuhov/php-file-stream\n```\n\n## Features\n\n* transparent file splitting (multiple sitemaps)\n* fast and safe file replacement from tmp to public directory\n* dependencies: 0\n\n## Usage\n\n### Simple YML export\n\n```php\n\n    $stream = new FileStream(\n        '/tmp/export.yml'\n    );\n\n    $stream-\u003ewrite('\u003cyml_catalog date=\"2010-04-01 17:00\"\u003e');\n    \n    ...\n    \n    $stream-\u003ewrite('\u003c/yml_catalog\u003e');\n```\n\n### Advanced usage (large site sitemap, \u003e10k urls)\n\n```php\n\n    $stream = new FileStream(\n        '/tmp/sitemap{count}.xml',\n        '\u003curlset\u003e',\n        '\u003c/urlset\u003e',\n        10000\n    );\n\n    foreach ($urls as $url) {\n        $stream-\u003ewrite(\n            '\u003curl\u003e\u003cloc\u003e' . $url . '\u003c/loc\u003e\u003c/url\u003e' . PHP_EOL\n        );\n    }\n\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-file-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpastuhov%2Fphp-file-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpastuhov%2Fphp-file-stream/lists"}