Skip to content

Commit e9429fb

Browse files
committed
Rename MySQL namespace to Mysql
1 parent adcf751 commit e9429fb

34 files changed

+185
-183
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ This example runs a simple `SELECT` query and dumps all the records from a `book
4444

4545
require __DIR__ . '/vendor/autoload.php';
4646

47-
$mysql = new React\MySQL\MysqlClient('user:pass@localhost/bookstore');
47+
$mysql = new React\Mysql\MysqlClient('user:pass@localhost/bookstore');
4848

4949
$mysql->query('SELECT * FROM book')->then(
50-
function (React\MySQL\MysqlResult $command) {
50+
function (React\Mysql\MysqlResult $command) {
5151
print_r($command->resultFields);
5252
print_r($command->resultRows);
5353
echo count($command->resultRows) . ' row(s) in set' . PHP_EOL;
@@ -68,7 +68,7 @@ The `MysqlClient` is responsible for exchanging messages with your MySQL server
6868
and keeps track of pending queries.
6969

7070
```php
71-
$mysql = new React\MySQL\MysqlClient($uri);
71+
$mysql = new React\Mysql\MysqlClient($uri);
7272

7373
$mysql->query(…);
7474
```
@@ -114,7 +114,7 @@ The `$uri` parameter must contain the database host, optional
114114
authentication, port and database to connect to:
115115

116116
```php
117-
$mysql = new React\MySQL\MysqlClient('user:secret@localhost:3306/database');
117+
$mysql = new React\Mysql\MysqlClient('user:secret@localhost:3306/database');
118118
```
119119

120120
Note that both the username and password must be URL-encoded (percent-encoded)
@@ -124,15 +124,15 @@ if they contain special characters:
124124
$user = 'he:llo';
125125
$pass = 'p@ss';
126126

127-
$mysql = new React\MySQL\MysqlClient(
127+
$mysql = new React\Mysql\MysqlClient(
128128
rawurlencode($user) . ':' . rawurlencode($pass) . '@localhost:3306/db'
129129
);
130130
```
131131

132132
You can omit the port if you're connecting to default port `3306`:
133133

134134
```php
135-
$mysql = new React\MySQL\MysqlClient('user:secret@localhost/database');
135+
$mysql = new React\Mysql\MysqlClient('user:secret@localhost/database');
136136
```
137137

138138
If you do not include authentication and/or database, then this method
@@ -141,7 +141,7 @@ and no database selected. This may be useful when initially setting up a
141141
database, but likely to yield an authentication error in a production system:
142142

143143
```php
144-
$mysql = new React\MySQL\MysqlClient('localhost');
144+
$mysql = new React\Mysql\MysqlClient('localhost');
145145
```
146146

147147
This method respects PHP's `default_socket_timeout` setting (default 60s)
@@ -150,7 +150,7 @@ successful authentication. You can explicitly pass a custom timeout value
150150
in seconds (or use a negative number to not apply a timeout) like this:
151151

152152
```php
153-
$mysql = new React\MySQL\MysqlClient('localhost?timeout=0.5');
153+
$mysql = new React\Mysql\MysqlClient('localhost?timeout=0.5');
154154
```
155155

156156
By default, idle connections will be held open for 1ms (0.001s) when not
@@ -163,7 +163,7 @@ pass a custom idle timeout value in seconds (or use a negative number to
163163
not apply a timeout) like this:
164164

165165
```php
166-
$mysql = new React\MySQL\MysqlClient('localhost?idle=10.0');
166+
$mysql = new React\Mysql\MysqlClient('localhost?idle=10.0');
167167
```
168168

