{"id":13616363,"url":"https://github.com/joanhey/AdapterMan","last_synced_at":"2025-04-14T00:32:13.369Z","repository":{"id":57000544,"uuid":"288687341","full_name":"joanhey/AdapterMan","owner":"joanhey","description":"Run almost any PHP app faster and asynchronously with Workerman, without touch 1 line of code in your fw or app. Also use it as Serverless.","archived":false,"fork":false,"pushed_at":"2024-10-19T22:10:49.000Z","size":393,"stargazers_count":748,"open_issues_count":29,"forks_count":48,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-11-06T13:40:16.747Z","etag":null,"topics":["async","event","event-loop","high-performance","php","php-runtime","serverless","workerman"],"latest_commit_sha":null,"homepage":"https://twitter.com/adaptermanphp","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/joanhey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","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},"funding":{"github":["joanhey"]}},"created_at":"2020-08-19T09:17:46.000Z","updated_at":"2024-11-05T15:29:50.000Z","dependencies_parsed_at":"2024-02-25T13:44:22.764Z","dependency_job_id":"d2067474-6b41-4557-bc0b-8cb0ebc9d7b6","html_url":"https://github.com/joanhey/AdapterMan","commit_stats":{"total_commits":121,"total_committers":4,"mean_commits":30.25,"dds":0.05785123966942152,"last_synced_commit":"848943ae2d8ce131a3916257634235a604010905"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joanhey%2FAdapterMan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joanhey%2FAdapterMan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joanhey%2FAdapterMan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joanhey%2FAdapterMan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joanhey","download_url":"https://codeload.github.com/joanhey/AdapterMan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223611945,"owners_count":17173541,"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":["async","event","event-loop","high-performance","php","php-runtime","serverless","workerman"],"created_at":"2024-08-01T20:01:27.514Z","updated_at":"2025-04-14T00:32:13.346Z","avatar_url":"https://github.com/joanhey.png","language":"PHP","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/249085/200214022-c2c45753-368c-4e28-8415-2b3cadca9907.png\" /\u003e\n  \n\u003c/p\u003e\n\n[![Tests Adapterman](https://github.com/joanhey/AdapterMan/actions/workflows/test.yml/badge.svg)](https://github.com/joanhey/AdapterMan/actions/workflows/test.yml)\n[![GitHub release](https://img.shields.io/github/release/joanhey/adapterman.svg)](https://github.com/joanhey/adapterman/releases/latest)\n[![GitHub](https://img.shields.io/github/license/joanhey/adapterman)](https://github.com/joanhey/AdapterMan/blob/master/LICENSE.txt)\n\nFaster and more scalable apps, also use it as Serverless.\n\nRun almost any PHP app with the async event driven [Workerman](https://github.com/walkor/workerman), without touch 1 line of code in your fw or app.\n\nIf your app or fw use a Front Controller, 99% that will work. Requires minimun PHP 8.0.\n\nActually working with:\n- Symfony\n- Laravel\n- CakePHP\n- Yii2\n- Slim\n- KumbiaPHP\n- ThinkPHP\n- Leaf\n- FlightPHP\n- ... (Your app?)\n\nStill testing with more fws and apps.\nWithout touch a line of code.\n\n### NEW !!! Workerman shared nothing mode\nWe started to test it. Experimental still.\n\nEach request is independent and load the .php file, like with PHP-FPM.\nUsing the same .php files.\n\n![image](https://user-images.githubusercontent.com/249085/209589643-5b464656-4d44-4879-9bbc-deb49582a57b.png)\n\n\nFramework | JSON | 1-query | Multiple queries | Fortunes | Updates | Plaintext\n-- | -- | -- | -- | -- | -- | --\nphp php-fpm| 187,747 | 97,658 | 12,784 | 79,309 | 2,010 | 195,283\nphp workerman | 822,930 | 134,475 | 15,648 | 124,923 | 4,683 | 1,161,016\n\n\n\n## Performance bench Worker mode\nResults from **Techempower benchmark.\nWithout touch a line of code.**\n\nFollow https://twitter.com/adaptermanphp for more updates.\n\n\n### Symfony 6\nWith full ORM\n![image](https://user-images.githubusercontent.com/249085/209320777-13d1cc25-f350-43a4-ba2f-4db0a92c7b7a.png)\nLatency\n![image](https://user-images.githubusercontent.com/249085/209321052-6dab2d0e-c630-48d8-a25c-5f1906f08b8f.png)\n\n\nFw | Plaintext | Json | Single query | Multiple query | Updates | Fortunes\n -- | --| -- | -- | -- | -- | -- \nSymfony | 38,231 | 37,557 | 12,578 | 10,741 | 3,420 | 10,741\n**Symfony Workerman** | **210,796** | **197,059** | **107,050** | **13,401** | **4,062** | **71,092**\n\n### Laravel 8\nWith full ORM.\n\n Fw | Plaintext | Json | Single query | Multiple query | Updates | Fortunes\n -- | --| -- | -- | -- | -- | -- \nLaravel | 14,799 | 14,770 | 9,263 | 3,247 | 1,452 | 8,354\nLaravel Roadrunner | 482 | 478 | 474 | 375 | 359 | 472\nLaravel Swoole | 38,824 | 37,439 | 21,687 | 3,958 | 1,588 | 16,035 \nLaravel Laravel s | 54,617 | 49,372 | 23,677 | 2,917 | 1,255 | 16,696 \n**Laravel Workerman** | **103,004** | **99,891** | **46,001** | **5,828** | **1,666** | **27,158** \n\n![image](https://user-images.githubusercontent.com/249085/200189417-06fa658b-92c3-4c6d-a6e4-1efb3446a513.png)\nLatency\n![image](https://user-images.githubusercontent.com/249085/200189427-99977bb7-5910-4d17-a47c-7242e8f95f8f.png)\n\n\n\n### Slim with Workerman\nWithout ORM\n![image](https://user-images.githubusercontent.com/249085/201919385-ad25e41b-9887-42b7-92c0-d524a5e6aeae.png)\n\nFramework | Plaintext | JSON | 1-query | 20-query | Updates | Fortunes \n-- | -- | -- | -- | -- | -- | --\nSlim 4   | 35,251 | 38,305 | 34,272 | 12,579 | 2,097 | 32,634  \n**Slim 4 Workerman** | **134,531** | **129,393** | **81,889** | **15,803** | **2,456** | **73,212** \nSlim 4 Workerman pgsql * |   |   | 102,926 | 19,637 | 14,875 | 92,752 \n\n* Without ORM and db class optimized for Workerman\n\n### Symfony demo with Workerman\nSymfony initialization 0ms and half the time per request.\n\nhttps://user-images.githubusercontent.com/249085/197399760-5da8311e-5cf1-426a-a89d-ec2a2de43af0.mp4\n\n## Installation\n```\ncomposer require joanhey/adapterman\n```\nAutomatically install Workerman too.\n\n## Tree\nWhere to create the files (`server.php` and `start.php`)\n\n```\n.\n├── app(dir)\n├── public(dir)\n├── vendor(dir)\n├── composer.json\n├── server.php\n└── start.php\n```\n\n## Server\nserver.php\n```php\n\u003c?php\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\nuse Adapterman\\Adapterman;\nuse Workerman\\Worker;\n\nAdapterman::init();\n\n$http_worker                = new Worker('http://0.0.0.0:8080');\n$http_worker-\u003ecount         = 8;\n$http_worker-\u003ename          = 'AdapterMan';\n\n$http_worker-\u003eonWorkerStart = static function () {\n    //init();\n    require __DIR__.'/start.php';\n};\n\n$http_worker-\u003eonMessage = static function ($connection, $request) {\n\n    $connection-\u003esend(run());\n};\n\nWorker::runAll();\n\n```\n## Front Controller\n\nIt's different for any fw and app.\n\nWe are creating recipes for popular apps and frameworks.\n\n- [Symfony](recipes/symfony.md)\n- [Laravel](recipes/laravel.md)\n- [Lumen](recipes/lumen.md)\n- [Slim](recipes/slim.md)\n\nRecommended `start.php` and leave `index.php` in public.\n\nWe can run the app with Workerman and with php-fpm at the same time.\n\n\n## Available commands in workerman\nTo run your app.\n\n```php server.php start  ```  \n```php server.php start -d  ```  \n```php server.php status  ```  \n```php server.php status -d  ```  \n```php server.php connections```  \n```php server.php stop  ```  \n```php server.php stop -g  ```  \n```php server.php restart  ```  \n```php server.php reload  ```  \n```php server.php reload -g  ```\n\nWorkerman documentation:\n[https://github.com/walkor/workerman-manual](https://github.com/walkor/workerman-manual/blob/master/english/SUMMARY.md)\n\nYou can also select a diferent cli php.ini directly:\n\n```php -c cli-php.ini server.php start```\n\n### Help with session issues\nI was using this lib internally, for more than 2 years, to run legacy apps with Workerman.\n\nWe made it for APIs and microservices. So the session is not well tested.\n\n#### Login progress\nIt's working with Symfony and Laravel\n\nLaravel Orchid admin panel.\n![image](https://user-images.githubusercontent.com/249085/197333441-74fff586-b984-492f-8cd1-58fb69774b1f.png)\n\nDrupal showing public pages.\n![image](https://user-images.githubusercontent.com/249085/197333512-0f840436-399f-4000-b9af-e6a05a7d30b2.png)\n\n","funding_links":["https://github.com/sponsors/joanhey"],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoanhey%2FAdapterMan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoanhey%2FAdapterMan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoanhey%2FAdapterMan/lists"}