Skip to content

Commit f8f8603

Browse files
committed
code syntax, improved notes
1 parent ed13dea commit f8f8603

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

scripts/notifications/notification-example.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
require_once 'includes/notifications.class.php';
44

55

6-
## COMMENTED CODE IS USED TO WRITE TO A FILE, GOOD FOR DEBUGGING
7-
6+
## TEST WRITING TO A FILE - DEBUGGING
87
#$fh = fopen('json_parse.log', 'a+') or die("Error opening output file");
98

109
#if ( $fh ) {
@@ -19,7 +18,7 @@
1918

2019
if (is_array($notifications->dataArray))
2120
{
22-
foreach ( $notifications->dataArray as $data )
21+
foreach ( $notifications->dataArray as $data )
2322
{
2423
// key used should also be a column in the database
2524
// need additional data simply add it
@@ -44,23 +43,21 @@
4443
$a = array_filter( $d, 'strlen' ); // this will remove emtpy object from causing database insertion issues
4544
$db->insert('notifications', $a);
4645
}
47-
48-
echo "Ok";
49-
50-
} else {
5146

47+
echo "Ok";
48+
}
49+
else
50+
{
5251
// Any errors? Let's review in the logs
5352
error_log("Invalid Array: " . print_r($notifications->dataArray, TRUE), 0);
54-
5553
}
5654

57-
5855
# fwrite($fh, serialize($notifications->dataArray));
5956
# fclose($fh);
60-
61-
} else {
57+
58+
}
59+
else
60+
{
6261
error_log("Invalid Host", 0);
6362
}
6463
#}
65-
66-
?>

0 commit comments

Comments
 (0)