public function testSilentUpgradeSessionVars()
 {
     require_once 'modules/UpgradeWizard/uw_utils.php';
     $varsCacheFileName = sugar_cached("/silentUpgrader/silentUpgradeCache.php");
     $loaded = loadSilentUpgradeVars();
     $this->assertTrue($loaded, "Could not load the silent upgrade vars");
     global $silent_upgrade_vars_loaded;
     $this->assertTrue(!empty($silent_upgrade_vars_loaded), "\$silent_upgrade_vars_loaded array should not be empty");
     $set = setSilentUpgradeVar('SDizzle', 'BSnizzle');
     $this->assertTrue($set, "Could not set a silent upgrade var");
     $get = getSilentUpgradeVar('SDizzle');
     $this->assertEquals('BSnizzle', $get, "Unexpected value when getting silent upgrade var before resetting");
     $write = writeSilentUpgradeVars();
     $this->assertTrue($write, "Could not write the silent upgrade vars to the cache file. Function returned false");
     $this->assertFileExists($varsCacheFileName, "Cache file doesn't exist after call to writeSilentUpgradeVars()");
     $output = shell_exec("php {$this->externalTestFileName}");
     $this->assertEquals('BSnizzle', $output, "Running custom script didn't successfully retrieve the value");
     $remove = removeSilentUpgradeVarsCache();
     $this->assertTrue(empty($silent_upgrade_vars_loaded), "Silent upgrade vars variable should have been unset in removeSilentUpgradeVarsCache() call");
     $this->assertFileNotExists($varsCacheFileName, "Cache file exists after call to removeSilentUpgradeVarsCache()");
     $get = getSilentUpgradeVar('SDizzle');
     $this->assertNotEquals('BSnizzle', $get, "Unexpected value when getting silent upgrade var after resetting");
 }
Ejemplo n.º 2
0
 ///////////////////////////////////////////////////////////////////////////////
 ////	COPY NEW FILES INTO TARGET INSTANCE
 if (!didThisStepRunBefore('commit', 'commitCopyNewFiles')) {
     set_upgrade_progress('commit', 'in_progress', 'commitCopyNewFiles', 'in_progress');
     $split = commitCopyNewFiles($unzip_dir, $zip_from_dir);
     $copiedFiles = $split['copiedFiles'];
     $skippedFiles = $split['skippedFiles'];
     set_upgrade_progress('commit', 'in_progress', 'commitCopyNewFiles', 'done');
 }
 require_once clean_path($unzip_dir . '/scripts/upgrade_utils.php');
 $new_sugar_version = getUpgradeVersion();
 $origVersion = substr(preg_replace("/[^0-9]/", "", $sugar_version), 0, 3);
 $destVersion = substr(preg_replace("/[^0-9]/", "", $new_sugar_version), 0, 3);
 $siv_varset_1 = setSilentUpgradeVar('origVersion', $origVersion);
 $siv_varset_2 = setSilentUpgradeVar('destVersion', $destVersion);
 $siv_write = writeSilentUpgradeVars();
 if (!$siv_varset_1 || !$siv_varset_2 || !$siv_write) {
     logThis("Error with silent upgrade variables: origVersion write success is ({$siv_varset_1}) " . "-- destVersion write success is ({$siv_varset_2}) -- " . "writeSilentUpgradeVars success is ({$siv_write}) -- " . "path to cache dir is ({$GLOBALS['sugar_config']['cache_dir']})", $path);
 }
 require_once 'modules/DynamicFields/templates/Fields/TemplateText.php';
 ///////////////////////////////////////////////////////////////////////////////
 ///    RELOAD NEW DEFINITIONS
 global $ACLActions, $beanList, $beanFiles;
 include 'modules/ACLActions/actiondefs.php';
 include 'include/modules.php';
 /////////////////////////////////////////////
 if (!function_exists("inDeveloperMode")) {
     //this function was introduced from tokyo in the file include/utils.php, so when upgrading from 5.1x and 5.2x we should declare the this function
     function inDeveloperMode()
     {
         return isset($GLOBALS['sugar_config']['developerMode']) && $GLOBALS['sugar_config']['developerMode'];