Skip to content

Commit 8bd3d30

Browse files
committed
Fix for #7. Added PHP 8 Support
1 parent 959e1d6 commit 8bd3d30

11 files changed

+37
-17
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To get a local copy up and running follow these simple example steps.
4949
### Prerequisites
5050

5151
- PHP 7.2+
52-
- CodeIgniter Framework (4.* recommanded)
52+
- CodeIgniter Framework (4.* recommended)
5353
- Composer
5454
- PHP sockets extension enabled
5555

@@ -80,6 +80,11 @@ PHP spark serve --port=9092
8080
```sh
8181
php public/index.php Websocket start
8282
```
83+
**N.B** : Don't forget to add the following line in app/Config/Routes.php `app/Config/Routes.php`
84+
85+
```php
86+
$routes->setAutoRoute(true);
87+
```
8388

8489
**WOW You made it !!!** :heavy_check_mark:
8590

composer.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"codeigniter",
66
"codeigniter4",
77
"php7",
8+
"php8",
89
"php-library",
910
"codeigniter websocket",
1011
"websocket",
@@ -22,9 +23,9 @@
2223
}
2324
],
2425
"require": {
25-
"php": "^7.2",
26-
"cboden/ratchet": "^0.4.1",
27-
"textalk/websocket": "^1.2"
26+
"php": "^7.2|^8.0",
27+
"cboden/ratchet": "^0.4.4",
28+
"textalk/websocket": "^1.6.3"
2829
},
2930
"require-dev": {
3031
"codeigniter4/framework": "dev-master"

src/Commands/Publish.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php namespace Takielias\CodeigniterWebsocket\Commands;
1+
<?php
2+
3+
namespace Takielias\CodeigniterWebsocket\Commands;
24

35
use Config\Autoload;
46
use CodeIgniter\CLI\CLI;
@@ -13,7 +15,6 @@
1315
*
1416
* CodeIgniter WebSocket library. It allows you to make powerful realtime applications by using Ratchet Websocket
1517
*/
16-
1718
class Publish extends BaseCommand
1819
{
1920
/**

src/Config/CodeigniterWebsocket.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php namespace Takielias\CodeigniterWebsocket\Config;
1+
<?php
2+
3+
namespace Takielias\CodeigniterWebsocket\Config;
24

35
use CodeIgniter\Config\BaseConfig;
46

src/Config/Services.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php namespace Takielias\CodeigniterWebsocket\Config;
1+
<?php
2+
3+
namespace Takielias\CodeigniterWebsocket\Config;
24

35
use CodeIgniter\Config\BaseService;
46
use CodeIgniter\Config\BaseConfig;
@@ -12,7 +14,6 @@
1214
*
1315
* CodeIgniter WebSocket library. It allows you to make powerful realtime applications by using Ratchet Websocket
1416
*/
15-
1617
class Services extends BaseService
1718
{
1819
public static function CodeigniterWebsocket(BaseConfig $config = null, bool $getShared = true)

src/Controllers/Websocket.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php namespace Takielias\CodeigniterWebsocket\Controllers;
1+
<?php
2+
3+
namespace Takielias\CodeigniterWebsocket\Controllers;
24

35
use CodeIgniter\Controller;
46

src/Exceptions/CodeigniterWebsocketException.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php namespace Takielias\CodeigniterWebsocket\Exceptions;
1+
<?php
2+
3+
namespace Takielias\CodeigniterWebsocket\Exceptions;
24

35
use CodeIgniter\Exceptions\ExceptionInterface;
46
use CodeIgniter\Exceptions\FrameworkException;
@@ -12,7 +14,6 @@
1214
*
1315
* CodeIgniter WebSocket library. It allows you to make powerful realtime applications by using Ratchet Websocket
1416
*/
15-
1617
class CodeigniterWebsocketException extends FrameworkException implements ExceptionInterface
1718
{
1819
public static function forMissingName()

src/Libraries/Authorization.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php namespace Takielias\CodeigniterWebsocket\Libraries;
1+
<?php
2+
3+
namespace Takielias\CodeigniterWebsocket\Libraries;
24

35
use Takielias\CodeigniterWebsocket\Libraries\JWT;
46

@@ -11,7 +13,6 @@
1113
*
1214
* CodeIgniter WebSocket library. It allows you to make powerful realtime applications by using Ratchet Websocket
1315
*/
14-
1516
class Authorization
1617
{
1718
public static function validateTimestamp($token)

src/Libraries/CodeigniterWebsocket.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php namespace Takielias\CodeigniterWebsocket\Libraries;
1+
<?php
2+
3+
namespace Takielias\CodeigniterWebsocket\Libraries;
24

35
use CodeIgniter\Config\BaseConfig;
46
use Ratchet\Http\HttpServer;

src/Libraries/JWT.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php namespace Takielias\CodeigniterWebsocket\Libraries;
1+
<?php
2+
3+
namespace Takielias\CodeigniterWebsocket\Libraries;
24

35
/**
46
* JSON Web Token implementation, based on this spec:

src/Libraries/Server.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php namespace Takielias\CodeigniterWebsocket\Libraries;
1+
<?php
2+
3+
namespace Takielias\CodeigniterWebsocket\Libraries;
24

35
use CodeIgniter\Config\BaseConfig;
46
use Ratchet\ConnectionInterface;

0 commit comments

Comments
 (0)