{"id":19357744,"url":"https://github.com/joomla-framework/filesystem","last_synced_at":"2025-04-04T12:05:52.836Z","repository":{"id":7094484,"uuid":"8385768","full_name":"joomla-framework/filesystem","owner":"joomla-framework","description":"Joomla Framework Filesystem Package","archived":false,"fork":false,"pushed_at":"2025-03-07T10:20:19.000Z","size":5611,"stargazers_count":10,"open_issues_count":10,"forks_count":19,"subscribers_count":13,"default_branch":"3.x-dev","last_synced_at":"2025-03-28T11:06:13.386Z","etag":null,"topics":["filesystem","joomla","joomla-framework","php"],"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/joomla-framework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"joomla","custom":"https://community.joomla.org/sponsorship-campaigns.html"}},"created_at":"2013-02-24T03:20:00.000Z","updated_at":"2025-03-07T09:57:42.000Z","dependencies_parsed_at":"2024-06-18T15:13:20.454Z","dependency_job_id":"64e6f2e3-65a0-4ab1-b041-b76c1876c4a8","html_url":"https://github.com/joomla-framework/filesystem","commit_stats":{"total_commits":248,"total_committers":22,"mean_commits":"11.272727272727273","dds":0.6088709677419355,"last_synced_commit":"ae40545bfe50d5b1cc94fbfbef4dd04a31460d1f"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Ffilesystem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Ffilesystem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Ffilesystem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Ffilesystem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joomla-framework","download_url":"https://codeload.github.com/joomla-framework/filesystem/tar.gz/refs/heads/3.x-dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174387,"owners_count":20896075,"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":["filesystem","joomla","joomla-framework","php"],"created_at":"2024-11-10T07:09:01.924Z","updated_at":"2025-04-04T12:05:52.813Z","avatar_url":"https://github.com/joomla-framework.png","language":"PHP","funding_links":["https://github.com/sponsors/joomla","https://community.joomla.org/sponsorship-campaigns.html"],"categories":[],"sub_categories":[],"readme":"# The Filesystem Package [![Build Status](https://ci.joomla.org/api/badges/joomla-framework/filesystem/status.svg?ref=refs/heads/3.x-dev)](https://ci.joomla.org/joomla-framework/filesystem)\n\n[![Latest Stable Version](https://poser.pugx.org/joomla/filesystem/v/stable)](https://packagist.org/packages/joomla/filesystem)\n[![Total Downloads](https://poser.pugx.org/joomla/filesystem/downloads)](https://packagist.org/packages/joomla/filesystem)\n[![Latest Unstable Version](https://poser.pugx.org/joomla/filesystem/v/unstable)](https://packagist.org/packages/joomla/filesystem)\n[![License](https://poser.pugx.org/joomla/filesystem/license)](https://packagist.org/packages/joomla/filesystem)\n\n## File upload example\n\n```php\nuse Joomla\\Filesystem\\File;\n\n$file = $this-\u003einput-\u003efiles-\u003eget('file');\n\n$config = array(\n    'extensions'    =\u003e 'jpg,jpeg,gif,png,pdf,doc,docx',\n    'max_size'      =\u003e 30000000, // 30 MB\n    'folder'        =\u003e 'documents'\n);\n\n// Check there is some file to upload\nif (empty($file['name']))\n{\n    return;\n}\n\n// Check max size\nif ($file['size'] \u003e $config['max_size'])\n{\n    throw new \\RuntimeException('Uploaded file size (' . round($file['size'] / 1000) . ' kB) is greater than allowed size (' . round($config['max_size'] / 1000) . ' kB).');\n}\n\n$config['extensions'] = explode(',', $config['extensions']);\n\n// Get File extension\n$ext = strtolower(substr($file['name'], (strrpos($file['name'], '.') + 1)));\n\n// Sanitize allowed extensions\nforeach ($config['extensions'] as \u0026$extension)\n{\n    $extension = str_replace('.', '', trim(strtolower($extension)));\n}\n\n// Check allowed extensions\nif (!in_array($ext, $config['extensions']))\n{\n    throw new \\RuntimeException('Uploaded file extension (' . $ext . ') is not within allowed extensions (' . implode(',', $config['extensions']) . ')');\n}\n\n$path = JPATH_ROOT . '/' . $config['folder'] . '/' . File::makeSafe($file['name']);\n\nFile::upload($file['tmp_name'], $path);\n```\n\n## Changes From 1.x\n\n### Patcher\n\nIn 1.x, the second parameter of the `add` and `addFile` methods was optional.  In 2.0, this parameter is required.  This parameter requires the\nroot path of the source which you are patching.\n\n## Installation via Composer\n\nAdd `\"joomla/filesystem\": \"~3.0\"` to the require block in your composer.json and then run `composer install`.\n\n```json\n{\n\t\"require\": {\n\t\t\"joomla/filesystem\": \"~3.0\"\n\t}\n}\n```\n\nAlternatively, you can simply run the following from the command line:\n\n```sh\ncomposer require joomla/filesystem \"~3.0\"\n```\n\nIf you want to include the test sources, use\n\n```sh\ncomposer require --prefer-source joomla/filesystem \"~3.0\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoomla-framework%2Ffilesystem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoomla-framework%2Ffilesystem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoomla-framework%2Ffilesystem/lists"}