Skip to content

Commit 12106ef

Browse files
Move swoole implementation to its own directory (#3801)
Swoole seems to be a framework and it doesn't share any code with the PHP/php directory, which is for "raw", framework-less PHP.
1 parent cfcdd5f commit 12106ef

File tree

4 files changed

+32
-27
lines changed

4 files changed

+32
-27
lines changed

frameworks/PHP/php/benchmark_config.json

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -126,29 +126,6 @@
126126
"display_name": "PHP-raw",
127127
"notes": "",
128128
"versus": "php-php5"
129-
},
130-
"swoole": {
131-
"json_url": "/json",
132-
"plaintext_url": "/plaintext",
133-
"db_url": "/db",
134-
"query_url": "/db?queries=",
135-
"fortune_url": "/fortunes",
136-
"update_url": "/updates?queries=",
137-
"port": 8080,
138-
"approach": "Realistic",
139-
"classification": "Platform",
140-
"database": "MySQL",
141-
"framework": "None",
142-
"language": "PHP",
143-
"flavor": "PHP7",
144-
"orm": "Raw",
145-
"platform": "None",
146-
"webserver": "swoole",
147-
"os": "Linux",
148-
"database_os": "Linux",
149-
"display_name": "PHP-swool",
150-
"notes": "",
151-
"versus": "php"
152129
}
153130
}]
154131
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"framework": "swoole",
3+
"tests": [{
4+
"default": {
5+
"json_url": "/json",
6+
"plaintext_url": "/plaintext",
7+
"db_url": "/db",
8+
"query_url": "/db?queries=",
9+
"fortune_url": "/fortunes",
10+
"update_url": "/updates?queries=",
11+
"port": 8080,
12+
"approach": "Realistic",
13+
"classification": "Platform",
14+
"database": "MySQL",
15+
"framework": "None",
16+
"language": "PHP",
17+
"flavor": "PHP7",
18+
"orm": "Raw",
19+
"platform": "None",
20+
"webserver": "swoole",
21+
"os": "Linux",
22+
"database_os": "Linux",
23+
"display_name": "Swoole",
24+
"notes": "",
25+
"versus": "php"
26+
}
27+
}]
28+
}

frameworks/PHP/php/swoole-server.php renamed to frameworks/PHP/swoole/swoole-server.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@
6969
$fortune = [];
7070
// Define query
7171
$arr = $db->query('SELECT id, message FROM Fortune');
72-
foreach ($arr as $row)
72+
foreach ($arr as $row)
7373
$fortune[$row['id']] = $row['message'];
74-
$fortune[0] = 'Additional fortune added at request time.';
74+
$fortune[0] = 'Additional fortune added at request time.';
7575
asort($fortune);
7676

7777
$html = "<!DOCTYPE html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr>";
78-
foreach ($fortune as $id => $message)
78+
foreach ($fortune as $id => $message)
7979
$html .= "<tr><td>" . $id . "</td><td>" . htmlspecialchars($message, ENT_QUOTES, 'UTF-8') . "</td></tr>";
8080

8181
$html .= "</table></body></html>";

frameworks/PHP/php/php-swoole.dockerfile renamed to frameworks/PHP/swoole/swoole.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ RUN cd /tmp && curl -sSL "https://github.com/swoole/swoole-src/archive/v${SWOOLE
99

1010
RUN docker-php-ext-install pdo_mysql > /dev/null
1111

12-
ADD ./ /swoole
1312
WORKDIR /swoole
13+
COPY swoole-server.php swoole-server.php
1414

1515
CMD sed -i 's|NUMCORES|'"$(nproc)"'|g' swoole-server.php && \
1616
php swoole-server.php

0 commit comments

Comments
 (0)