{"id":21467454,"url":"https://github.com/elusivecodes/fyrefilesystem","last_synced_at":"2025-07-15T05:31:33.456Z","repository":{"id":62508429,"uuid":"441407989","full_name":"elusivecodes/FyreFileSystem","owner":"elusivecodes","description":"FyreFileSystem is a free, open-source file/folder library for PHP.","archived":false,"fork":false,"pushed_at":"2024-10-28T08:06:13.000Z","size":156,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-28T09:13:43.864Z","etag":null,"topics":["file","file-system","folder","php"],"latest_commit_sha":null,"homepage":"","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/elusivecodes.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-24T08:14:56.000Z","updated_at":"2024-10-28T08:06:03.000Z","dependencies_parsed_at":"2024-06-29T07:50:06.083Z","dependency_job_id":null,"html_url":"https://github.com/elusivecodes/FyreFileSystem","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreFileSystem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreFileSystem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreFileSystem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreFileSystem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elusivecodes","download_url":"https://codeload.github.com/elusivecodes/FyreFileSystem/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226017521,"owners_count":17560530,"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":["file","file-system","folder","php"],"created_at":"2024-11-23T08:18:08.489Z","updated_at":"2024-11-23T08:18:10.444Z","avatar_url":"https://github.com/elusivecodes.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FyreFileSystem\r\n\r\n**FyreFileSystem** is a free, open-source file/folder library for *PHP*.\r\n\r\n\r\n## Table Of Contents\r\n- [Installation](#installation)\r\n- [Files](#files)\r\n- [Folders](#folders)\r\n\r\n\r\n\r\n## Installation\r\n\r\n**Using Composer**\r\n\r\n```\r\ncomposer require fyre/filesystem\r\n```\r\n\r\nIn PHP:\r\n\r\n```php\r\nuse Fyre\\FileSystem\\File;\r\nuse Fyre\\FileSystem\\Folder;\r\n```\r\n\r\n\r\n## Files\r\n\r\n- `$path` is a string representing the file path.\r\n- `$create` is a boolean indicating whether to create the file if it doesn't exist, and will default to *false*.\r\n\r\n```php\r\n$file = new File($path, $create);\r\n```\r\n\r\n**Access Time**\r\n\r\nGet the file access time.\r\n\r\n```php\r\n$accessTime = $file-\u003eaccessTime();\r\n```\r\n\r\n**Base Name**\r\n\r\nGet the filename.\r\n\r\n```php\r\n$baseName = $file-\u003ebaseName();\r\n```\r\n\r\n**Chmod**\r\n\r\nChange the file permissions.\r\n\r\n- `$permissions` is a number representing the file permissions.\r\n\r\n```php\r\n$file-\u003echmod($permissions);\r\n```\r\n\r\n**Close**\r\n\r\nClose the file handle.\r\n\r\n```php\r\n$file-\u003eclose();\r\n```\r\n\r\n**Contents**\r\n\r\nGet the contents of the file.\r\n\r\n```php\r\n$contents = $file-\u003econtents();\r\n```\r\n\r\n**Copy**\r\n\r\nCopy the file to a new destination.\r\n\r\n- `$destination` is a string representing the destination path.\r\n- `$overwrite` is a boolean indicating whether to overwrite an existing file, and will default to *true*.\r\n\r\n```php\r\n$file-\u003ecopy($destination, $overwrite);\r\n```\r\n\r\n**Create**\r\n\r\nCreate the file.\r\n\r\n```php\r\n$file-\u003ecreate();\r\n```\r\n\r\n**Csv**\r\n\r\nParse CSV values from a file.\r\n\r\n- `$length` is a number representing the maximum line length, and will default to *0*.\r\n- `$separator` is a string representing the field separator, and will default to \"*,*\".\r\n- `$enclosure` is a string representing the field enclosure character, and will default to \"*\"*\".\r\n- `$escape` is a string representing the escape character, and will default to \"*\\\\*\".\r\n\r\n```php\r\n$data = $file-\u003ecsv($length, $separator, $enclosure, $escape);\r\n```\r\n\r\n**Delete**\r\n\r\nDelete the file.\r\n\r\n```php\r\n$file-\u003edelete();\r\n```\r\n\r\n**Dir Name**\r\n\r\nGet the directory name.\r\n\r\n```php\r\n$dirName = $file-\u003edirName();\r\n```\r\n\r\n**Ended**\r\n\r\nDetermine whether the pointer is at the end of the file.\r\n\r\n```php\r\n$ended = $file-\u003eended();\r\n```\r\n\r\n**Exists**\r\n\r\nDetermine whether the file exists.\r\n\r\n```php\r\n$exists = $file-\u003eexists();\r\n```\r\n\r\n**Extension**\r\n\r\nGet the file extension.\r\n\r\n```php\r\n$extension = $file-\u003eextension();\r\n```\r\n\r\n**File Name**\r\n\r\nGet the filename (without extension).\r\n\r\n```php\r\n$fileName = $file-\u003efileName();\r\n```\r\n\r\n**Folder**\r\n\r\nGet the *Folder*.\r\n\r\n```php\r\n$folder = $file-\u003efolder();\r\n```\r\n\r\n**Group**\r\n\r\nGet the file group.\r\n\r\n```php\r\n$group = $file-\u003egroup();\r\n```\r\n\r\n**Is Executable**\r\n\r\nDetermine whether the file is executable.\r\n\r\n```php\r\n$isExecutable = $file-\u003eisExecutable();\r\n```\r\n\r\n**Is Readable**\r\n\r\nDetermine whether the file is readable.\r\n\r\n```php\r\n$isReadable = $file-\u003eisReadable();\r\n```\r\n\r\n**Is Writable**\r\n\r\nDetermine whether the file is writable.\r\n\r\n```php\r\n$isWritable = $file-\u003eisWritable();\r\n```\r\n\r\n**Lock**\r\n\r\nLock the file handle.\r\n\r\n- `$operation` is a number representing the lock operation, and will default to *LOCK_SH*.\r\n\r\n```php\r\n$lock = $file-\u003elock($operation);\r\n```\r\n\r\n**MIME Type**\r\n\r\nGet the MIME content type.\r\n\r\n```php\r\n$mimeType = $file-\u003emimeType();\r\n```\r\n\r\n**Modified Time**\r\n\r\nGet the file modified time.\r\n\r\n```php\r\n$modifiedTime = $file-\u003emodifiedTime();\r\n```\r\n\r\n**Open**\r\n\r\nOpen a file handle.\r\n\r\n- `$mode` is a string representing the access mode, and will default to \"*r*\".\r\n\r\n```php\r\n$open = $file-\u003eopen($mode);\r\n```\r\n\r\n**Owner**\r\n\r\nGet the file owner.\r\n\r\n```php\r\n$owner = $file-\u003eowner();\r\n```\r\n\r\n**Path**\r\n\r\nGet the full path to the file.\r\n\r\n```php\r\n$path = $file-\u003epath();\r\n```\r\n\r\n**Permissions**\r\n\r\nGet the file permissions.\r\n\r\n```php\r\n$permissions = $file-\u003epermissions();\r\n```\r\n\r\n**Read**\r\n\r\nRead file data.\r\n\r\n- `$length` is a number representing the number of bytes to read.\r\n\r\n```php\r\n$data = $file-\u003eread($length);\r\n```\r\n\r\n**Rewind**\r\n\r\nRewind the pointer position.\r\n\r\n```php\r\n$file-\u003erewind();\r\n```\r\n\r\n**Seek**\r\n\r\nMove the pointer position.\r\n\r\n- `$offset` is a number representing the pointer position.\r\n\r\n```php\r\n$file-\u003eseek($offset);\r\n```\r\n\r\n**Size**\r\n\r\nGet the size of the file (in bytes).\r\n\r\n```php\r\n$size = $file-\u003esize();\r\n```\r\n\r\n**Tell**\r\n\r\nGet the current pointer position.\r\n\r\n```php\r\n$offset = $file-\u003etell();\r\n```\r\n\r\n**Touch**\r\n\r\nTouch the file.\r\n\r\n- `$time` is a number representing the modified timestamp, and will default to `time()`.\r\n- `$accessTime` is a number representing the access timestamp, and will default to `$time`.\r\n\r\n```php\r\n$file-\u003etouch($time, $accessTime);\r\n```\r\n\r\n**Truncate**\r\n\r\nTruncate the file.\r\n\r\n- `$size` is a number representing the size to truncate to, and will default to *0*.\r\n\r\n```php\r\n$file-\u003etruncate($size);\r\n```\r\n\r\n**Unlock**\r\n\r\nUnlock the file handle.\r\n\r\n```php\r\n$file-\u003eunlock();\r\n```\r\n\r\n**Write**\r\n\r\nWrite data to the file.\r\n\r\n- `$data` is a string representing the data to write.\r\n\r\n```php\r\n$file-\u003ewrite($data);\r\n```\r\n\r\n\r\n## Folders\r\n\r\n- `$path` is a string representing the folder path.\r\n- `$create` is a boolean indicating whether to create the folder if it doesn't exist, and will default to *false*.\r\n- `$permissions` is a number representing the permissions to create the folder with, and will default to *0755*.\r\n\r\n```php\r\n$folder = new Folder($path, $create, $permissions);\r\n```\r\n\r\n**Contents**\r\n\r\nGet the contents of the folder.\r\n\r\n```php\r\n$contents = $folder-\u003econtents();\r\n```\r\n\r\nThis method will return an array containing the contents of the folder, as *File* and *Folder* objects.\r\n\r\n**Copy**\r\n\r\nCopy the folder to a new destination.\r\n\r\n- `$destination` is a string representing the destination path.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing files, and will default to *true*.\r\n\r\n```php\r\n$folder-\u003ecopy($destination, $overwrite);\r\n```\r\n\r\n**Create**\r\n\r\nCreate the folder.\r\n\r\n- `$permissions` is a number representing the permissions to create the folder with, and will default to *0755*.\r\n\r\n```php\r\n$folder-\u003ecreate($permissions);\r\n```\r\n\r\n**Delete**\r\n\r\nDelete the folder (including all contents).\r\n\r\n```php\r\n$folder-\u003edelete();\r\n```\r\n\r\n**Empty**\r\n\r\nEmpty the folder.\r\n\r\n```php\r\n$folder-\u003eempty();\r\n```\r\n\r\n**Exists**\r\n\r\nDetermine whether the folder exists.\r\n\r\n```php\r\n$exists = $folder-\u003eexists();\r\n```\r\n\r\n**Is Empty**\r\n\r\nDetermine whether the folder is empty.\r\n\r\n```php\r\n$isEmpty = $folder-\u003eisEmpty();\r\n```\r\n\r\n**Move**\r\n\r\nMove the folder to a new destination.\r\n\r\n- `$destination` is a string representing the destination path.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing files, and will default to *true*.\r\n\r\n```php\r\n$folder-\u003emove($destination, $overwrite);\r\n```\r\n\r\n**Name**\r\n\r\nGet the folder name.\r\n\r\n```php\r\n$name = $folder-\u003ename();\r\n```\r\n\r\n**Path**\r\n\r\nGet the full path to the folder.\r\n\r\n```php\r\n$path = $folder-\u003epath();\r\n```\r\n\r\n**Size**\r\n\r\nGet the size of the folder (in bytes).\r\n\r\n```php\r\n$size = $folder-\u003esize();\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyrefilesystem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felusivecodes%2Ffyrefilesystem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyrefilesystem/lists"}