{"id":13616988,"url":"https://github.com/webimpress/safe-writer","last_synced_at":"2026-01-11T16:52:59.058Z","repository":{"id":36112740,"uuid":"218015983","full_name":"webimpress/safe-writer","owner":"webimpress","description":"Write files safely, to avoid race conditions","archived":false,"fork":false,"pushed_at":"2025-03-10T20:26:01.000Z","size":281,"stargazers_count":376,"open_issues_count":2,"forks_count":9,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-10T21:28:09.616Z","etag":null,"topics":["concurrent-write","file-writer","php","race-condition-prevention","safe-writer"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webimpress.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-10-28T09:57:58.000Z","updated_at":"2025-03-10T20:25:03.000Z","dependencies_parsed_at":"2024-05-02T13:56:40.472Z","dependency_job_id":"d453c7ba-0b43-42e5-9b5b-b73ba1d7a762","html_url":"https://github.com/webimpress/safe-writer","commit_stats":{"total_commits":74,"total_committers":4,"mean_commits":18.5,"dds":0.06756756756756754,"last_synced_commit":"99ca5bbc8ba652cae54e8c682e3bed1529a61834"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webimpress%2Fsafe-writer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webimpress%2Fsafe-writer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webimpress%2Fsafe-writer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webimpress%2Fsafe-writer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webimpress","download_url":"https://codeload.github.com/webimpress/safe-writer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248815640,"owners_count":21165958,"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":["concurrent-write","file-writer","php","race-condition-prevention","safe-writer"],"created_at":"2024-08-01T20:01:35.633Z","updated_at":"2026-01-11T16:52:59.003Z","avatar_url":"https://github.com/webimpress.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Webimpress Safe Writer\n\n[![Unit Tests](https://github.com/webimpress/safe-writer/actions/workflows/phpunit.yml/badge.svg)](https://github.com/webimpress/safe-writer/actions/workflows/phpunit.yml)\n[![Coding Standards](https://github.com/webimpress/safe-writer/actions/workflows/phpcs.yml/badge.svg)](https://github.com/webimpress/safe-writer/actions/workflows/phpcs.yml)\n[![Static Analysis](https://github.com/webimpress/safe-writer/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/webimpress/safe-writer/actions/workflows/static-analysis.yml)\n[![Coverage Status](https://coveralls.io/repos/github/webimpress/safe-writer/badge.svg?branch=master)](https://coveralls.io/github/webimpress/safe-writer?branch=master)\n\nWrite files safely to avoid race conditions when\nthe same file is written multiple times in a short time period.\n\n## Installation\n\nUsing composer:\n\n```console\ncomposer require webimpress/safe-writer\n```\n\n## Usage\n\n```php\nuse Webimpress\\SafeWriter\\FileWriter;\n\n$targetFile = __DIR__ . '/target-file.php';\n$content = \"\u003c?php\\nreturn \" . var_export($data, true) . ';';\n\nFileWriter::writeFile($targetFile, $content);\n```\n\nIf something goes wrong exception (instance of `Webimpress\\SafeWriter\\Exception\\ExceptionInterface`)\nwill be thrown.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebimpress%2Fsafe-writer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebimpress%2Fsafe-writer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebimpress%2Fsafe-writer/lists"}