Changeset 4996
- Timestamp:
- 09/04/07 21:19:43 (1 year ago)
- Files:
-
- freepbx/trunk (modified) (1 prop)
- freepbx/trunk/amp_conf/bin/freepbx-cron-scheduler.php (modified) (1 diff)
- freepbx/trunk/amp_conf/bin/retrieve_conf (modified) (3 diffs)
- freepbx/trunk/amp_conf/htdocs/admin/common/db_connect.php (modified) (1 diff)
- freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php (modified) (1 diff)
- freepbx/trunk/install_amp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk
- Property svnmerge-integrated changed from /freepbx/branches/2.2:1-2983 /freepbx/branches/2.3:1-4129,4131,4133-4134,4136-4992 to /freepbx/branches/2.2:1-2983 /freepbx/branches/2.3:1-4129,4131,4133-4134,4136-4995
freepbx/trunk/amp_conf/bin/freepbx-cron-scheduler.php
r4993 r4996 25 25 26 26 function fatal($text, $extended_text="", $type="FATAL") { 27 global $db; 28 27 29 echo "[$type] ".$text." ".$extended_text."\n"; 28 30 29 $nt = notifications::create($db); 30 $nt->add_critical('cron_manager', $type, $text, $extended_text); 31 if(!DB::isError($db)) { 32 $nt = notifications::create($db); 33 $nt->add_critical('cron_manager', $type, $text, $extended_text); 34 } 31 35 32 36 exit(1); freepbx/trunk/amp_conf/bin/retrieve_conf
r4993 r4996 37 37 38 38 function fatal($text, $extended_text="", $type="FATAL") { 39 global $db; 40 39 41 echo "[$type] ".$text." ".$extended_text."\n"; 40 42 41 $nt = notifications::create($db); 42 $nt->add_critical('retrieve_conf', $type, $text, $extended_text); 43 if(!DB::isError($db)) { 44 $nt = notifications::create($db); 45 $nt->add_critical('retrieve_conf', $type, $text, $extended_text); 46 } 43 47 44 48 exit(1); … … 235 239 236 240 case "sqlite": 237 require_once('DB/sqlite.php'); 238 239 if (!isset($amp_conf["AMPDBFILE"])) 240 fatal(_("AMPDBFILE not setup properly"),sprintf(_("You must setup properly AMPDBFILE in %s "), $amportalconf)); 241 242 if (isset($amp_conf["AMPDBFILE"]) == "") 243 fatal(_("AMPDBFILE not setup properly"),sprintf(_("AMPDBFILE in %s cannot be blank"), $amportalconf)); 244 245 $DSN = array ( 246 "database" => $amp_conf["AMPDBFILE"], 247 "mode" => 0666 248 ); 249 250 $db = new DB_sqlite(); 251 $db->connect( $DSN ); 241 die_freepbx("SQLite2 support is deprecated. Please use sqlite3 only."); 252 242 break; 253 243 … … 258 248 if (isset($amp_conf["AMPDBFILE"]) == "") 259 249 fatal("AMPDBFILE in $amportalconf cannot be blank"); 250 251 /* on centos this extension is not loaded by default */ 252 if (! extension_loaded('sqlite3.so') ) 253 dl('sqlite3.so'); 254 255 if (! @require_once('DB/sqlite3.php') ) 256 { 257 die_freepbx("Your PHP installation has no PEAR/SQLite3 support. Please install php-sqlite3 and php-pear."); 258 } 260 259 261 260 require_once('DB/sqlite3.php'); freepbx/trunk/amp_conf/htdocs/admin/common/db_connect.php
r4993 r4996 43 43 die_freepbx("AMPDBFILE in /etc/amportal.conf cannot be blank"); 44 44 45 require_once('DB/sqlite3.php'); 45 /* on centos this extension is not loaded by default */ 46 if (! extension_loaded('sqlite3.so') ) 47 dl('sqlite3.so'); 48 49 if (! @require_once('DB/sqlite3.php') ) 50 { 51 die_freepbx("Your PHP installation has no PEAR/SQLite3 support. Please install php-sqlite3 and php-pear."); 52 } 53 46 54 $datasource = "sqlite3:///" . $amp_conf["AMPDBFILE"] . "?mode=0666"; 47 55 $db = DB::connect($datasource); freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php
r4993 r4996 668 668 $results = $db->$type($sql,$fetchmode); 669 669 if(DB::IsError($results)) { 670 die_freepbx($results->getDebugInfo() );670 die_freepbx($results->getDebugInfo() . "SQL - <br> $sql" ); 671 671 } 672 672 return $results; freepbx/trunk/install_amp
r4993 r4996 905 905 906 906 case "sqlite": 907 if (! @ include('DB/sqlite.php')) 908 { 909 out("FAILED"); 910 fatal( "Your PHP installation lacks SQLite support" ); 911 } 912 913 if (!isset($amp_conf["AMPDBFILE"])) 914 die("You must setup properly AMPDBFILE in ".AMP_CONF); 915 916 if (isset($amp_conf["AMPDBFILE"]) == "") 917 die("AMPDBFILE in ".AMP_CONF." cannot be blank"); 918 919 $DSN = array ( 920 "database" => $amp_conf["AMPDBFILE"], 921 "mode" => 0666 922 ); 923 924 $db = new DB_sqlite(); 925 $db->connect( $DSN ); 907 die_freepbx("SQLite2 support is deprecated. Please use sqlite3 only."); 926 908 break; 927 909 … … 933 915 die("AMPDBFILE in /etc/amportal.conf cannot be blank"); 934 916 935 require_once('DB/sqlite3.php'); 917 /* on centos this extension is not loaded by default */ 918 if (! extension_loaded('sqlite3.so') ) 919 dl('sqlite3.so'); 920 921 if (! @require_once('DB/sqlite3.php') ) 922 { 923 out("FAILED"); 924 fatal( "Your PHP installation has no PEAR/SQLite3 support. Please install php-sqlite3 and php-pear."); 925 } 926 936 927 $datasource = "sqlite3:///" . $amp_conf["AMPDBFILE"] . "?mode=0666"; 937 928 $db = DB::connect($datasource);
