Location: PHPKode > projects > CHASERS > chasers_gpl_snapshot1a/update_engine_config.php
<?php

/*
<LICENSE>
This file is part of CHASERS.
CHASERS is Copyright (c) 2003-2008 Downtown Emergency Service Center (DESC).
All rights reserved.
For more information, about DESC, see http://www.desc.org/.
For more information about CHASERS, see http://chasers.desc.org/.

CHASERS is free software: you can redistribute it and/or modify
it under the terms of version 3 of the GNU General Public License 
as published by the Free Software Foundation.

CHASERS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with CHASERS.  If not, see <http://www.gnu.org/licenses/>.

</LICENSE>
*/

//check for command-line running
if (isset($_REQUEST['noexists']) || (isset($_SERVER['argc']) && $_SERVER['argc']>0 && $_SERVER['argv'])) {

	$off = dirname(__FILE__).'/';
	ini_set('memory_limit','64M');
	$CG_FULL_INI = false;
	include 'command_line_includes.php';
	$res = update_engine_array(false,$_SERVER['argv'][1]);
	if ($res) {
		outline('SUCCESS!');
	} else {
		outline('FAILED TO UPDATE ENGINE ARRAY');
	}

} else {

	$CG_FULL_INI = false;
	include 'performance.php';
	include 'includes.php';
	
	//GENERATE ENGINE ARRAY FROM CONFIG FILES
	
	$res = update_engine_array();
	
	if ($res) {

		$start=getmicrotime();
		$tmp=sql_fetch_assoc(desc_query('SELECT * FROM '.CG_ENGINE_CONFIG_TABLE,array('val_name'=>CG_ENGINE_CONFIG_ARRAY)));
		$new_engine=unserialize($tmp['value']);
		$end=getmicrotime();
		outline();
		outline('Execution time to load new array from DB: '. ($end-$start));
		outline ('Engine Array Succesfully Updated.');
		
		outline(center(bigger(red(bold('SUCCESS!')),8)));
		outline(center(link_admin() .' or '. link_chasers()));

	} else {

		outline('Update Failed.');

	}

	page_close();
}
?>
Return current item: CHASERS