{"id":21840198,"url":"https://github.com/gocom/eien","last_synced_at":"2025-07-20T17:32:57.632Z","repository":{"id":8537513,"uuid":"10156968","full_name":"gocom/eien","owner":"gocom","description":"PHP library for managing temporary files","archived":false,"fork":false,"pushed_at":"2013-12-12T15:26:13.000Z","size":356,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T15:43:00.623Z","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/gocom.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":"2013-05-19T15:05:23.000Z","updated_at":"2013-12-12T15:26:13.000Z","dependencies_parsed_at":"2022-09-13T22:21:23.211Z","dependency_job_id":null,"html_url":"https://github.com/gocom/eien","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gocom/eien","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocom%2Feien","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocom%2Feien/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocom%2Feien/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocom%2Feien/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gocom","download_url":"https://codeload.github.com/gocom/eien/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocom%2Feien/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266165711,"owners_count":23886668,"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-27T21:25:08.248Z","updated_at":"2025-07-20T17:32:57.615Z","avatar_url":"https://github.com/gocom.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Eien - PHP, have a temporary file\n====\n\n[Packagist](https://packagist.org/packages/rah/eien) | [Twitter](http://twitter.com/gocom) | [Issues](https://github.com/gocom/eien/issues) | [![Build Status](https://travis-ci.org/gocom/eien.png?branch=master)](https://travis-ci.org/gocom/eien)\n\nEien is a small PHP helper library for handling temporary files. Get, create, make, remove and flush temporary files and directories. Currently unstable, work in progress.\n\nBasic usage\n----\n\n### Get a path to an available temporary file\n\n```php\necho (string) new Rah_Eien_Temporary_File();\n```\n\n### Create a temporary file and move it to its final location once done\n\nThe file is moved to location specified with the optional Rah_Eien_File::$final option, if defined. The moving is performed once there are no other references to the instance, script is closed or when the move() method is called.\n\n```php\n$tmp = new Rah_Eien_File();\n$tmp-\u003efinal('/path/to/final/location.txt');\n$file = new Rah_Eien_Temporary_File($tmp);\n```\n\nIf you want moving to happen automatically, the easiest ways are extending, which allows you to perform your actions within it, unsetting the instance once you are done with it or wrapping the instance to its own contexts, like an anonymous function.\n\n### Make a temporary file from an existing file\n\nIn addition to creating brand new temporary files, or getting paths as strings, you can also create temporary file instances from other files. The specified files are copied to your temporary directory, and you get an instance point to the new temporary instance.\n\n```php\n$tmp = new Rah_Eien_File();\n$tmp-\u003efile('/path/to/source/file.txt');\necho (string) new Rah_Eien_Temporary_File($tmp);\n```\n\n### Create a new temporary directory and return its path\n\n```php\necho (string) new Rah_Eien_Temporary_Directory();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgocom%2Feien","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgocom%2Feien","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgocom%2Feien/lists"}