本文整理汇总了PHP中resetUwSession函数的典型用法代码示例。如果您正苦于以下问题:PHP resetUwSession函数的具体用法?PHP resetUwSession怎么用?PHP resetUwSession使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resetUwSession函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logThis
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
********************************************************************************/
/*********************************************************************************
* Description:
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights
* Reserved. Contributor(s): ______________________________________..
* *******************************************************************************/
logThis('-----------------------------------------------------------------------------');
logThis('Upgrade started. At start.php');
//set the upgrade progress status.
set_upgrade_progress('start', 'in_progress');
unlinkUWTempFiles();
resetUwSession();
if (isset($_REQUEST['showUpdateWizardMessage']) && $_REQUEST['showUpdateWizardMessage'] == true) {
// set a flag to skip the upload screen
$_SESSION['skip_zip_upload'] = true;
$newUWMsg = <<<eoq
\t<table cellspacing="0" cellpadding="3" border="0">
\t\t<tr>
\t\t\t<th>
\t\t\t\t{$mod_strings['LBL_UW_START_UPGRADED_UW_TITLE']}
\t\t\t</th>
\t\t</tr>
\t\t<tr>
\t\t\t<td>
\t\t\t\t{$mod_strings['LBL_UW_START_UPGRADED_UW_DESC']}
\t\t\t</td>
\t\t</tr>
示例2: preflightCheck
function preflightCheck()
{
require_once 'modules/UpgradeWizard/uw_files.php';
global $sugar_config;
global $mod_strings;
global $sugar_version;
if (!isset($sugar_version) || empty($sugar_version)) {
require_once './sugar_version.php';
}
unset($_SESSION['rebuild_relationships']);
unset($_SESSION['rebuild_extensions']);
// don't bother if are rechecking
$manualDiff = array();
if (!isset($_SESSION['unzip_dir']) || empty($_SESSION['unzip_dir'])) {
logThis('unzipping files in upgrade archive...');
$errors = array();
list($base_upgrade_dir, $base_tmp_upgrade_dir) = getUWDirs();
$unzip_dir = '';
//Following is if User logged out unexpectedly and then logged into UpgradeWizard again.
//also come up with mechanism to read from upgrade-progress file.
if (!isset($_SESSION['install_file']) || empty($_SESSION['install_file']) || !is_file($_SESSION['install_file'])) {
if (file_exists($base_tmp_upgrade_dir) && ($handle = opendir($base_tmp_upgrade_dir))) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if (is_file($base_tmp_upgrade_dir . "/" . $file . "/manifest.php")) {
require_once $base_tmp_upgrade_dir . "/" . $file . "/manifest.php";
$package_name = $manifest['copy_files']['from_dir'];
if (file_exists($base_tmp_upgrade_dir . "/" . $file . "/" . $package_name) && file_exists($base_tmp_upgrade_dir . "/" . $file . "/scripts") && file_exists($base_tmp_upgrade_dir . "/" . $file . "/manifest.php")) {
$unzip_dir = $base_tmp_upgrade_dir . "/" . $file;
if (file_exists("{$base_upgrade_dir}/patch/" . $package_name . '.zip')) {
$_SESSION['install_file'] = $package_name . ".zip";
break;
}
}
}
}
}
}
}
if (empty($_SESSION['install_file'])) {
unlinkUWTempFiles();
resetUwSession();
echo 'Upload File not found so redirecting to Upgrade Start ';
$redirect_new_wizard = $sugar_config['site_url'] . '/index.php?module=UpgradeWizard&action=index';
echo '<form name="redirect" action="' . $redirect_new_wizard . '" method="POST">';
$upgrade_directories_not_found = <<<eoq
\t<table cellpadding="3" cellspacing="0" border="0">
\t\t<tr>
\t\t\t<th colspan="2" align="left">
\t\t\t\t<span class='error'><b>'Upload file missing or has been deleted. Refresh the page to go back to UpgradeWizard start'</b></span>
\t\t\t</th>
\t\t</tr>
\t</table>
eoq;
$uwMain = $upgrade_directories_not_found;
return '';
}
$install_file = "{$base_upgrade_dir}/patch/" . basename(urldecode($_SESSION['install_file']));
$show_files = true;
if (empty($unzip_dir)) {
$unzip_dir = mk_temp_dir($base_tmp_upgrade_dir);
}
$zip_from_dir = ".";
$zip_to_dir = ".";
$zip_force_copy = array();
if (!$unzip_dir) {
logThis('Could not create a temporary directory using mk_temp_dir( $base_tmp_upgrade_dir )');
die($mod_strings['ERR_UW_NO_CREATE_TMP_DIR']);
}
//double check whether unzipped .
if (file_exists($unzip_dir . "/scripts") && file_exists($unzip_dir . "/manifest.php")) {
//already unzipped
} else {
unzip($install_file, $unzip_dir);
}
// assumption -- already validated manifest.php at time of upload
require_once "{$unzip_dir}/manifest.php";
if (isset($manifest['copy_files']['from_dir']) && $manifest['copy_files']['from_dir'] != "") {
$zip_from_dir = $manifest['copy_files']['from_dir'];
}
if (isset($manifest['copy_files']['to_dir']) && $manifest['copy_files']['to_dir'] != "") {
$zip_to_dir = $manifest['copy_files']['to_dir'];
}
if (isset($manifest['copy_files']['force_copy']) && $manifest['copy_files']['force_copy'] != "") {
$zip_force_copy = $manifest['copy_files']['force_copy'];
}
if (isset($manifest['version'])) {
$version = $manifest['version'];
}
if (!is_writable("config.php")) {
return $mod_strings['ERR_UW_CONFIG'];
}
$_SESSION['unzip_dir'] = clean_path($unzip_dir);
$_SESSION['zip_from_dir'] = clean_path($zip_from_dir);
//logThis('unzip done.');
} else {
$unzip_dir = $_SESSION['unzip_dir'];
$zip_from_dir = $_SESSION['zip_from_dir'];
}
//check if $_SESSION['unzip_dir'] and $_SESSION['zip_from_dir'] exist
//.........这里部分代码省略.........