{"id":15908083,"url":"https://github.com/skoniks/php_cent","last_synced_at":"2025-03-22T00:31:27.930Z","repository":{"id":57052635,"uuid":"80307799","full_name":"skoniks/php_cent","owner":"skoniks","description":" Centrifugo (Centrifuge) [1.0+] PHP Server REDIS \u0026 HTTP API implementation for Laravel 5+","archived":false,"fork":false,"pushed_at":"2018-11-03T08:05:41.000Z","size":19,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T06:34:54.886Z","etag":null,"topics":["centrifugo","laravel","laravel5","php","php-server-redis","predis","redis","redis-connection","redis-transport"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skoniks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-28T20:11:39.000Z","updated_at":"2023-11-10T20:22:38.000Z","dependencies_parsed_at":"2022-08-24T05:21:00.414Z","dependency_job_id":null,"html_url":"https://github.com/skoniks/php_cent","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skoniks%2Fphp_cent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skoniks%2Fphp_cent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skoniks%2Fphp_cent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skoniks%2Fphp_cent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skoniks","download_url":"https://codeload.github.com/skoniks/php_cent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244890102,"owners_count":20527030,"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":["centrifugo","laravel","laravel5","php","php-server-redis","predis","redis","redis-connection","redis-transport"],"created_at":"2024-10-06T14:09:33.038Z","updated_at":"2025-03-22T00:31:27.652Z","avatar_url":"https://github.com/skoniks.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# skoniks / php_cent\nCentrifugo (Centrifuge) [1.0+] PHP Server REDIS \u0026 HTTP API implementation for Laravel 5+\nIncompatible with Centrifugo [2.0+], will be updated later!\n## Base Installation\n1. Run `composer require skoniks/php_cent` \u0026 `composer update`\n2. Create `config/centrifugo.php` as provided below\n3. Add alias in `config/app.php` as provided below\n\n\u003eFor laravel 5.5+ use version \u003e= \"2.5\"\n\n## Config example `config/centrifugo.php`\n[centrifugo.php](https://github.com/skoniks/php_cent/blob/master/centrifugo.php)\n\n## Alias additions `config/app.php`\n```php\n    'aliases' =\u003e [\n        ...\n        'Centrifugo'=\u003e SKONIKS\\Centrifugo\\Centrifugo::class,\n    ]\n    \n```\n\n## Setting redis as transport\n1. Add your redis connection to `config/database.php`\n2. Change `config/centrifugo.php` to redis settings\n\n## Adding redis connection `config/database.php`\n```php\n...\n    'redis' =\u003e [\n        ...\n        'centrifugo' =\u003e [\n            'host' =\u003e '127.0.0.1',\n            'password' =\u003e '',\n            'port' =\u003e 6379,\n            'database' =\u003e 1,\n        ],\n    ],\n...\n```\n\n## Redis supported transport\n\u003eMake shure that **HTTP connection must work independently from redis connection**.\n\u003eIt is because redis transport provides only this methods:\n* 'publish' \n* 'broadcast' \n* 'unsubscribe' \n* 'disconnect'\n\n\u003eRedis dont provide this methods:\n* presence\n* history\n* channels\n* stats\n* node\n\n## [Module usage || sending your requests] example\n```php\n\u003c?php\nuse Centrifugo;\nclass Controller {\n    public function _function(){\n        // declare Centrifugo\n        $centrifugo = new Centrifugo();\n\n        // generating token example\n        $current_time = time();\n        $user_id = '1234567890';\n        $token = Centrifugo::token($user_id, $current_time, 'custom info');\n                                \n        // publishing example\n        $centrifugo-\u003epublish(\"channel\" , [\"custom data\"]);\n        \n        // list of awailible methods: \n        $response = $centrifugo-\u003epublish($channel, $data);\n        $response = $centrifugo-\u003eunsubscribe($channel, $user_id);\n        $response = $centrifugo-\u003edisconnect($user_id);\n        $response = $centrifugo-\u003epresence($channel);\n        $response = $centrifugo-\u003ehistory($channel);\n        $response = $centrifugo-\u003echannels();\n        $response = $centrifugo-\u003estats();\n        $response = $centrifugo-\u003enode();\n        $token = Centrifugo::token($user_id, $timestamp, $info);\n                                \n        // $response == false | when error\n    }\n```\n### For more information go [here](https://fzambia.gitbooks.io/centrifugal/content/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskoniks%2Fphp_cent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskoniks%2Fphp_cent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskoniks%2Fphp_cent/lists"}