File tree 3 files changed +4
-6
lines changed
src/MySQLReplication/BinLog
3 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 3
3
namespace example ;
4
4
5
5
error_reporting (E_ALL );
6
- ini_set ('display_errors ' , 1 );
7
6
date_default_timezone_set ('UTC ' );
8
7
include __DIR__ . '/../vendor/autoload.php ' ;
9
8
18
17
use MySQLReplication \Config \ConfigService ;
19
18
use MySQLReplication \Definitions \ConstEventType ;
20
19
use MySQLReplication \Event \DTO \UpdateRowsDTO ;
20
+ use SebastianBergmann \RecursionContext \InvalidArgumentException ;
21
21
22
22
/**
23
23
* Class BenchmarkEventSubscribers
@@ -113,13 +113,14 @@ private function getConnection()
113
113
/**
114
114
* @throws MySQLReplicationException
115
115
* @throws DBALException
116
+ * @throws \InvalidArgumentException
116
117
*/
117
118
public function run ()
118
119
{
119
120
$ pid = pcntl_fork ();
120
121
if ($ pid === -1 )
121
122
{
122
- die ( ' could not fork ' );
123
+ throw new \ InvalidArgumentException ( ' Could not fork ' );
123
124
}
124
125
else if ($ pid )
125
126
{
@@ -157,7 +158,6 @@ private function produce()
157
158
}
158
159
159
160
$ conn ->close ();
160
- die;
161
161
}
162
162
}
163
163
Original file line number Diff line number Diff line change 3
3
namespace example ;
4
4
5
5
error_reporting (E_ALL );
6
- ini_set ('display_errors ' , 1 );
7
6
date_default_timezone_set ('UTC ' );
8
7
include __DIR__ . '/../vendor/autoload.php ' ;
9
8
@@ -37,7 +36,7 @@ public function allEvents(EventDTO $event)
37
36
echo $ event ;
38
37
39
38
// all events got JsonSerializable implementation
40
- // echo json_encode($result , JSON_PRETTY_PRINT);
39
+ echo json_encode ($ event , JSON_PRETTY_PRINT );
41
40
42
41
echo 'Memory usage ' . round (memory_get_usage () / 1048576 , 2 ) . ' MB ' . PHP_EOL ;
43
42
}
Original file line number Diff line number Diff line change 3
3
namespace MySQLReplication \BinLog ;
4
4
5
5
/**
6
- * todo ugly class, for refactoring
7
6
* Class BinLogServerInfo
8
7
* @package MySQLReplication\BinLog
9
8
*/
You can’t perform that action at this time.
0 commit comments