{"id":17085587,"url":"https://github.com/kriswallsmith/spork","last_synced_at":"2025-05-15T20:07:07.802Z","repository":{"id":2963888,"uuid":"3978556","full_name":"kriswallsmith/spork","owner":"kriswallsmith","description":"Experimental library for forking PHP","archived":false,"fork":false,"pushed_at":"2016-03-17T13:22:16.000Z","size":381,"stargazers_count":586,"open_issues_count":24,"forks_count":52,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-04-08T02:41:18.629Z","etag":null,"topics":[],"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/kriswallsmith.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2012-04-10T03:31:04.000Z","updated_at":"2025-04-03T20:30:42.000Z","dependencies_parsed_at":"2022-08-21T14:50:53.756Z","dependency_job_id":null,"html_url":"https://github.com/kriswallsmith/spork","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriswallsmith%2Fspork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriswallsmith%2Fspork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriswallsmith%2Fspork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriswallsmith%2Fspork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kriswallsmith","download_url":"https://codeload.github.com/kriswallsmith/spork/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414499,"owners_count":22067272,"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-10-14T13:25:17.754Z","updated_at":"2025-05-15T20:07:02.607Z","avatar_url":"https://github.com/kriswallsmith.png","language":"PHP","funding_links":[],"categories":["杂项","杂项 Miscellaneous","Miscellaneous","Configuration"],"sub_categories":["Miscellaneous"],"readme":"[![Build Status](https://secure.travis-ci.org/kriswallsmith/spork.png?branch=master)](http://travis-ci.org/kriswallsmith/spork)\n\nSpork: PHP on a Fork\n--------------------\n\n```php\n\u003c?php\n\n$manager = new Spork\\ProcessManager();\n$manager-\u003efork(function() {\n    // do something in another process!\n    return 'Hello from '.getmypid();\n})-\u003ethen(function(Spork\\Fork $fork) {\n    // do something in the parent process when it's done!\n    echo \"{$fork-\u003egetPid()} says '{$fork-\u003egetResult()}'\\n\";\n});\n```\n\n### Example: Upload images to your CDN\n\nFeed an iterator into the process manager and it will break the job into\nmultiple batches and spread them across many processes.\n\n```php\n\u003c?php\n\n$files = new RecursiveDirectoryIterator('/path/to/images');\n$files = new RecursiveIteratorIterator($files);\n\n$manager-\u003eprocess($files, function(SplFileInfo $file) {\n    // upload this file\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkriswallsmith%2Fspork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkriswallsmith%2Fspork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkriswallsmith%2Fspork/lists"}