Completed
Push — console-installer ( 3d54e5...e2b50d )
by Adam
69:10 queued 48:24
created
modules/UpgradeWizard/systemCheckJson.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -46,36 +46,36 @@
 block discarded – undo
46 46
  * *******************************************************************************/
47 47
 
48 48
 if(ob_get_level() < 1)
49
-	ob_start();
49
+    ob_start();
50 50
 ob_implicit_flush(1);
51 51
 
52 52
 // load the generated persistence file if found
53 53
 $persistence = array();
54 54
 if(file_exists($persist = sugar_cached('/modules/UpgradeWizard/_persistence.php'))) {
55
-	require_once $persist;
55
+    require_once $persist;
56 56
 }
57 57
 require_once('modules/UpgradeWizard/uw_utils.php');
58 58
 
59 59
 switch($_REQUEST['systemCheckStep']) {
60
-	case 'find_all_files':
61
-		ob_end_flush();
62
-		$persistence['files_to_check'] = getFilesForPermsCheck();
60
+    case 'find_all_files':
61
+        ob_end_flush();
62
+        $persistence['files_to_check'] = getFilesForPermsCheck();
63 63
         break;
64 64
 
65
-	case 'check_found_files':
66
-		if(empty($persistence['files_to_check'])) {
67
-			logThis('*** ERROR: could not find persistent array of files to check');
68
-			echo $mod_strings['ERR_UW_NO_FILES'];
69
-		} else {
70
-			ob_end_flush();
71
-			$persistence = checkFiles($persistence['files_to_check'], true);
72
-		}
73
-	break;
65
+    case 'check_found_files':
66
+        if(empty($persistence['files_to_check'])) {
67
+            logThis('*** ERROR: could not find persistent array of files to check');
68
+            echo $mod_strings['ERR_UW_NO_FILES'];
69
+        } else {
70
+            ob_end_flush();
71
+            $persistence = checkFiles($persistence['files_to_check'], true);
72
+        }
73
+    break;
74 74
 
75
-	case 'check_files_status':
76
-		$ret = ($persistence['filesNotWritable']) ? 'true' : 'false';
77
-		echo $ret;
78
-	break;
75
+    case 'check_files_status':
76
+        $ret = ($persistence['filesNotWritable']) ? 'true' : 'false';
77
+        echo $ret;
78
+    break;
79 79
 }
80 80
 
81 81
 write_array_to_file('persistence', $persistence, $persist);
Please login to merge, or discard this patch.
modules/UpgradeWizard/silentUpgrade_step2.php 1 patch
Indentation   +186 added lines, -186 removed lines patch added patch discarded remove patch
@@ -45,76 +45,76 @@  discard block
 block discarded – undo
45 45
 ini_set('memory_limit',-1);
46 46
 ///////////////////////////////////////////////////////////////////////////////
47 47
 ////	UTILITIES THAT MUST BE LOCAL :(
