{"id":19326010,"url":"https://github.com/linkorb/filespace","last_synced_at":"2025-10-06T13:14:13.605Z","repository":{"id":31713154,"uuid":"35278937","full_name":"linkorb/filespace","owner":"linkorb","description":"Flexible storage solution for end-user data","archived":false,"fork":false,"pushed_at":"2023-08-10T09:35:02.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-08T00:27:10.914Z","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/linkorb.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,"governance":null}},"created_at":"2015-05-08T12:49:29.000Z","updated_at":"2023-08-10T09:35:08.000Z","dependencies_parsed_at":"2023-09-28T08:39:04.828Z","dependency_job_id":null,"html_url":"https://github.com/linkorb/filespace","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.0625,"last_synced_commit":"8909dcc0a9adcfff025dd4431fa28c76381e7fd1"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Ffilespace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Ffilespace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Ffilespace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Ffilespace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkorb","download_url":"https://codeload.github.com/linkorb/filespace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223903480,"owners_count":17222551,"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-10T02:12:11.984Z","updated_at":"2025-10-06T13:14:08.572Z","avatar_url":"https://github.com/linkorb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FileSpace\n\nFlexible storage solution for end-user data.\n\n\u003cimg src=\"http://www.linkorb.com/d/online/linkorb/upload/engineering-blog/filespace_diagram.png\" /\u003e\n\nCheck out our blogpost to see how we're using it in production:   [http://engineering.linkorb.com/blog/scaling-user-data-with-objectstorage-in-php](http://engineering.linkorb.com/blog/scaling-user-data-with-objectstorage-in-php)\n\n## Installing\n\nCheck out [composer](http://www.getcomposer.org) for details about installing and running composer.\n\nThen, add `linkorb/filespace` to your project's `composer.json`:\n\n```json\n{\n    \"require\": {\n        \"linkorb/filespace\": \"~1.0\"\n    }\n}\n```\n## Usage:\n\n```php\nuse Aws\\S3\\S3Client;\nuse FileSpace\\Service\\PdoService;\nuse ObjectStorage\\Adapter\\S3Adapter;\n\n// Instantiate an S3 connection\n$s3client = S3Client::factory(array(\n    'key' =\u003e 'my_s3_key',\n    'secret' =\u003e 'my_s3_secret'\n));\n\n// Get a storage adapter based on the s3 client\n$storage = new S3Adapter($s3client, 'my-bucket-name', 'my/key/prefix/');\n\n// Get a PDO connection\n$pdo = ... // TODO;\n\n// Instantiate the File Space Service:\n$service = new PdoFileSpaceService($pdo, $storage);\n\n// test if a 'space' has been created:\n$space_key = 'account-x.contact.c001';\nif (!$service-\u003ehasSpace($space_key)) {\n    $service-\u003ecreateSpace($space_key, \"Customer 1: John Johnson\");\n}\n$space = $service-\u003egetSpace($space_key);\n\n// List all files in the space\n$files = $service-\u003egetFiles($space);\nforeach ($files as $file) {\n    echo $file-\u003egetKey() . ': ' . $file-\u003egetSizeOriginalDisplay() . \"\\n\";\n}\n\n// Upload a file into this space\n$service-\u003eupload($space, 'contract-final.pdf', '/home/john/Downloads/contract.pdf');\n\n// Download a file from this space:\n$service-\u003edownload($space, 'invoice-1234.pdf', '/home/john/invoices/invoice-1234.pdf');\n\n// Delete a file from the space:\n$service-\u003edeleteFile($space, 'remove-me.txt');\n\n\n```\n## Initializing the database schema\n\n    vendor/bin/database-manager database:loadschema --apply filespace example/schema.xml\n\n## Contributing\n\nReady to build and improve on this repo? Excellent!\nGo ahead and fork/clone this repo and we're looking forward to your pull requests!\n\nIf you are unable to implement changes you like yourself, don't hesitate to\nopen a new issue report so that we or others may take care of it.\n\n## Brought to you by the LinkORB Engineering team\n\n\u003cimg src=\"http://www.linkorb.com/d/meta/tier1/images/linkorbengineering-logo.png\" width=\"200px\" /\u003e\u003cbr /\u003e\nCheck out our other projects at [linkorb.com/engineering](http://www.linkorb.com/engineering).\n\nBtw, we're hiring!\n\n## License\n\nPlease check LICENSE.md for full license information\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Ffilespace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkorb%2Ffilespace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Ffilespace/lists"}