Project

General

Profile

« Previous | Next » 

Revision 1875

Added by Dietmar over 11 years ago

! wysgwyg, now check exitings table entries, otherwise script stop loading content in editor
! typofix in groups
! change constant DB_NAME to $database->DbName

View differences:

upgrade-script.php
19 19
/**
20 20
 * 
21 21
 * 
22
 * @category     Module
23
 * @package      Module_bakery
24
 * @subpackage   Name of the subpackage if needed
25
 * @author       Dietmar W?llbrink <dietmar.woellbrink@websitebaker.org>
22
 * @category     Core
23
 * @package      Core_package
24
 * @subpackage   upgrade-script
25
 * @author       Dietmar Wรถllbrink <dietmar.woellbrink@websitebaker.org>
26 26
 * @author       Werner v.d.Decken <wkl@isteam.de>
27 27
 * @copyright    Werner v.d.Decken <wkl@isteam.de>
28 28
 * @license      http://www.gnu.org/licenses/gpl.html   GPL License
......
234 234
	$get_result = $database->query( 'SHOW TABLES LIKE "'.$search_for.'%"');
235 235

  
236 236
	// $get_result = $database->query( "SHOW TABLES FROM ".DB_NAME);
237
    $all_tables = array();
238
    $aTable = array();
239
    if($get_result->numRows() > 0)
240
    {
241
        while ($data = $get_result->fetchRow()) {
242
            $tmp = preg_replace('/^'.preg_quote(TABLE_PREFIX, '/').'/s', '', $data[0]);
243
            if(in_array($tmp,$aPackage)) {
244
                $all_tables[] = $tmp;
245
            } else {
246
                $aTable[] = $tmp;
247
            }
248
        }
249
    }
237
	$all_tables = array();
238
	$aTable = array();
239
	if($get_result->numRows() > 0)
240
	{
241
		while ($data = $get_result->fetchRow()) {
242
		    $tmp = preg_replace('/^'.preg_quote(TABLE_PREFIX, '/').'/s', '', $data[0]);
243
		    if(in_array($tmp,$aPackage)) {
244
		        $all_tables[] = $tmp;
245
		    } else {
246
		        $aTable[] = $tmp;
247
		    }
248
		}
249
	}
250 250

  
251
    return array_merge ( $all_tables, $aTable );
251
	return array_merge ( $all_tables, $aTable );
252 252
}
253 253

  
254 254
// check existing tables
......
415 415

  
416 416
    if( (sizeof($all_tables) >= sizeof($aPackage)) && (sizeof($aTable) == sizeof($aPackage)) )
417 417
    {
418
        echo '<h4 style="margin-left:0;">NOTICE: Your database '.DB_NAME.' has '.sizeof($all_tables).' '.$check_text.' tables from '.sizeof($aPackage).' included in package '.$OK.'</h4>';
418
        echo '<h4 style="margin-left:0;">NOTICE: Your database '.$database->DbName.' has '.sizeof($all_tables).' '.$check_text.' tables from '.sizeof($aPackage).' included in package '.$OK.'</h4>';
419 419
    }
420 420
    else
421 421
    {

Also available in: Unified diff