{"id":28204520,"url":"https://github.com/jefyokta/oktaax","last_synced_at":"2026-02-16T16:01:55.341Z","repository":{"id":255738440,"uuid":"853564526","full_name":"jefyokta/oktaax","owner":"jefyokta","description":"A php openswoole microframework","archived":false,"fork":false,"pushed_at":"2025-06-06T07:42:13.000Z","size":374,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T06:34:19.763Z","etag":null,"topics":["async-php","express","micro-framework","openswoole-wrapper","php","php-express","php-websocket","real-time","swoole-framework"],"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/jefyokta.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,"zenodo":null}},"created_at":"2024-09-06T23:23:41.000Z","updated_at":"2025-05-29T06:37:02.000Z","dependencies_parsed_at":"2024-11-14T19:23:11.681Z","dependency_job_id":"5c94400d-83bd-4713-8dd9-df12fe36f1ac","html_url":"https://github.com/jefyokta/oktaax","commit_stats":null,"previous_names":["jefyokta/oktaax"],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/jefyokta/oktaax","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jefyokta%2Foktaax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jefyokta%2Foktaax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jefyokta%2Foktaax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jefyokta%2Foktaax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jefyokta","download_url":"https://codeload.github.com/jefyokta/oktaax/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jefyokta%2Foktaax/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29512229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-php","express","micro-framework","openswoole-wrapper","php","php-express","php-websocket","real-time","swoole-framework"],"created_at":"2025-05-17T06:11:40.402Z","updated_at":"2026-02-16T16:01:55.329Z","avatar_url":"https://github.com/jefyokta.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oktaax\n\n![Version](https://img.shields.io/badge/version-v2.0.0-blue)  \n![PHP](https://img.shields.io/badge/php-8.1%2B-blue)  \n![OpenSwoole](https://img.shields.io/badge/OpenSwoole-Compatible-orange)  \n![MIT License](https://img.shields.io/badge/license-MIT-green)  \n\n**Oktaax** is an OpenSwoole HTTP \u0026 WebSocket wrapper library. It is designed for developers who want to build high-performance, asynchronous PHP applications.\n\n---\n\n## ⚡ Quick Start\n\n### Requirements\n- PHP 8.1+  \n- Swoole PHP extension  \n\n---\n\n### Installation\n\nTo install **Oktaax**, use Composer:\n\n```bash\ncomposer require jefyokta/oktaax\n```\n\n---\n\n## Hello World HTTP Example\n\nCreate a file named `index.php` with the following content:\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse Oktaax\\Oktaax;\nuse Oktaax\\Http\\Request;\nuse Oktaax\\Http\\Response;\n\n$app = new Oktaax;\n\n$app-\u003eget(\"/\", function (Request $request, Response $response) {\n    $response-\u003eend(\"Hello World\");\n});\n\n$app-\u003elisten(3000);\n```\n\nRun the server with:\n\n```bash\nphp index.php\n```\n\nOpen your browser and navigate to [http://localhost:3000](http://localhost:3000).\n\n---\n\n## 🌐 All-In-One Server\n\nIf you need both HTTP and WebSocket support in one class, you can use the `HasWebsocket` trait:\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse Oktaax\\Oktaax;\nuse Oktaax\\Websocket\\HasWebsocket;\nuse Oktaax\\Http\\Request;\nuse Oktaax\\Http\\Response;\nuse Oktaax\\Websocket\\Client;\nuse Oktaax\\Websocket\\Server;\n\n$app = new class extends Oktaax {\n    use HasWebsocket;\n};\n\n$app-\u003eget(\"/user\", function (Request $request, Response $response) {\n    $response-\u003eend(\"User endpoint hit!\");\n});\n\n$app-\u003ews('welcome', function (Server $server, Client $client) {\n    $server-\u003ereply($client, \"Hi Client {$client-\u003efd}\");\n});\n\n$app-\u003elisten(3000);\n```\n\nRun the server as usual:\n\n```bash\nphp index.php\n```\n\n---\n\n## 📡 WebSocket \n\nHere is an example of creating a WebSocket **Channel**:\n\n###  Channel\n\nCreate a channel class that implements the `Channel` interface.\n\n```php\n\u003c?php\n\nuse Oktaax\\Interfaces\\Channel;\nuse Oktaax\\Websocket\\Client;\n\nclass EvenChannel implements Channel\n{\n    public function eligable(Client $client): bool\n    {\n        return $client-\u003efd % 2 === 0;\n    }\n}\n```\n\n\n\n```php\n\u003c?php\n\n$app-\u003ews('even', function (Server $server, Client $client) {\n    $server-\u003etoChannel(EvenChannel::class)-\u003ebroadcast(function ($client) {\n        return \"Hello {$client-\u003efd}! You have an even fd!\";\n    });\n});\n```\n\n---\n\n## HTTP\n\n```php\n\u003c?php\n\n$app = new Oktaax;\n\n$app\n    -\u003eget(\"/\", fn($request, $response) =\u003e $response-\u003eend(\"Welcome to Oktaax\"))\n    -\u003eget(\"/user/{username}\", function ($request, $response) {\n        $user = $request-\u003eparams['username'];\n        $response-\u003eend(\"Hello, {$user}\");\n    })\n    -\u003epost(\"/user\", function ($request, $response) {\n        $data = $request-\u003epost;\n        $response-\u003eend(\"User created with data: \" . json_encode($data));\n    })\n    -\u003eput(\"/user/{id}\", function ($request, $response) {\n        $id = $request-\u003eparams['id'];\n        $response-\u003eend(\"User {$id} updated\");\n    })\n    -\u003edelete(\"/user/{id}\", function ($request, $response) {\n        $id = $request-\u003eparams['id'];\n        $response-\u003eend(\"User {$id} deleted\");\n    });\n\n$app-\u003elisten(3000);\n```\n\n---\n\n## Trait and Server Options\n\n\n### ```Oktaax\\Oktaax``` \nis a class that include Requestable and WithBlade traits. You also can get it's instance with function oktaax()\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjefyokta%2Foktaax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjefyokta%2Foktaax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjefyokta%2Foktaax/lists"}