48
- //Bug 24890, 24892. default_permissions not written to config.php. Following function checks and if
49
- //no found then adds default_permissions to the config file.
50
- function checkConfigForPermissions(){
51
-     if(file_exists(getcwd().'/config.php')){
52
-         require(getcwd().'/config.php');
53
-     }
54
-     global $sugar_config;
55
-     if(!isset($sugar_config['default_permissions'])){
56
-             $sugar_config['default_permissions'] = array (
57
-                     'dir_mode' => 02770,
58
-                     'file_mode' => 0660,
59
-                     'user' => '',
60
-                     'group' => '',
61
-             );
62
-         ksort($sugar_config);
63
-         if(is_writable('config.php') && write_array_to_file("sugar_config", $sugar_config,'config.php')) {
64
-        	//writing to the file
65
- 		}
66
-     }
48
+    //Bug 24890, 24892. default_permissions not written to config.php. Following function checks and if
49
+    //no found then adds default_permissions to the config file.
50
+    function checkConfigForPermissions(){
51
+        if(file_exists(getcwd().'/config.php')){
52
+            require(getcwd().'/config.php');
53
+        }
54
+        global $sugar_config;
55
+        if(!isset($sugar_config['default_permissions'])){
56
+                $sugar_config['default_permissions'] = array (
57
+                        'dir_mode' => 02770,
58
+                        'file_mode' => 0660,
59
+                        'user' => '',
60
+                        'group' => '',
61
+                );
62
+            ksort($sugar_config);
63
+            if(is_writable('config.php') && write_array_to_file("sugar_config", $sugar_config,'config.php')) {
64
+            //writing to the file
65
+            }
66
+        }
67 67
 }
68 68
 
69 69
 function checkLoggerSettings(){
70
-	if(file_exists(getcwd().'/config.php')){
71
-         require(getcwd().'/config.php');
72
-     }
70
+    if(file_exists(getcwd().'/config.php')){
71
+            require(getcwd().'/config.php');
72
+        }
73 73
     global $sugar_config;
74
-	if(!isset($sugar_config['logger'])){
75
-	    $sugar_config['logger'] =array (
76
-			'level'=>'fatal',
77
-		    'file' =>
78
-		     array (
79
-		      'ext' => '.log',
80
-		      'name' => 'sugarcrm',
81
-		      'dateFormat' => '%c',
82
-		      'maxSize' => '10MB',
83
-		      'maxLogs' => 10,
84
-		      'suffix' => '', // bug51583, change default suffix to blank for backwards comptability
85
-		    ),
86
-		  );
87
-		 ksort($sugar_config);
88
-         if(is_writable('config.php') && write_array_to_file("sugar_config", $sugar_config,'config.php')) {
89
-        	//writing to the file
90
- 		}
91
-	 }
74
+    if(!isset($sugar_config['logger'])){
75
+        $sugar_config['logger'] =array (
76
+            'level'=>'fatal',
77
+            'file' =>
78
+                array (
79
+                'ext' => '.log',
80
+                'name' => 'sugarcrm',
81
+                'dateFormat' => '%c',
82
+                'maxSize' => '10MB',
83
+                'maxLogs' => 10,
84
+                'suffix' => '', // bug51583, change default suffix to blank for backwards comptability
85
+            ),
86
+            );
87
+            ksort($sugar_config);
88
+            if(is_writable('config.php') && write_array_to_file("sugar_config", $sugar_config,'config.php')) {
89
+            //writing to the file
90
+            }
91
+        }
92 92
 }
93 93
 
94 94
 function checkResourceSettings(){
95
-	if(file_exists(getcwd().'/config.php')){
96
-         require(getcwd().'/config.php');
97
-     }
95
+    if(file_exists(getcwd().'/config.php')){
96
+            require(getcwd().'/config.php');
97
+        }
98 98
     global $sugar_config;
99
-	if(!isset($sugar_config['resource_management'])){
100
-	  $sugar_config['resource_management'] =
101
-		  array (
102
-		    'special_query_limit' => 50000,
103
-		    'special_query_modules' =>
104
-		    array (
105
-		      0 => 'Reports',
106
-		      1 => 'Export',
107
-		      2 => 'Import',
108
-		      3 => 'Administration',
109
-		      4 => 'Sync',
110
-		    ),
111
-		    'default_limit' => 1000,
112
-		  );
113
-		 ksort($sugar_config);
114
-         if(is_writable('config.php') && write_array_to_file("sugar_config", $sugar_config,'config.php')) {
115
-        	//writing to the file
116
- 		}
117
-	}
99
+    if(!isset($sugar_config['resource_management'])){
100
+        $sugar_config['resource_management'] =
101
+            array (
102
+            'special_query_limit' => 50000,
103
+            'special_query_modules' =>
104
+            array (
105
+                0 => 'Reports',
106
+                1 => 'Export',
107
+                2 => 'Import',
108
+                3 => 'Administration',
109
+                4 => 'Sync',
110
+            ),
111
+            'default_limit' => 1000,
112
+            );
113
+            ksort($sugar_config);
114
+            if(is_writable('config.php') && write_array_to_file("sugar_config", $sugar_config,'config.php')) {
115
+            //writing to the file
116
+            }
117
+    }
118 118
 }
119 119
 
120 120
 
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
 
172 172
 function rebuildRelations($pre_path = '')
173 173
 {
174
-	$_REQUEST['silent'] = true;
175
-	include($pre_path.'modules/Administration/RebuildRelationship.php');
176
-	$_REQUEST['upgradeWizard'] = true;
177
-	include($pre_path.'modules/ACL/install_actions.php');
174
+    $_REQUEST['silent'] = true;
175
+    include($pre_path.'modules/Administration/RebuildRelationship.php');
176
+    $_REQUEST['upgradeWizard'] = true;
177
+    include($pre_path.'modules/ACL/install_actions.php');
178 178
 }
179 179
 
180 180
 //Bug 52872. Dies if the request does not come from CLI.
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
 
187 187
 // only run from command line
188 188
 if(isset($_SERVER['HTTP_USER_AGENT'])) {
189
-	fwrite(STDERR,'This utility may only be run from the command line or command prompt.');
190
-	exit(1);
189
+    fwrite(STDERR,'This utility may only be run from the command line or command prompt.');
190
+    exit(1);
191 191
 }
192 192
 //Clean_string cleans out any file  passed in as a parameter
193 193
 $_SERVER['PHP_SELF'] = 'silentUpgrade.php';
@@ -248,60 +248,60 @@  discard block
 block discarded – undo
248 248
 $isDCEInstance = false;
249 249
 $errors = array();
250 250
 
251
-	require('config.php');
252
-	if(isset($argv[3])) {
253
-		if(is_dir($argv[3])) {
254
-			$cwd = $argv[3];
255
-			chdir($cwd);
256
-		}
257
-	}
251
+    require('config.php');
252
+    if(isset($argv[3])) {
253
+        if(is_dir($argv[3])) {
254
+            $cwd = $argv[3];
255
+            chdir($cwd);
256
+        }
257
+    }
258 258
 
259
-	require_once("{$cwd}/sugar_version.php"); // provides $sugar_version & $sugar_flavor
259
+    require_once("{$cwd}/sugar_version.php"); // provides $sugar_version & $sugar_flavor
260 260
 
261
-	global $sugar_config;
262
-	$configOptions = $sugar_config['dbconfig'];
261
+    global $sugar_config;
262
+    $configOptions = $sugar_config['dbconfig'];
263 263
 
264 264
     $GLOBALS['log']	= LoggerManager::getLogger('SugarCRM');
265
-	$patchName		= basename($argv[1]);
266
-	$zip_from_dir	= substr($patchName, 0, strlen($patchName) - 4); // patch folder name (minus ".zip")
267
-	$path			= $argv[2]; // custom log file, if blank will use ./upgradeWizard.log
265
+    $patchName		= basename($argv[1]);
266
+    $zip_from_dir	= substr($patchName, 0, strlen($patchName) - 4); // patch folder name (minus ".zip")
267
+    $path			= $argv[2]; // custom log file, if blank will use ./upgradeWizard.log
268 268
     $db				= &DBManagerFactory::getInstance();
269
-	$UWstrings		= return_module_language('en_us', 'UpgradeWizard', true);
270
-	$adminStrings	= return_module_language('en_us', 'Administration', true);
269
+    $UWstrings		= return_module_language('en_us', 'UpgradeWizard', true);
270
+    $adminStrings	= return_module_language('en_us', 'Administration', true);
271 271
     $app_list_strings = return_app_list_strings_language('en_us');
272
-	$mod_strings	= array_merge($adminStrings, $UWstrings);
273
-	$subdirs		= array('full', 'langpack', 'module', 'patch', 'theme', 'temp');
274
-	global $unzip_dir;
272
+    $mod_strings	= array_merge($adminStrings, $UWstrings);
273
+    $subdirs		= array('full', 'langpack', 'module', 'patch', 'theme', 'temp');
274
+    global $unzip_dir;
275 275
     $license_accepted = false;
276 276
     if(isset($argv[5]) && (strtolower($argv[5])=='yes' || strtolower($argv[5])=='y')){
277
-    	$license_accepted = true;
278
-	 }
279
-	//////////////////////////////////////////////////////////////////////////////
280
-	//Adding admin user to the silent upgrade
281
-
282
-	$current_user = new User();
283
-	if(isset($argv[4])) {
284
-	   //if being used for internal upgrades avoid admin user verification
285
-	   $user_name = $argv[4];
286
-	   $q = "select id from users where user_name = '" . $user_name . "' and is_admin=1";
287
-	   $result = $GLOBALS['db']->query($q, false);
288
-	   $logged_user = $GLOBALS['db']->fetchByAssoc($result);
289
-	   if(isset($logged_user['id']) && $logged_user['id'] != null){
290
-		//do nothing
291
-	    $current_user->retrieve($logged_user['id']);
292
-	   }
293
-	   else{
294
-	   	echo "Not an admin user in users table. Please provide an admin user\n";
295
-		exit(1);
296
-	   }
297
-	}
298
-	else {
299
-		echo "*******************************************************************************\n";
300
-		echo "*** ERROR: 4th parameter must be a valid admin user.\n";
301
-		echo $usage;
302
-		echo "FAILURE\n";
303
-		exit(1);
304
-	}
277
+        $license_accepted = true;
278
+        }
279
+    //////////////////////////////////////////////////////////////////////////////
280
+    //Adding admin user to the silent upgrade
281
+
282
+    $current_user = new User();
283
+    if(isset($argv[4])) {
284
+        //if being used for internal upgrades avoid admin user verification
285
+        $user_name = $argv[4];
286
+        $q = "select id from users where user_name = '" . $user_name . "' and is_admin=1";
287
+        $result = $GLOBALS['db']->query($q, false);
288
+        $logged_user = $GLOBALS['db']->fetchByAssoc($result);
289
+        if(isset($logged_user['id']) && $logged_user['id'] != null){
290
+        //do nothing
291
+        $current_user->retrieve($logged_user['id']);
292
+        }
293
+        else{
294
+            echo "Not an admin user in users table. Please provide an admin user\n";
295
+        exit(1);
296
+        }
297
+    }
298
+    else {
299
+        echo "*******************************************************************************\n";
300
+        echo "*** ERROR: 4th parameter must be a valid admin user.\n";
301
+        echo $usage;
302
+        echo "FAILURE\n";
303
+        exit(1);
304
+    }
305 305
 
