Location: PHPKode > projects > O - OpenSource GroupWare > osgw/config/upgrade_tables.php
<?php
/**************************************************************************
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   @Authors:	Ryan Thompson(hide@address.com)
***************************************************************************/
/*$Id: upgrade_tables.php,v 1.12 2003/12/11 21:24:57 rthomp Exp $*/
$service['no_session'] = TRUE;
require('../config.inc.php');


$handle2 = opendir("$root_dir/osgw/config/upgrade");
while (false !== ($files = readdir($handle2))) 
{
	unset($change);
	if(!in_array($files, $system_dirs))
	{
		
		$table = explode('.',$files);
		$table = $table[0];
		
		include_once("$root_dir/osgw/config/upgrade/$files");
		
		$setup->find_changes($table, $change);
	}
}
closedir($handle2);
$handle = opendir($root_dir);
while (false !== ($d = readdir($handle))) 
{
	
	if(!in_array($d, $system_dirs) && is_dir("../$d") && $d != 'osgw')
	{
		if(is_dir("$root_dir/$d/config/upgrade"))
		{
			$handle2 = opendir("$root_dir/$d/config/upgrade");
			while (false !== ($files = readdir($handle2))) 
			{
		
				unset($change);
				if(!in_array($files, $system_dirs))
				{
					$table = explode('.',$files);
					$table = $table[0];
					
					include_once("$root_dir/$d/config/upgrade/$files");
		
					$setup->find_changes($table, $change);

				}
			}

			closedir($handle2);

		}
		
		//When the database has been upgraded update the version info.
		$O->update_service_version($d);
	
	}
}

closedir($handle);

//Before we upgrade the text set new version data to the database
$sql = "UPDATE o_info SET value='". VERSION ."' WHERE name='version'";
$db->query($sql);
$sql = "UPDATE o_info SET value='". DB_VERSION ."' WHERE name='database'";
$db->query($sql);
$sql = "UPDATE o_info SET value='". ENGINE ."' WHERE name='engine'";
$db->query($sql);

if(!@header("Location: upgrade_languages.php"))
{
	echo '<a href="upgrade_languages.php">Upgrade Language Text</a>';	
}
Return current item: O - OpenSource GroupWare