@@ -23,41 +23,41 @@ var_dump($pid > 0);
2323var_dump ($ db ->pgsqlGetNotify ());
2424
2525// Listen started, no notifies
26- $ db ->exec ("LISTEN notifies_phpt " );
26+ $ db ->exec ("LISTEN channel_getnotify " );
2727var_dump ($ db ->pgsqlGetNotify ());
2828
2929// No parameters, use default PDO::FETCH_NUM
3030$ db ->setAttribute (PDO ::ATTR_DEFAULT_FETCH_MODE , PDO ::FETCH_NUM );
31- $ db ->exec ("NOTIFY notifies_phpt " );
31+ $ db ->exec ("NOTIFY channel_getnotify " );
3232$ notify = $ db ->pgsqlGetNotify ();
3333var_dump (count ($ notify ));
3434var_dump ($ notify [0 ]);
3535var_dump ($ notify [1 ] == $ pid );
3636
3737// No parameters, use default PDO::FETCH_ASSOC
3838$ db ->setAttribute (PDO ::ATTR_DEFAULT_FETCH_MODE , PDO ::FETCH_ASSOC );
39- $ db ->exec ("NOTIFY notifies_phpt " );
39+ $ db ->exec ("NOTIFY channel_getnotify " );
4040$ notify = $ db ->pgsqlGetNotify ();
4141var_dump (count ($ notify ));
4242var_dump ($ notify ['message ' ]);
4343var_dump ($ notify ['pid ' ] == $ pid );
4444
4545// Test PDO::FETCH_NUM as parameter
46- $ db ->exec ("NOTIFY notifies_phpt " );
46+ $ db ->exec ("NOTIFY channel_getnotify " );
4747$ notify = $ db ->pgsqlGetNotify (PDO ::FETCH_NUM );
4848var_dump (count ($ notify ));
4949var_dump ($ notify [0 ]);
5050var_dump ($ notify [1 ] == $ pid );
5151
5252// Test PDO::FETCH_ASSOC as parameter
53- $ db ->exec ("NOTIFY notifies_phpt " );
53+ $ db ->exec ("NOTIFY channel_getnotify " );
5454$ notify = $ db ->pgsqlGetNotify (PDO ::FETCH_ASSOC );
5555var_dump (count ($ notify ));
5656var_dump ($ notify ['message ' ]);
5757var_dump ($ notify ['pid ' ] == $ pid );
5858
5959// Test PDO::FETCH_BOTH as parameter
60- $ db ->exec ("NOTIFY notifies_phpt " );
60+ $ db ->exec ("NOTIFY channel_getnotify " );
6161$ notify = $ db ->pgsqlGetNotify (PDO ::FETCH_BOTH );
6262var_dump (count ($ notify ));
6363var_dump ($ notify ['message ' ]);
@@ -77,7 +77,7 @@ var_dump($diff >= 1 || 1 - abs($diff) < .05);
7777var_dump ($ notify );
7878
7979// Test second parameter, should return immediately because a notify is queued
80- $ db ->exec ("NOTIFY notifies_phpt " );
80+ $ db ->exec ("NOTIFY channel_getnotify " );
8181$ t = microtime (1 );
8282$ notify = $ db ->pgsqlGetNotify (PDO ::FETCH_ASSOC , 5000 );
8383$ diff = microtime (1 ) - $ t ;
@@ -90,21 +90,21 @@ bool(true)
9090bool(false)
9191bool(false)
9292int(2)
93- string(13 ) "notifies_phpt "
93+ string(17 ) "channel_getnotify "
9494bool(true)
9595int(2)
96- string(13 ) "notifies_phpt "
96+ string(17 ) "channel_getnotify "
9797bool(true)
9898int(2)
99- string(13 ) "notifies_phpt "
99+ string(17 ) "channel_getnotify "
100100bool(true)
101101int(2)
102- string(13 ) "notifies_phpt "
102+ string(17 ) "channel_getnotify "
103103bool(true)
104104int(4)
105- string(13 ) "notifies_phpt "
105+ string(17 ) "channel_getnotify "
106106bool(true)
107- string(13 ) "notifies_phpt "
107+ string(17 ) "channel_getnotify "
108108bool(true)
109109bool(false)
110110bool(true)
0 commit comments