306 306
 /////retrieve admin user
307 307
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 
316 316
 mkdir_recursive($unzip_dir);
317 317
 if(!is_dir($unzip_dir)) {
318
-	fwrite(STDERR,"\n{$unzip_dir} is not an available directory\nFAILURE\n");
318
+    fwrite(STDERR,"\n{$unzip_dir} is not an available directory\nFAILURE\n");
319 319
     exit(1);
320 320
 }
321 321
 unzip($argv[1], $unzip_dir);
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 
327 327
 
328 328
 if(function_exists('set_upgrade_vars')){
329
-	set_upgrade_vars();
329
+    set_upgrade_vars();
330 330
 }
331 331
 
332 332
 ///////////////////////////////////////////////////////////////////////////////
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 
351 351
 logThis('Upgrading user preferences start .', $path);
352 352
 if(function_exists('upgradeUserPreferences')){
353
-   upgradeUserPreferences();
353
+    upgradeUserPreferences();
354 354
 }
355 355
 logThis('Upgrading user preferences finish .', $path);
356 356
 
@@ -374,8 +374,8 @@  discard block
 block discarded – undo
374 374
 //Add the cache cleaning here.
375 375
 if(function_exists('deleteCache'))
376 376
 {
377
-	logThis('Call deleteCache', $path);
378
-	@deleteCache();
377
+    logThis('Call deleteCache', $path);
378
+    @deleteCache();
379 379
 }
