本文整理汇总了PHP中unlinkUWTempFiles函数的典型用法代码示例。如果您正苦于以下问题:PHP unlinkUWTempFiles函数的具体用法?PHP unlinkUWTempFiles怎么用?PHP unlinkUWTempFiles使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unlinkUWTempFiles函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: commitAjaxFinalTouches
/**
* does post-post-install stuff
* @param array persistence
* @return array persistence
*/
function commitAjaxFinalTouches($persistence)
{
global $current_user;
global $timedate;
global $mod_strings;
global $sugar_version;
if (empty($sugar_version)) {
require 'sugar_version.php';
}
// convert to UTF8 if needed
if (!empty($persistence['allTables'])) {
executeConvertTablesSql($persistence['allTables']);
}
// rebuild
logThis('Performing UWrebuild()...');
UWrebuild();
logThis('UWrebuild() done.');
// upgrade history
registerUpgrade($persistence);
// flag to say upgrade has completed
$persistence['upgrade_complete'] = true;
// reminders if needed
///////////////////////////////////////////////////////////////////////////////
//// HANDLE REMINDERS
if (count($persistence['skipped_files']) > 0) {
$desc = $mod_strings['LBL_UW_COMMIT_ADD_TASK_OVERVIEW'] . "\n\n";
$desc .= $mod_strings['LBL_UW_COMMIT_ADD_TASK_DESC_1'];
$desc .= $persistence['uw_restore_dir'] . "\n\n";
$desc .= $mod_strings['LBL_UW_COMMIT_ADD_TASK_DESC_2'] . "\n\n";
foreach ($persistence['skipped_files'] as $file) {
$desc .= $file . "\n";
}
//MFH #13468
$nowDate = $timedate->nowDbDate();
$nowTime = $timedate->asDbTime($timedate->getNow());
$nowDateTime = $nowDate . ' ' . $nowTime;
if ($_REQUEST['addTaskReminder'] == 'remind') {
logThis('Adding Task for admin for manual merge.');
$task = new Task();
$task->name = $mod_strings['LBL_UW_COMMIT_ADD_TASK_NAME'];
$task->description = $desc;
$task->date_due = $nowDate;
$task->time_due = $nowTime;
$task->priority = 'High';
$task->status = 'Not Started';
$task->assigned_user_id = $current_user->id;
$task->created_by = $current_user->id;
$task->date_entered = $nowDateTime;
$task->date_modified = $nowDateTime;
$task->save();
}
if ($_REQUEST['addEmailReminder'] == 'remind') {
logThis('Sending Reminder for admin for manual merge.');
$email = new Email();
$email->assigned_user_id = $current_user->id;
$email->name = $mod_strings['LBL_UW_COMMIT_ADD_TASK_NAME'];
$email->description = $desc;
$email->description_html = nl2br($desc);
$email->from_name = $current_user->full_name;
$email->from_addr = $current_user->email1;
$email->to_addrs_arr = $email->parse_addrs($current_user->email1, '', '', '');
$email->cc_addrs_arr = array();
$email->bcc_addrs_arr = array();
$email->date_entered = $nowDateTime;
$email->date_modified = $nowDateTime;
$email->send();
$email->save();
}
}
//// HANDLE REMINDERS
///////////////////////////////////////////////////////////////////////////////
// clean up
unlinkUWTempFiles();
ob_start();
echo 'done';
ob_flush();
return $persistence;
}
示例2: logThis
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* 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>
示例3: 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
//.........这里部分代码省略.........