169169
By default, the connection provides full UTF-8 support (using the
@@ -172,7 +172,7 @@ applications nowadays, but for legacy reasons you can change this to use
172172
a different ASCII-compatible charset encoding like this:
173173

174174
```php
175-
$mysql = new React\MySQL\MysqlClient('localhost?charset=utf8mb4');
175+
$mysql = new React\Mysql\MysqlClient('localhost?charset=utf8mb4');
176176
```
177177

178178
If you need custom connector settings (DNS resolution, TLS parameters, timeouts,
@@ -191,7 +191,7 @@ $connector = new React\Socket\Connector([
191191
)
192192
]);
193193

194-
$mysql = new React\MySQL\MysqlClient('user:secret@localhost:3306/database', $connector);
194+
$mysql = new React\Mysql\MysqlClient('user:secret@localhost:3306/database', $connector);
195195
```
196196

197197
This class takes an optional `LoopInterface|null $loop` parameter that can be used to
@@ -225,7 +225,7 @@ unknown or known to be too large to fit into memory, you should use the
225225
[`queryStream()`](#querystream) method instead.
226226

227227
```php
228-
$mysql->query($query)->then(function (React\MySQL\MysqlResult $command) {
228+
$mysql->query($query)->then(function (React\Mysql\MysqlResult $command) {
229229
if (isset($command->resultRows)) {
230230
// this is a response to a SELECT etc. with some rows (0+)
231231
print_r($command->resultFields);

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
},
1919
"autoload": {
2020
"psr-4": {
21-
"React\\MySQL\\": "src/"
21+
"React\\Mysql\\": "src/"
2222
}
2323
},
2424
"autoload-dev": {
2525
"psr-4": {
26-
"React\\Tests\\MySQL\\": "tests/"
26+
"React\\Tests\\Mysql\\": "tests/"
2727
}
2828
}
2929
}

examples/01-query.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
require __DIR__ . '/../vendor/autoload.php';
77

8-
$mysql = new React\MySQL\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test');
8+
$mysql = new React\Mysql\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test');
99

1010
$query = isset($argv[1]) ? $argv[1] : 'select * from book';
11-
$mysql->query($query)->then(function (React\MySQL\MysqlResult $command) {
11+
$mysql->query($query)->then(function (React\Mysql\MysqlResult $command) {
1212
if (isset($command->resultRows)) {
1313
// this is a response to a SELECT etc. with some rows (0+)
1414
print_r($command->resultFields);

examples/02-query-stream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
require __DIR__ . '/../vendor/autoload.php';
77

8-
$mysql = new React\MySQL\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test');
8+
$mysql = new React\Mysql\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test');
99

1010
$query = isset($argv[1]) ? $argv[1] : 'select * from book';
1111
$stream = $mysql->queryStream($query);

examples/11-interactive.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
require __DIR__ . '/../vendor/autoload.php';
77

8-
$mysql = new React\MySQL\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test');
8+
$mysql = new React\Mysql\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test');
99

1010
// open a STDIN stream to read keyboard input (not supported on Windows)
1111
$stdin = new React\Stream\ReadableResourceStream(STDIN);
@@ -25,7 +25,7 @@
2525
}
2626

2727
$time = microtime(true);
28-
$mysql->query($query)->then(function (React\MySQL\MysqlResult $command) use ($time) {
28+
$mysql->query($query)->then(function (React\Mysql\MysqlResult $command) use ($time) {
2929
if (isset($command->resultRows)) {
3030
// this is a response to a SELECT etc. with some rows (0+)
3131
echo implode("\t", array_column($command->resultFields, 'name')) . PHP_EOL;

examples/12-slow-stream.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
require __DIR__ . '/../vendor/autoload.php';
99

10-
$mysql = new React\MySQL\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test');
10+
$mysql = new React\Mysql\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test');
1111

1212
$query = isset($argv[1]) ? $argv[1] : 'select * from book';
1313
$stream = $mysql->queryStream($query);
@@ -17,7 +17,7 @@
1717
$promise = $ref->getValue($mysql);
1818
assert($promise instanceof React\Promise\PromiseInterface);
1919

20-
$promise->then(function (React\MySQL\Io\Connection $connection) {
20+
$promise->then(function (React\Mysql\Io\Connection $connection) {
2121
// The protocol parser reads rather large chunks from the underlying connection
2222
// and as such can yield multiple (dozens to hundreds) rows from a single data
2323
// chunk. We try to artificially limit the stream chunk size here to try to

src/Commands/AbstractCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace React\MySQL\Commands;
3+
namespace React\Mysql\Commands;
44

55
use Evenement\EventEmitter;
66

src/Commands/AuthenticateCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
namespace React\MySQL\Commands;
3+
namespace React\Mysql\Commands;
44

5-
use React\MySQL\Io\Buffer;
6-
use React\MySQL\Io\Constants;
5+
use React\Mysql\Io\Buffer;
6+
use React\Mysql\Io\Constants;
77

88
/**
99
* @internal
@@ -31,7 +31,7 @@ class AuthenticateCommand extends AbstractCommand
3131
*
3232
* @var array<string,int>
3333
* @see self::$charsetNumber
34-
* @see \React\MySQL\Io\Query::$escapeChars
34+
* @see \React\Mysql\Io\Query::$escapeChars
3535
*/
3636
private static $charsetMap = [
3737
'latin1' => 8,

src/Commands/CommandInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace React\MySQL\Commands;
3+
namespace React\Mysql\Commands;
44

55
use Evenement\EventEmitterInterface;
66

src/Commands/PingCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace React\MySQL\Commands;
3+
namespace React\Mysql\Commands;
44

55
/**
66
* @internal

0 commit comments

Comments
 (0)