{"id":19326034,"url":"https://github.com/linkorb/filelist","last_synced_at":"2025-04-22T20:32:17.316Z","repository":{"id":14383399,"uuid":"17093642","full_name":"linkorb/filelist","owner":"linkorb","description":"Easily manage lists of files attached to any object in your application.","archived":false,"fork":false,"pushed_at":"2015-05-15T07:34:28.000Z","size":168,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-21T09:56:48.412Z","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":"i22-fl/node-soap","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}},"created_at":"2014-02-22T20:10:26.000Z","updated_at":"2015-02-25T15:12:27.000Z","dependencies_parsed_at":"2022-09-11T03:00:45.390Z","dependency_job_id":null,"html_url":"https://github.com/linkorb/filelist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Ffilelist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Ffilelist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Ffilelist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Ffilelist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkorb","download_url":"https://codeload.github.com/linkorb/filelist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250318893,"owners_count":21411009,"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:15.774Z","updated_at":"2025-04-22T20:32:17.050Z","avatar_url":"https://github.com/linkorb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FileList library\n\nEasily manage lists of files attached to any object in your application\n\n**PLEASE READ**: This package is no longer maintained, and replaced by a better implementation. Please check out FileSpace instead:\n[http://github.com/linkorb/filespace](http://github.com/linkorb/filespace)\n\n## How does it work:\n\nFirst, you need to instantiate a `driver`. The driver allows you to chose where your files will be physically stored.\nThe simplest driver is the `FileSystemDriver`. You can instantiate it like this:\n\n```php\n$driver = new LinkORB\\Component\\FileList\\Driver\\FileSystemDriver(\"/data/myfilelists/\");\n```\n\nSecond, you define a `key` for your new file-list. Here are some examples:\n\n* `user.joe.contracts`: This would store all contracts for a user called \"joe\"\n* `project.42.scans`: Here you would store all scans for a project with id \"42\"\n* `post.99.downloads`: Attach a list of downloads to a post with id \"99\"\n\n... and so on. It's up to you and your app to choose these keys. They don't need to exist anywhere, or be registered. It will just work.\n\nNow that you've chosen a `key` for your list, you can retrieve your filelist instance:\n\n```php\n$filelist = $driver-\u003egetFileListByKey('user.joe.contracts');\n\necho \"Attached files: \" . $filelist-\u003egetFileCount();\n```\n\nUsing the filelist instance, you can easily add, remove, and list files:\n\n```php\n\n// Upload a local file to the filelist, and give it a name:\n$filelist-\u003eupload(\"/tmp/myphoto.png\", \"avatar.png\");\n\n// List all files on the filelist:\nforeach($filelist-\u003egetFiles() as $file) {\n    echo \"File: \" . $file-\u003egetFilename() . \"\\n\";\n}\n\n// Download the file back from the filelist to a local directory:\n$filelist-\u003edownload(\"/home/photo.png\", \"avatar.png\");\n\n// Delete the file from the filelist:\n$filelist-\u003edelete(\"avatar.png\");\n```\n\n## Benefits\n\nOne of the benefits of using FileList vs regular files, is that you can swap storage backends.\n\nIt's quick and simple to write to files in directories directly, but as your application grows, you may want to start storing that data remotely in S3, GridFS, etc...\n\nUsing the FileList library, this becomes a simple matter of attaching a different driver.\nFor example, you can use the [objectstorage](http://www.github.com/linkorb/objectstorage) library to easily store your content in S3, GridFs, PDO etc.\n\n\n## Console tool\n\nThis library comes with a simple console application that uses the library.\nYou can use it for testing and introspection.\n\n### Example console commands:\n\n    # Upload a file to a filelist\n    bin/console filelist:upload user.joe.photos /home/test/avatar.png\n\n    # Download a file from a filelist\n    bin/console filelist:download user.joe.photos avatar.png /home/test/output.png\n\n    # List files on a filelist\n    bin/console filelist:list user.joe.photos\n\n    # Delete data from object storage\n    bin/console filelist:delete user.joe.photos avatar.png\n\n### Configuration file\n\nThe console tool can be configured using a configuration file.\n\nIt will look for a file called `filelist.conf` in the current directory. \nAlternatively it will look for `~/.filelist.conf` and finally for `/etc/filelist.conf`.\n\nYou can also specify a config file explicity by using the option `--config myconfig.conf`\n\n### Example config file:\n\nThis repository contains a file called `filelist.conf.dist` which you can use to copy to `filelist.conf` and add your own configuration. The comments in this file explain what options are available.\n\n## Features\n\n* PSR-0 compatible, works with composer and is registered on packagist.org\n* PSR-1 and PSR-2 level coding style\n* List, Upload, Download, Delete, Get and Set commands.\n* Included with command line utility for testing and introspection\n\n## Todo (Pull-requests welcome!)\n\n* Integrate github.com/linkorb/objectstorage for S3, GridFs, PDO support\n\n## Installing\n\nCheck out [composer](http://www.getcomposer.org) for details about installing and running composer.\n\nThen, add `linkorb/objectstorage` to your project's `composer.json`:\n\n```json\n{\n    \"require\": {\n        \"linkorb/filelist\": \"dev-master\"\n    }\n}\n```\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## License\n\nPlease check LICENSE.md for full license information\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Ffilelist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkorb%2Ffilelist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Ffilelist/lists"}