@@ -23,41 +23,41 @@ var_dump($pid > 0);
23
23
var_dump ($ db ->pgsqlGetNotify ());
24
24
25
25
// Listen started, no notifies
26
- $ db ->exec ("LISTEN notifies_phpt " );
26
+ $ db ->exec ("LISTEN channel_getnotify " );
27
27
var_dump ($ db ->pgsqlGetNotify ());
28
28
29
29
// No parameters, use default PDO::FETCH_NUM
30
30
$ db ->setAttribute (PDO ::ATTR_DEFAULT_FETCH_MODE , PDO ::FETCH_NUM );
31
- $ db ->exec ("NOTIFY notifies_phpt " );
31
+ $ db ->exec ("NOTIFY channel_getnotify " );
32
32
$ notify = $ db ->pgsqlGetNotify ();
33
33
var_dump (count ($ notify ));
34
34
var_dump ($ notify [0 ]);
35
35
var_dump ($ notify [1 ] == $ pid );
36
36
37
37
// No parameters, use default PDO::FETCH_ASSOC
38
38
$ db ->setAttribute (PDO ::ATTR_DEFAULT_FETCH_MODE , PDO ::FETCH_ASSOC );
39
- $ db ->exec ("NOTIFY notifies_phpt " );
39
+ $ db ->exec ("NOTIFY channel_getnotify " );
40
40
$ notify = $ db ->pgsqlGetNotify ();
41
41
var_dump (count ($ notify ));
42
42
var_dump ($ notify ['message ' ]);
43
43
var_dump ($ notify ['pid ' ] == $ pid );
44
44
45
45
// Test PDO::FETCH_NUM as parameter
46
- $ db ->exec ("NOTIFY notifies_phpt " );
46
+ $ db ->exec ("NOTIFY channel_getnotify " );
47
47
$ notify = $ db ->pgsqlGetNotify (PDO ::FETCH_NUM );
48
48
var_dump (count ($ notify ));
49
49
var_dump ($ notify [0 ]);
50
50
var_dump ($ notify [1 ] == $ pid );
51
51
52
52
// Test PDO::FETCH_ASSOC as parameter
53
- $ db ->exec ("NOTIFY notifies_phpt " );
53
+ $ db ->exec ("NOTIFY channel_getnotify " );
54
54
$ notify = $ db ->pgsqlGetNotify (PDO ::FETCH_ASSOC );
55
55
var_dump (count ($ notify ));
56
56
var_dump ($ notify ['message ' ]);
57
57
var_dump ($ notify ['pid ' ] == $ pid );
58
58
59
59
// Test PDO::FETCH_BOTH as parameter
60
- $ db ->exec ("NOTIFY notifies_phpt " );
60
+ $ db ->exec ("NOTIFY channel_getnotify " );
61
61
$ notify = $ db ->pgsqlGetNotify (PDO ::FETCH_BOTH );
62
62
var_dump (count ($ notify ));
63
63
var_dump ($ notify ['message ' ]);
@@ -77,7 +77,7 @@ var_dump($diff >= 1 || 1 - abs($diff) < .05);
77
77
var_dump ($ notify );
78
78
79
79
// Test second parameter, should return immediately because a notify is queued
80
- $ db ->exec ("NOTIFY notifies_phpt " );
80
+ $ db ->exec ("NOTIFY channel_getnotify " );
81
81
$ t = microtime (1 );
82
82
$ notify = $ db ->pgsqlGetNotify (PDO ::FETCH_ASSOC , 5000 );
83
83
$ diff = microtime (1 ) - $ t ;
@@ -90,21 +90,21 @@ bool(true)
90
90
bool(false)
91
91
bool(false)
92
92
int(2)
93
- string(13) "notifies_phpt "
93
+ string(13) "channel_getnotify "
94
94
bool(true)
95
95
int(2)
96
- string(13) "notifies_phpt "
96
+ string(13) "channel_getnotify "
97
97
bool(true)
98
98
int(2)
99
- string(13) "notifies_phpt "
99
+ string(13) "channel_getnotify "
100
100
bool(true)
101
101
int(2)
102
- string(13) "notifies_phpt "
102
+ string(13) "channel_getnotify "
103
103
bool(true)
104
104
int(4)
105
- string(13) "notifies_phpt "
105
+ string(13) "channel_getnotify "
106
106
bool(true)
107
- string(13) "notifies_phpt "
107
+ string(13) "channel_getnotify "
108
108
bool(true)
109
109
bool(false)
110
110
bool(true)
0 commit comments