File: error.inc

package info (click to toggle)
basilix 1.0.3b-1.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 828 kB
  • ctags: 206
  • sloc: php: 2,681; sql: 45; makefile: 40; sh: 7
file content (35 lines) | stat: -rw-r--r-- 851 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/*
+-------------------------------------------------------------------+
| BasiliX - Copyright (C) 2000 Murat Arslan <arslanm@cyberdude.com> |
+-------------------------------------------------------------------+
*/

// Error specific functions
// ------------------------------------------------------------------
// Error reporting
// $old_error_reporting = error_reporting(E_PARSE | E_CORE_ERROR | E_CORE_WARNING);

// close the connections if still exist
function close_cons() {
   global $sql, $imap;
   if($sql) $sql->close();
   if($imap) $imap->close();
}

// Show the error message and exit
function err_exit($msg = "") {
   $msg .= "<br>" . imap_last_error() . "<br>\n";
   close_cons();
   if($msg) {
      echo "<b>Error:</b> $msg<br>\n";
   }
   exit();
}

// normal exit
function my_exit() {
   global $imap, $sql;
   exit();
}
?>