380 380
 /*
381 381
 // creating full text search logic hooks
@@ -418,50 +418,50 @@  discard block
 block discarded – undo
418 418
 
419 419
 $repairedTables = array();
420 420
 foreach ($beanFiles as $bean => $file) {
421
-	if(file_exists($file)){
422
-		unset($GLOBALS['dictionary'][$bean]);
423
-		require_once($file);
424
-		$focus = new $bean ();
425
-		if(empty($focus->table_name) || isset($repairedTables[$focus->table_name])) {
426
-		   continue;
427
-		}
428
-
429
-		if (($focus instanceOf SugarBean)) {
430
-			if(!isset($repairedTables[$focus->table_name]))
431
-			{
432
-				$sql = $GLOBALS['db']->repairTable($focus, true);
421
+    if(file_exists($file)){
422
+        unset($GLOBALS['dictionary'][$bean]);
423
+        require_once($file);
424
+        $focus = new $bean ();
425
+        if(empty($focus->table_name) || isset($repairedTables[$focus->table_name])) {
426
+            continue;
427
+        }
428
+
429
+        if (($focus instanceOf SugarBean)) {
430
+            if(!isset($repairedTables[$focus->table_name]))
431
+            {
432
+                $sql = $GLOBALS['db']->repairTable($focus, true);
433 433
                 if(trim($sql) != '')
434 434
                 {
435
-				    logThis('Running sql:' . $sql, $path);
435
+                    logThis('Running sql:' . $sql, $path);
436 436
                 }
437
-				$repairedTables[$focus->table_name] = true;
438
-			}
437
+                $repairedTables[$focus->table_name] = true;
438
+            }
439 439
 
440
-			//Check to see if we need to create the audit table
441
-		    if($focus->is_AuditEnabled() && !$focus->db->tableExists($focus->get_audit_table_name())){
442
-               logThis('Creating audit table:' . $focus->get_audit_table_name(), $path);
443
-		       $focus->create_audit_table();
440
+            //Check to see if we need to create the audit table
441
+            if($focus->is_AuditEnabled() && !$focus->db->tableExists($focus->get_audit_table_name())){
442
+                logThis('Creating audit table:' . $focus->get_audit_table_name(), $path);
443
+                $focus->create_audit_table();
444 444
             }
445
-		}
446
-	}
445
+        }
446
+    }
447 447
 }
448 448
 
449 449
 unset ($dictionary);
450 450
 include ("{$argv[3]}/modules/TableDictionary.php");
451 451
 foreach ($dictionary as $meta) {
452
-	$tablename = $meta['table'];
452
+    $tablename = $meta['table'];
453 453
 
454
-	if(isset($repairedTables[$tablename])) {
455
-	   continue;
456
-	}
454
+    if(isset($repairedTables[$tablename])) {
455
+        continue;
456
+    }
457 457
 
458
-	$fielddefs = $meta['fields'];
459
-	$indices = $meta['indices'];
460
-	$sql = $GLOBALS['db']->repairTableParams($tablename, $fielddefs, $indices, true);
461
-	if(!empty($sql)) {
462
-	    logThis($sql, $path);
463
-	    $repairedTables[$tablename] = true;
464
-	}
458
+    $fielddefs = $meta['fields'];
459
+    $indices = $meta['indices'];
460
+    $sql = $GLOBALS['db']->repairTableParams($tablename, $fielddefs, $indices, true);
461
+    if(!empty($sql)) {
462
+        logThis($sql, $path);
463
+        $repairedTables[$tablename] = true;
464
+    }
465 465
 
466 466
 }
467 467
 
@@ -482,18 +482,18 @@  discard block
 block discarded – undo
482 482
 
483 483
 
484 484
 if($ce_to_pro_ent) {
485
-	//add the global team if it does not exist
486
-	$globalteam = new Team();
487
-	$globalteam->retrieve('1');
488
-	require_once($unzip_dir.'/'.$zip_from_dir.'/modules/Administration/language/en_us.lang.php');
489
-	if(isset($globalteam->name)){
490
-		echo 'Global '.$mod_strings['LBL_UPGRADE_TEAM_EXISTS'].'<br>';
491
-		logThis(" Finish Building Global Team", $path);
492
-	}else{
493
-		$globalteam->create_team("Global", $mod_strings['LBL_GLOBAL_TEAM_DESC'], $globalteam->global_team);
494
-	}
495
-
496
-	logThis(" Start Building private teams", $path);
485
+    //add the global team if it does not exist
486
+    $globalteam = new Team();
487
+    $globalteam->retrieve('1');
488
+    require_once($unzip_dir.'/'.$zip_from_dir.'/modules/Administration/language/en_us.lang.php');
489
+    if(isset($globalteam->name)){
490
+        echo 'Global '.$mod_strings['LBL_UPGRADE_TEAM_EXISTS'].'<br>';
491
+        logThis(" Finish Building Global Team", $path);
492
+    }else{
493
+        $globalteam->create_team("Global", $mod_strings['LBL_GLOBAL_TEAM_DESC'], $globalteam->global_team);
494
+    }
495
+
496
+    logThis(" Start Building private teams", $path);
497 497
 
498 498
     upgradeModulesForTeam();
499 499
     logThis(" Finish Building private teams", $path);
@@ -502,12 +502,12 @@  discard block
 block discarded – undo
502 502
     upgradeModulesForTeamsets();
503 503
     logThis(" Finish Building the team_set and team_sets_teams", $path);
504 504
 
505
-	logThis(" Start modules/Administration/upgradeTeams.php", $path);
505
+    logThis(" Start modules/Administration/upgradeTeams.php", $path);
506 506
         include('modules/Administration/upgradeTeams.php');
507 507
         logThis(" Finish modules/Administration/upgradeTeams.php", $path);
508 508
 
509 509
     if(check_FTS()){
510
-    	$GLOBALS['db']->full_text_indexing_setup();
510
+        $GLOBALS['db']->full_text_indexing_setup();
511 511
     }
512 512
 }
513 513
 
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 //Unlink files that have been removed
526 526
 if(function_exists('unlinkUpgradeFiles'))
527 527
 {
528
-	unlinkUpgradeFiles($sugar_version);
528
+    unlinkUpgradeFiles($sugar_version);
529 529
 }
530 530
 
531 531
 if(function_exists('rebuildSprites') && function_exists('imagecreatetruecolor'))
@@ -542,11 +542,11 @@  discard block
 block discarded – undo
542 542
 ///////////////////////////////////////////////////////////////////////////////
543 543
 ////	TAKE OUT TRASH
544 544
 if(empty($errors)) {
545
-	set_upgrade_progress('end','in_progress','unlinkingfiles','in_progress');
546
-	logThis('Taking out the trash, unlinking temp files.', $path);
547
-	unlinkUWTempFiles();
548
-	removeSilentUpgradeVarsCache();
549
-	logThis('Taking out the trash, done.', $path);
545
+    set_upgrade_progress('end','in_progress','unlinkingfiles','in_progress');
546
+    logThis('Taking out the trash, unlinking temp files.', $path);
547
+    unlinkUWTempFiles();
548
+    removeSilentUpgradeVarsCache();
549
+    logThis('Taking out the trash, done.', $path);
550 550
 }
551 551
 
552 552
 ///////////////////////////////////////////////////////////////////////////////
@@ -557,20 +557,20 @@  discard block
 block discarded – undo
557 557
 logThis("**** Potential PHP generated error messages: {$phpErrors}", $path);
558 558
 
559 559
 if(count($errors) > 0) {
560
-	foreach($errors as $error) {
561
-		logThis("****** SilentUpgrade ERROR: {$error}", $path);
562
-	}
563
-	echo "FAILED\n";
560
+    foreach($errors as $error) {
561
+        logThis("****** SilentUpgrade ERROR: {$error}", $path);
562
+    }
563
+    echo "FAILED\n";
564 564
 } else {
565
-	logThis("***** SilentUpgrade completed successfully.", $path);
566
-	echo "********************************************************************\n";
567
-	echo "*************************** SUCCESS*********************************\n";
568
-	echo "********************************************************************\n";
569
-	echo "******** If your pre-upgrade Leads data is not showing  ************\n";
570
-	echo "******** Or you see errors in detailview subpanels  ****************\n";
571
-	echo "************* In order to resolve them  ****************************\n";
572
-	echo "******** Log into application as Administrator  ********************\n";
573
-	echo "******** Go to Admin panel  ****************************************\n";
574
-	echo "******** Run Repair -> Rebuild Relationships  **********************\n";
575
-	echo "********************************************************************\n";
565
+    logThis("***** SilentUpgrade completed successfully.", $path);
566
+    echo "********************************************************************\n";
567
+    echo "*************************** SUCCESS*********************************\n";
568
+    echo "********************************************************************\n";
569
+    echo "******** If your pre-upgrade Leads data is not showing  ************\n";
570
+    echo "******** Or you see errors in detailview subpanels  ****************\n";
571
+    echo "************* In order to resolve them  ****************************\n";
572
+    echo "******** Log into application as Administrator  ********************\n";
573
+    echo "******** Go to Admin panel  ****************************************\n";
574
+    echo "******** Run Repair -> Rebuild Relationships  **********************\n";
575
+    echo "********************************************************************\n";
576 576
 }
Please login to merge, or discard this patch.
modules/UpgradeWizard/preflightJson.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -46,40 +46,40 @@
 block discarded – undo
46 46
  * *******************************************************************************/
