Skip to content

Commit 0e77b47

Browse files
authored
[php] Fix and update Comet (#8245)
* Fix comet * Fortunes delete withHeader() as use the default
1 parent 0ab3262 commit 0e77b47

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

frameworks/PHP/comet/app.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function() {
3535
function ($request, $response) {
3636
return $response
3737
->with('Hello, World!')
38+
->withHeader('Content-Type', 'text/plain; charset=utf-8')
3839
->withHeader('Date', Storage::$date);
3940
});
4041

frameworks/PHP/comet/benchmark_config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"display_name": "comet",
2424
"notes": "",
2525
"versus": "workerman",
26-
"tags": ["broken"]
26+
"tags": []
2727
},
2828
"mysql": {
2929
"db_url": "/db",
@@ -45,7 +45,7 @@
4545
"display_name": "comet-mysql",
4646
"notes": "",
4747
"versus": "workerman",
48-
"tags": ["broken"]
48+
"tags": []
4949
}
5050
}]
5151
}

frameworks/PHP/comet/comet-mysql.dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
ARG DEBIAN_FRONTEND=noninteractive
44

55
RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
6-
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
7-
RUN apt-get update -yqq > /dev/null && \
8-
apt-get install -yqq php8.1-cli php8.1-xml php8.1-mysql php8.1-mbstring > /dev/null
6+
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
7+
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null
8+
9+
RUN apt-get install -yqq php8.1-cli php8.1-xml php8.1-mysql php8.1-mbstring > /dev/null
910

1011
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
1112

frameworks/PHP/comet/comet.dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
ARG DEBIAN_FRONTEND=noninteractive
44

55
RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
6-
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
7-
RUN apt-get update -yqq > /dev/null && \
8-
apt-get install -yqq php8.1-cli php8.1-pgsql php8.1-xml php8.1-mbstring > /dev/null
6+
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
7+
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null
8+
9+
RUN apt-get install -yqq php8.1-cli php8.1-pgsql php8.1-xml php8.1-mbstring > /dev/null
910

1011
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
1112

frameworks/PHP/comet/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"gotzmann/comet": "^0.7.0"
3+
"gotzmann/comet": "^2.4"
44
},
55
"autoload": {
66
"psr-4": {

frameworks/PHP/comet/src/Controllers/FortuneController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public function __invoke(Request $request, Response $response, $args)
3030
.$html.
3131
'</table></body></html>'
3232
)
33-
->withHeader('Content-Type', 'text/html; charset=utf-8')
3433
->withHeader('Date', Storage::$date);
3534
}
3635
}

0 commit comments

Comments
 (0)