{"id":20733289,"url":"https://github.com/quillstack/local-storage","last_synced_at":"2025-10-16T05:33:06.854Z","repository":{"id":45126877,"uuid":"394779968","full_name":"quillstack/local-storage","owner":"quillstack","description":"The library to manage files in local storage.","archived":false,"fork":false,"pushed_at":"2022-01-16T20:40:09.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-18T20:23:34.453Z","etag":null,"topics":["local","php8","quillstack","storage"],"latest_commit_sha":null,"homepage":"https://quillstack.org/storage","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/quillstack.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":"2021-08-10T20:59:32.000Z","updated_at":"2022-01-06T20:46:03.000Z","dependencies_parsed_at":"2022-08-26T10:40:47.277Z","dependency_job_id":null,"html_url":"https://github.com/quillstack/local-storage","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quillstack%2Flocal-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quillstack%2Flocal-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quillstack%2Flocal-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quillstack%2Flocal-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quillstack","download_url":"https://codeload.github.com/quillstack/local-storage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243016752,"owners_count":20222303,"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":["local","php8","quillstack","storage"],"created_at":"2024-11-17T05:24:37.650Z","updated_at":"2025-10-16T05:33:01.824Z","avatar_url":"https://github.com/quillstack.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quillstack Local Storage\n\n[![Build Status](https://app.travis-ci.com/quillstack/local-storage.svg?branch=main)](https://app.travis-ci.com/quillstack/local-storage)\n[![Downloads](https://img.shields.io/packagist/dt/quillstack/local-storage.svg)](https://packagist.org/packages/quillstack/local-storage)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=quillstack_local-storage\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=quillstack_local-storage)\n[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=quillstack_local-storage\u0026metric=ncloc)](https://sonarcloud.io/dashboard?id=quillstack_local-storage)\n[![StyleCI](https://github.styleci.io/repos/394779968/shield?branch=main)](https://github.styleci.io/repos/394779968?branch=main)\n[![CodeFactor](https://www.codefactor.io/repository/github/quillstack/local-storage/badge)](https://www.codefactor.io/repository/github/quillstack/local-storage)\n![Packagist License](https://img.shields.io/packagist/l/quillstack/local-storage)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=quillstack_local-storage\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=quillstack_local-storage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/d3fbd09f1580534b0c0e/maintainability)](https://codeclimate.com/github/quillstack/local-storage/maintainability)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=quillstack_local-storage\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=quillstack_local-storage)\n![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/quillstack/local-storage)\n\nThe package to manage files on the local storage.\n\n### Installation\n\nTo install this package, run the standard command using _Composer_:\n\n```\ncomposer require quillstack/local-storage\n```\n\n### Usage\n\nCreate a class or inject it as a dependency:\n\n```php\nuse Quillstack\\LocalStorage\\LocalStorage;\n\n$storage = new LocalStorage();\n$storage-\u003esave('var/cache/token.txt', 'muHaloosPps23sKkdsaaBBcei');\n```\n\nIf you want to use it as a dependency:\n\n```php\nuse Quillstack\\LocalStorage\\LocalStorage;\n\npublic function __construct(private LocalStorage $storage)\n{\n    //\n}\n\npublic function getTokenFromCache()\n{\n    $this-\u003estorage-\u003eget('var/cache/token.txt');\n}\n```\n\n### Storage interface\n\nThis package implements `quillstack/storage-interface`: \\\nhttps://github.com/quillstack/storage-interface \\\nwith methods:\n\n- `get()` Retrieves the contents of a file. \\\nThis method opens a file and return its contents, it throws an exception if file doesn't exist.\n- `exists()` Checks if the file exists on the storage.\n- `missing()` Checks if the file is missing from the storage.\n- `save()` Saves the contents to the file. \\\nThis method throws an exception if there are any troubles with saving a file (e.g. no space left on device).\n- `delete()` Deletes one or more files. \\\nThis method deletes one or many files and throws an exception if error occurs during deleting a file.\n\n### Unit tests\n\nRun tests using a command:\n\n```\nphpdbg -qrr ./vendor/bin/unit-tests\n```\n\n### Docker\n\n```shell\n$ docker-compose up -d\n$ docker exec -w /var/www/html -it quillstack_local-storage sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquillstack%2Flocal-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquillstack%2Flocal-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquillstack%2Flocal-storage/lists"}