47 47
 
48 48
 if(ob_get_level() < 1)
49
-	ob_start();
49
+    ob_start();
50 50
 ob_implicit_flush(1);
51 51
 
52 52
 // load the generated persistence file if found
53 53
 $persistence = array();
54 54
 if(file_exists($persist = sugar_cached('/modules/UpgradeWizard/_persistence.php'))) {
55
-	require_once $persist;
55
+    require_once $persist;
56 56
 }
57 57
 require_once('modules/UpgradeWizard/uw_utils.php');
58 58
 require_once('include/utils/zip_utils.php');
59 59
 
60 60
 switch($_REQUEST['preflightStep']) {
61
-	case 'find_upgrade_files':
62
-		logThis('preflightJson finding upgrade files');
63
-		ob_end_flush();
64
-		$persistence['upgrade_files'] = preflightCheckJsonFindUpgradeFiles();
65
-	break;
61
+    case 'find_upgrade_files':
62
+        logThis('preflightJson finding upgrade files');
63
+        ob_end_flush();
64
+        $persistence['upgrade_files'] = preflightCheckJsonFindUpgradeFiles();
65
+    break;
66 66
 
67
-	case 'diff_upgrade_files':
68
-		logThis('preflightJson diffing upgrade files');
69
-		ob_end_flush();
70
-		$persistence = preflightCheckJsonDiffFiles();
71
-	break;
67
+    case 'diff_upgrade_files':
68
+        logThis('preflightJson diffing upgrade files');
69
+        ob_end_flush();
70
+        $persistence = preflightCheckJsonDiffFiles();
71
+    break;
72 72
 
73
-	case 'get_diff_results':
74
-		logThis('preflightJson getting diff results for display');
75
-		ob_end_flush();
76
-		$persistence = preflightCheckJsonGetDiff();
77
-	break;
73
+    case 'get_diff_results':
74
+        logThis('preflightJson getting diff results for display');
75
+        ob_end_flush();
76
+        $persistence = preflightCheckJsonGetDiff();
77
+    break;
78 78
 
79
-	case 'get_diff_errors':
80
-		logThis('preflightJson getting diff errors (if any)');
81
-		preflightCheckJsonGetDiffErrors();
82
-	break;
79
+    case 'get_diff_errors':
80
+        logThis('preflightJson getting diff errors (if any)');
81
+        preflightCheckJsonGetDiffErrors();
82
+    break;
83 83
 }
84 84
 
85 85
 write_array_to_file('persistence', $persistence, $persist);
Please login to merge, or discard this patch.
modules/UpgradeWizard/UploadFileCheck.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -38,10 +38,10 @@  discard block
 block discarded – undo
38 38
  * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
39 39
  ********************************************************************************/
40 40
 
41
- //Request object must have these property values:
42
- //		Module: module name, this module should have a file called TreeData.php
43
- //		Function: name of the function to be called in TreeData.php, the function will be called statically.
44
- //		PARAM prefixed properties: array of these property/values will be passed to the function as parameter.
41
+    //Request object must have these property values:
42
+    //		Module: module name, this module should have a file called TreeData.php
43
+    //		Function: name of the function to be called in TreeData.php, the function will be called statically.
44
+    //		PARAM prefixed properties: array of these property/values will be passed to the function as parameter.
45 45
 
46 46
 require_once('include/JSON.php');
47 47
 require_once('include/upload_file.php');
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 
51 51
 $json = getJSONobj();
52 52
 $file_name = $json->decode(html_entity_decode($_REQUEST['file_name']));
53
- if(isset($file_name['jsonObject']) && $file_name['jsonObject'] != null){
54
-	$file_name = $file_name['jsonObject'];
55
-  }
53
+    if(isset($file_name['jsonObject']) && $file_name['jsonObject'] != null){
54
+    $file_name = $file_name['jsonObject'];
55
+    }
56 56
 
57 57
 $filesize = '';
58 58
 if(file_exists($file_name)){
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
 //$uploadSizeIni = substr(ini_get("upload_max_filesize"), 0, strlen( ini_get("upload_max_filesize")) - 1);
74 74
 //$GLOBALS['log']->fatal('Upload php setting Size '.return_bytes(ini_get("upload_max_filesize")));
75 75
 if($filesize != null){
76
-	if(($filesize > return_bytes(ini_get("upload_max_filesize"))) || ($filesize > return_bytes(ini_get("post_max_size")))){
77
-		$response=$filesize;
78
-		//$response= "<script>alert('File size is bigger than the max_upload-size setting in php.ini. Upgrade attempt will fail. Increase the upload_max_size in php.ini to greater than ')</script>";
79
-	}
76
+    if(($filesize > return_bytes(ini_get("upload_max_filesize"))) || ($filesize > return_bytes(ini_get("post_max_size")))){
77
+        $response=$filesize;
78
+        //$response= "<script>alert('File size is bigger than the max_upload-size setting in php.ini. Upgrade attempt will fail. Increase the upload_max_size in php.ini to greater than ')</script>";
79
+    }
80 80
 }
81 81
 
82 82
 if (!empty($response)) {
Please login to merge, or discard this patch.
modules/UpgradeWizard/upgradeTimeCounter.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -72,18 +72,18 @@
 block discarded – undo
72 72
  }
73 73
 */
74 74
 
75
- $_SESSION['totalUpgradeTime'] = $_SESSION['totalUpgradeTime']+$_REQUEST['upgradeStepTime'];
76
- $response = $_SESSION['totalUpgradeTime'];
75
+    $_SESSION['totalUpgradeTime'] = $_SESSION['totalUpgradeTime']+$_REQUEST['upgradeStepTime'];
76
+    $response = $_SESSION['totalUpgradeTime'];
77 77
 
78 78
 $GLOBALS['log']->fatal('TOTAL TIME .....'.$_SESSION['totalUpgradeTime']);
79
- //$uptime = $uptime+$_REQUEST['upgradeStepTime'];
80
- $GLOBALS['log']->fatal($response);
79
+    //$uptime = $uptime+$_REQUEST['upgradeStepTime'];
80
+    $GLOBALS['log']->fatal($response);
81 81
 
82 82
 
83
- if (!empty($response)) {
83
+    if (!empty($response)) {
84 84
     $json = getJSONobj();
85
-	print $json->encode($response);
86
- }
85
+    print $json->encode($response);
86
+    }
87 87
 
88 88
 sugar_cleanup();
89 89
 exit();
Please login to merge, or discard this patch.
modules/UpgradeWizard/UpgradeRemoval.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
  */
69 69
 public function getFilesToRemove($version)
70 70
 {
71
-	return array();
71
+    return array();
72 72
 }
73 73
 
74 74
 /**
@@ -79,31 +79,31 @@  discard block
 block discarded – undo
79 79
  */
80 80
 public function processFilesToRemove($files=array())
81 81
 {
82
-	if(empty($files) || !is_array($files))
83
-	{
84
-		return;
85
-	}	
82
+    if(empty($files) || !is_array($files))
83
+    {
84
+        return;
85
+    }	
86 86
 	
87
-	require_once('include/dir_inc.php');
87
+    require_once('include/dir_inc.php');
88 88
 	
89
-	if(!file_exists('custom/backup'))
90
-	{
91
-	   mkdir_recursive('custom/backup');
92
-	}
89
+    if(!file_exists('custom/backup'))
90
+    {
91
+        mkdir_recursive('custom/backup');
92
+    }
93 93
 	
94
-	foreach($files as $file)
95
-	{		
96
-		if(file_exists($file))
97
-		{
98
-			$this->backup($file);   
99
-			if(is_dir($file))
100
-			{
101
-			  rmdir_recursive($file);	
102
-			} else {
103
-			  unlink($file);
104
-			}
105
-	    }
106
-	}
94
+    foreach($files as $file)
95
+    {		
96
+        if(file_exists($file))
97
+        {
98
+            $this->backup($file);   
99
+            if(is_dir($file))
100
+            {
101
+                rmdir_recursive($file);	
102
+            } else {
103
+                unlink($file);
104
+            }
105
+        }
106
+    }
107 107
 }
108 108
 
109 109
 
@@ -115,20 +115,20 @@  discard block
 block discarded – undo
115 115
  */
116 116
 protected function backup($file)
117 117
 {
118
-	$basename = basename($file);
119
-	$basepath = str_replace($basename, '', $file);
118
+    $basename = basename($file);
119
+    $basepath = str_replace($basename, '', $file);
120 120
 
121
-	if(!empty($basepath) && !file_exists('custom/backup/' . $basepath))
122
-	{
123
-	   mkdir_recursive('custom/backup/' . $basepath);
124
-	}
121
+    if(!empty($basepath) && !file_exists('custom/backup/' . $basepath))
122
+    {
123
+        mkdir_recursive('custom/backup/' . $basepath);
124
+    }
125 125
 	
126
-	if(is_dir($file))
127
-	{
128
-    	copy_recursive($file, 'custom/backup/' . $file);	
129
-	} else {
130
-		copy($file, 'custom/backup/' . $file);
131
-	}
126
+    if(is_dir($file))
127
+    {
128
+        copy_recursive($file, 'custom/backup/' . $file);	
129
+    } else {
130
+        copy($file, 'custom/backup/' . $file);
131
+    }
132 132
 }
133 133
 
134 134
 }
Please login to merge, or discard this patch.
modules/UpgradeWizard/populateColumns.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -38,10 +38,10 @@  discard block
 block discarded – undo
38 38
  * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
39 39
  ********************************************************************************/
40 40
 
41
- //Request object must have these property values:
42
- //		Module: module name, this module should have a file called TreeData.php
43
- //		Function: name of the function to be called in TreeData.php, the function will be called statically.
44
- //		PARAM prefixed properties: array of these property/values will be passed to the function as parameter.
41
+    //Request object must have these property values:
42
+    //		Module: module name, this module should have a file called TreeData.php
43
+    //		Function: name of the function to be called in TreeData.php, the function will be called statically.
44
+    //		PARAM prefixed properties: array of these property/values will be passed to the function as parameter.
45 45
 
46 46
 require_once('include/JSON.php');
47 47
 require_once('include/entryPoint.php');
@@ -52,25 +52,25 @@  discard block
 block discarded – undo
52 52
 
53 53
 $json = getJSONobj();
54 54
 $selectedTable = $json->decode(html_entity_decode($_REQUEST['selectedTable']));
55
- if(isset($tagArticleIds['jsonObject']) && $tagArticleIds['jsonObject'] != null){
56
-	$selectedTable = $selectedTable['jsonObject'];
57
-  }
55
+    if(isset($tagArticleIds['jsonObject']) && $tagArticleIds['jsonObject'] != null){
56
+    $selectedTable = $selectedTable['jsonObject'];
57
+    }
58 58
 $GLOBALS['log']->fatal('************ comes here *********');
59 59
 //$GLOBALS['log']->fatal($_REQUEST['selectedTable']);
60 60
 function tableColumns($table_name){
61
-	$GLOBALS['log']->fatal('********TABLE PASSED******* '.$table_name);
62
-	global $sugar_config;
63
-	global $setup_db_database_name;
61
+    $GLOBALS['log']->fatal('********TABLE PASSED******* '.$table_name);
62
+    global $sugar_config;
63
+    global $setup_db_database_name;
64 64
     global $setup_db_host_name;
65 65
     global $setup_db_host_instance;
66 66
     global $setup_db_admin_user_name;
67 67
     global $setup_db_admin_password;
68 68
     
69
-	//$db = &DBManagerFactory::getInstance('information_schema');
69
+    //$db = &DBManagerFactory::getInstance('information_schema');
70 70
 
71
-	$db_name= $sugar_config['dbconfig']['db_name'];
72
-	$setup_db_host_name = $sugar_config['dbconfig']['db_host_name'];
73
-  	$setup_db_admin_user_name = $sugar_config['dbconfig']['db_user_name'];
71
+    $db_name= $sugar_config['dbconfig']['db_name'];
72
+    $setup_db_host_name = $sugar_config['dbconfig']['db_host_name'];
73
+        $setup_db_admin_user_name = $sugar_config['dbconfig']['db_user_name'];
74 74
     $setup_db_host_instance = $sugar_config['dbconfig']['db_host_instance'];
75 75
     $setup_db_admin_password = $sugar_config['dbconfig']['db_password'];
76 76
 
@@ -78,27 +78,27 @@  discard block
 block discarded – undo
78 78
     mysql_select_db('information_schema');
79 79
 
80 80
     $qu="SELECT column_name FROM information_schema.columns WHERE table_schema = '".$db_name."' AND table_name = '".$table_name."'";
81
-	$ct =mysql_query($qu,$link);
81
+    $ct =mysql_query($qu,$link);
82 82
     //$cols= '';
83 83
     $colsDrop = array();
84 84
     while($row = mysql_fetch_assoc($ct)){
85
-    	 $colsDrop[] =$row['column_name'];
85
+            $colsDrop[] =$row['column_name'];
86 86
     }
87 87
     return $colsDrop;
88 88
 }
89 89
 
90 90
 $colsDrop = tableColumns($_REQUEST['selectedTable']);
91 91
 if($colsDrop != null){
92
-	$colsDropDown = "<option value=".$_REQUEST['selectedTable']." Columns>".$_REQUEST['selectedTable']." Columns</option>";
93
-	foreach($colsDrop as $col){
94
-		$colsDropDown .="<option value={$col}>{$col}</option>";
95
-	}
92
+    $colsDropDown = "<option value=".$_REQUEST['selectedTable']." Columns>".$_REQUEST['selectedTable']." Columns</option>";
93
+    foreach($colsDrop as $col){
94
+        $colsDropDown .="<option value={$col}>{$col}</option>";
95
+    }
96 96
 }
97 97
 //$response = "<script>document.getElementById('select_column').innerHTML=$colsDropDown</script>";
98 98
 $response = $colsDropDown;
99 99
 
100 100
 if (!empty($response)) {
101
-	echo $response;
101
+    echo $response;
102 102
 }
103 103
 sugar_cleanup();
104 104
 exit();
Please login to merge, or discard this patch.
modules/UpgradeWizard/silentUpgrade.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -35,29 +35,29 @@  discard block
 block discarded – undo
35 35
  ********************************************************************************/
36 36
 
37 37
 function build_argument_string($arguments=array()) {
38
-   if(!is_array($arguments)) {
39
-   	  return '';
40
-   }
38
+    if(!is_array($arguments)) {
39
+            return '';
40
+    }
41 41
 
42
-   $argument_string = '';
43
-   $count = 0;
44
-   foreach($arguments as $arg) {
45
-   	   if($count != 0)
46
-   	   {
47
-   	   	  //If current directory or parent directory is specified, substitute with full path
48
-   	   	  if($arg == '.')
49
-   	   	  {
50
-   	   	  	 $arg = getcwd();
51
-   	   	  } else if ($arg == '..') {
52
-   	   	  	 $dir = getcwd();
53
-			 $arg = substr($dir, 0, strrpos($dir, DIRECTORY_SEPARATOR));
54
-   	   	  }
55
-          $argument_string .= ' ' . escapeshellarg($arg);
56
-   	   }
57
-   	   $count++;
58
-   }
42
+    $argument_string = '';
43
+    $count = 0;
44
+    foreach($arguments as $arg) {
45
+            if($count != 0)
46
+            {
47
+                //If current directory or parent directory is specified, substitute with full path
48
+                if($arg == '.')
49
+                {
50
+                        $arg = getcwd();
51
+                } else if ($arg == '..') {
52
+                        $dir = getcwd();
53
+                $arg = substr($dir, 0, strrpos($dir, DIRECTORY_SEPARATOR));
54
+                }
55
+            $argument_string .= ' ' . escapeshellarg($arg);
56
+            }
57
+            $count++;
58
+    }
59 59
 
60
-   return $argument_string;
60
+    return $argument_string;
61 61
 }
62 62
 
63 63
 //Bug 52872. Dies if the request does not come from CLI.
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
                 $run_dce_upgrade = true;
76 76
                 //set the php path if found
77 77
                 if(is_file($argv[7].'dce_config.php')){
78
-                   include($argv[7].'dce_config.php');
79
-                   $php_path = $dce_config['client_php_path'].'/';
78
+                    include($argv[7].'dce_config.php');
79
+                    $php_path = $dce_config['client_php_path'].'/';
80 80
                 }
81 81
 }
82 82
 
@@ -92,25 +92,25 @@  discard block
 block discarded – undo
92 92
 $has_error = $output == 0 ? false : true;
93 93
 
94 94
 if(!$has_error) {
95
-	if($run_dce_upgrade) {
96
-		$step2 = $php_path."php -f {$php_dir}silentUpgrade_dce_step1.php " . build_argument_string($argv);
97
-		passthru($step2, $output);
98
-	} else {
99
-		$step2 = "php -f {$php_dir}silentUpgrade_step2.php " . build_argument_string($argv);
100
-		passthru($step2, $output);
101
-	}
95
+    if($run_dce_upgrade) {
96
+        $step2 = $php_path."php -f {$php_dir}silentUpgrade_dce_step1.php " . build_argument_string($argv);
97
+        passthru($step2, $output);
98
+    } else {
99
+        $step2 = "php -f {$php_dir}silentUpgrade_step2.php " . build_argument_string($argv);
100
+        passthru($step2, $output);
101
+    }
102 102
 }
103 103
 
104 104
 if($run_dce_upgrade) {
105
-	$has_error = $output == 0 ? false : true;
106
-	if(!$has_error) {
107
-	   $step3 = $php_path."php -f {$php_dir}silentUpgrade_dce_step2.php " . build_argument_string($argv);
108
-	   passthru($step3, $output);
109
-	}
105
+    $has_error = $output == 0 ? false : true;
106
+    if(!$has_error) {
107
+        $step3 = $php_path."php -f {$php_dir}silentUpgrade_dce_step2.php " . build_argument_string($argv);
108
+        passthru($step3, $output);
109
+    }
110 110
 }
111 111
 
112 112
 if($output != 0) {
113
-   echo "***************         silentupgrade failed         ***************: $output\n";
113
+    echo "***************         silentupgrade failed         ***************: $output\n";
114 114
 }
115 115
 exit($output);
116 116
 ?>
Please login to merge, or discard this patch.
modules/AOR_Reports/vardefs.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -38,45 +38,45 @@  discard block
 block discarded – undo
38 38
  ********************************************************************************/
39 39
 
40 40
 $dictionary['AOR_Report'] = array(
41
-	'table'=>'aor_reports',
42
-	'audited'=>true,
43
-	'duplicate_merge'=>true,
44
-	'fields'=>array (
45
-	  'report_module' => 
46
-	  array (
47
-		'required' => true,
48
-		'name' => 'report_module',
49
-		'vname' => 'LBL_REPORT_MODULE',
50
-		'type' => 'enum',
51
-		'massupdate' => 0,
52
-		'default' => '',
53
-		'no_default' => false,
54
-		'comments' => '',
55
-		'help' => '',
56
-		'importable' => 'true',
57
-		'duplicate_merge' => 'disabled',
58
-		'duplicate_merge_dom_value' => '0',
59
-		'audited' => true,
60
-		'reportable' => true,
61
-		'unified_search' => false,
62
-		'merge_filter' => 'disabled',
63
-		'len' => 100,
64
-		'size' => '20',
65
-		'options' => 'aor_moduleList',
66
-		'studio' => 'visible',
67
-		'dependency' => false,
68
-	  ),
41
+    'table'=>'aor_reports',
42
+    'audited'=>true,
43
+    'duplicate_merge'=>true,
44
+    'fields'=>array (
45
+        'report_module' => 
46
+        array (
47
+        'required' => true,
48
+        'name' => 'report_module',
49
+        'vname' => 'LBL_REPORT_MODULE',
50
+        'type' => 'enum',
51
+        'massupdate' => 0,
52
+        'default' => '',
53
+        'no_default' => false,
54
+        'comments' => '',
55
+        'help' => '',
56
+        'importable' => 'true',
57
+        'duplicate_merge' => 'disabled',
58
+        'duplicate_merge_dom_value' => '0',
59
+        'audited' => true,
60
+        'reportable' => true,
61
+        'unified_search' => false,
62
+        'merge_filter' => 'disabled',
63
+        'len' => 100,
64
+        'size' => '20',
65
+        'options' => 'aor_moduleList',
66
+        'studio' => 'visible',
67
+        'dependency' => false,
68
+        ),
69 69
 
70
-	'graphs_per_row' =>
71
-	array (
72
-		'required' => true,
73
-		'name' => 'graphs_per_row',
74
-		'vname' => 'LBL_GRAPHS_PER_ROW',
75
-		'type' => 'int',
76
-		'massupdate' => 0,
77
-		'default' => 2,
78
-		'no_default' => false,
79
-	),
70
+    'graphs_per_row' =>
71
+    array (
72
+        'required' => true,
73
+        'name' => 'graphs_per_row',
74
+        'vname' => 'LBL_GRAPHS_PER_ROW',
75
+        'type' => 'int',
76
+        'massupdate' => 0,
77
+        'default' => 2,
78
+        'no_default' => false,
79
+    ),
80 80
 
81 81
     'field_lines' =>
82 82
     array (
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
             'include' => 'modules/AOR_Conditions/conditionLines.php'
119 119
         ),
120 120
     ),
121
-  'aor_fields' =>
122
-  array (
121
+    'aor_fields' =>
122
+    array (
123 123
     'name' => 'aor_fields',
124 124
     'type' => 'link',
125 125
     'relationship' => 'aor_reports_aor_fields',
@@ -127,26 +127,26 @@  discard block
 block discarded – undo
127 127
     'bean_name'=>'AOR_Field',
128 128
     'source'=>'non-db',
129 129
     'id_name' => 'aor_report_id',
130
-  ),
131
-  'aor_conditions' =>
132
-  array (
133
-     'name' => 'aor_conditions',
134
-     'type' => 'link',
135
-     'relationship' => 'aor_reports_aor_conditions',
136
-     'module'=>'AOR_Conditions',
137
-     'bean_name'=>'AOR_Condition',
138
-     'source'=>'non-db',
139
-  ),
140
-  'aor_charts' =>
141
-      array (
130
+    ),
131
+    'aor_conditions' =>
132
+    array (
133
+        'name' => 'aor_conditions',
134
+        'type' => 'link',
135
+        'relationship' => 'aor_reports_aor_conditions',
136
+        'module'=>'AOR_Conditions',
137
+        'bean_name'=>'AOR_Condition',
138
+        'source'=>'non-db',
139
+    ),
140
+    'aor_charts' =>
141
+        array (
142 142
         'name' => 'aor_charts',
143 143
         'type' => 'link',
144 144
         'relationship' => 'aor_charts_aor_reports',
145 145
         'source' => 'non-db',
146 146
         'id_name' => 'aor_report_id',
147 147
         'vname' => 'LBL_AOR_CHARTS',
148
-      ),
149
-  'aor_scheduled_reports' =>
148
+        ),
149
+    'aor_scheduled_reports' =>
150 150
     array (
151 151
         'name' => 'aor_scheduled_reports',
152 152
         'type' => 'link',
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
         'relationship_type'=>'one-to-many',
189 189
     ),
190 190
 ),
191
-	'optimistic_locking'=>true,
192
-	'unified_search'=>true,
191
+    'optimistic_locking'=>true,
192
+    'unified_search'=>true,
193 193
 );
194 194
 
195 195
 if (!class_exists('VardefManager')){
Please login to merge, or discard this patch.