本文整理汇总了PHP中PackageManager::download方法的典型用法代码示例。如果您正苦于以下问题:PHP PackageManager::download方法的具体用法?PHP PackageManager::download怎么用?PHP PackageManager::download使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PackageManager
的用法示例。
在下文中一共展示了PackageManager::download方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$base_tmp_upgrade_dir = $base_upgrade_dir . "/temp";
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// HANDLE FILE UPLOAD AND PROCESSING
$errors = array();
$uploadResult = '';
//commitModules();
if (isset($_REQUEST['languagePackAction']) && !empty($_REQUEST['languagePackAction'])) {
switch ($_REQUEST['languagePackAction']) {
case 'upload':
$perform = false;
$tempFile = '';
if (isset($_REQUEST['release_id']) && $_REQUEST['release_id'] != "") {
require_once 'ModuleInstall/PackageManager/PackageManager.php';
$pm = new PackageManager();
$tempFile = $pm->download($_REQUEST['release_id'], getcwd() . '/' . $sugar_config['upload_dir']);
$perform = true;
//$base_filename = urldecode($tempFile);
} else {
$file = new UploadFile('language_pack');
if ($file->confirm_upload()) {
$perform = true;
if (strpos($file->mime_type, 'zip') !== false) {
// only .zip files
if (langPackFinalMove($file)) {
$perform = true;
} else {
$errors[] = $mod_strings['ERR_LANG_UPLOAD_3'];
}
} else {
$errors[] = $mod_strings['ERR_LANG_UPLOAD_2'];
示例2: logThis
///////////////////////////////////////////////////////////////////////////////
//// UPLOAD FILE PROCESSING
switch ($run) {
case 'upload':
logThis('running upload');
$perform = false;
$tempFile = '';
if (isset($_REQUEST['release_id']) && $_REQUEST['release_id'] != "") {
require_once 'ModuleInstall/PackageManager/PackageManager.php';
$pm = new PackageManager();
$tempFile = '';
$perform = false;
if (!empty($_SESSION['ML_PATCHES'])) {
$release_map = $_SESSION['ML_PATCHES'][$_REQUEST['release_id']];
if (!empty($release_map)) {
$tempFile = $pm->download($release_map['category_id'], $release_map['package_id'], $_REQUEST['release_id'], getcwd() . '/' . $sugar_config['upload_dir']);
$perform = true;
if ($release_map['type'] != 'patch') {
$pm->performSetup($tempFile, $release_map['type'], false);
header('Location: index.php?module=Administration&action=UpgradeWizard&view=module');
}
}
}
$base_filename = urldecode($tempFile);
} else {
if (empty($_FILES['upgrade_zip']['tmp_name'])) {
logThis('ERROR: no file uploaded!');
echo $mod_strings['ERR_UW_NO_FILE_UPLOADED'];
// add PHP error if isset
if (isset($_FILES['upgrade_zip']['error']) && !empty($_FILES['upgrade_zip']['error'])) {
$out = "<b><span class='error'>{$mod_strings['ERR_UW_PHP_FILE_ERRORS'][$_FILES['upgrade_zip']['error']]}</span></b><br />";
示例3: array
$base_tmp_upgrade_dir = $base_upgrade_dir . "/temp";
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// HANDLE FILE UPLOAD AND PROCESSING
$errors = array();
$uploadResult = '';
//commitModules();
if (isset($_REQUEST['languagePackAction']) && !empty($_REQUEST['languagePackAction'])) {
switch ($_REQUEST['languagePackAction']) {
case 'upload':
$perform = false;
$tempFile = '';
if (isset($_REQUEST['release_id']) && $_REQUEST['release_id'] != "") {
require_once 'ModuleInstall/PackageManager/PackageManager.php';
$pm = new PackageManager();
$tempFile = $pm->download($_REQUEST['release_id']);
$perform = true;
//$base_filename = urldecode($tempFile);
} else {
$file = new UploadFile('language_pack');
if ($file->confirm_upload()) {
$perform = true;
if (strpos($file->mime_type, 'zip') !== false) {
// only .zip files
$tempFile = $file->get_stored_filename();
if ($file->final_move($tempFile)) {
$perform = true;
} else {
$errors[] = $mod_strings['ERR_LANG_UPLOAD_3'];
}
} else {
示例4: logThis
///////////////////////////////////////////////////////////////////////////////
//// UPLOAD FILE PROCESSING
switch ($run) {
case 'upload':
logThis('running upload');
$perform = false;
$tempFile = '';
if (isset($_REQUEST['release_id']) && $_REQUEST['release_id'] != "") {
require_once 'ModuleInstall/PackageManager/PackageManager.php';
$pm = new PackageManager();
$tempFile = '';
$perform = false;
if (!empty($_SESSION['ML_PATCHES'])) {
$release_map = $_SESSION['ML_PATCHES'][$_REQUEST['release_id']];
if (!empty($release_map)) {
$tempFile = $pm->download($release_map['category_id'], $release_map['package_id'], $_REQUEST['release_id']);
$perform = true;
if ($release_map['type'] != 'patch') {
$pm->performSetup($tempFile, $release_map['type'], false);
header('Location: index.php?module=Administration&action=UpgradeWizard&view=module');
}
}
}
$base_filename = urldecode($tempFile);
} else {
$upload = new UploadFile('upgrade_zip');
/* Bug 51722 - Cannot Upload Upgrade File if System Settings Are Not Sufficient, Just Make sure that we can
upload no matter what, set the default to 60M */
global $sugar_config;
$upload_maxsize_backup = $sugar_config['upload_maxsize'];
$sugar_config['upload_maxsize'] = 60000000;
示例5: array
$base_upgrade_dir = "upload://upgrades";
$base_tmp_upgrade_dir = sugar_cached("upgrades/temp");
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// HANDLE FILE UPLOAD AND PROCESSING
$errors = array();
$uploadResult = '';
if (isset($_REQUEST['languagePackAction']) && !empty($_REQUEST['languagePackAction'])) {
switch ($_REQUEST['languagePackAction']) {
case 'upload':
$perform = false;
$tempFile = '';
if (isset($_REQUEST['release_id']) && $_REQUEST['release_id'] != "") {
require_once 'ModuleInstall/PackageManager/PackageManager.php';
$pm = new PackageManager();
$tempFile = $pm->download('3', '3', $_REQUEST['release_id'], $sugar_config['upload_dir']);
$perform = true;
//$base_filename = urldecode($tempFile);
} else {
$file = new UploadFile('language_pack');
if ($file->confirm_upload()) {
$perform = true;
}
if (strpos($file->mime_type, 'zip') !== false) {
// only .zip files
if (langPackFinalMove($file)) {
$perform = true;
} else {
$errors[] = $mod_strings['ERR_LANG_UPLOAD_3'];
}
} else {
示例6: PackageManager
$upload_max_filesize_bytes = return_bytes($upload_max_filesize);
if ($upload_max_filesize_bytes < constant('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES')) {
$GLOBALS['log']->debug("detected upload_max_filesize: {$upload_max_filesize}");
print '<p class="error">' . $mod_strings['MSG_INCREASE_UPLOAD_MAX_FILESIZE'] . ' ' . get_cfg_var('cfg_file_path') . "</p>\n";
}
//
// process "run" commands
//
if (isset($_REQUEST['run']) && $_REQUEST['run'] != "") {
$run = $_REQUEST['run'];
if ($run == "upload") {
$perform = false;
if (isset($_REQUEST['release_id']) && $_REQUEST['release_id'] != "") {
require_once 'ModuleInstall/PackageManager.php';
$pm = new PackageManager();
$tempFile = $pm->download('', '', $_REQUEST['release_id'], getAbsolutePath($sugar_config['upload_dir'], true));
$perform = true;
$base_filename = urldecode($tempFile);
} elseif (!empty($_REQUEST['load_module_from_dir'])) {
//copy file to proper location then call performSetup
$tempFile = getAbsolutePath($sugar_config['upload_dir'] . $_REQUEST['upgrade_zip_escaped'], true);
copy($_REQUEST['load_module_from_dir'] . '/' . $_REQUEST['upgrade_zip_escaped'], $tempFile);
$perform = true;
$base_filename = urldecode($_REQUEST['upgrade_zip_escaped']);
} else {
if (empty($_FILES['upgrade_zip']['tmp_name'])) {
echo $mod_strings['ERR_UW_NO_UPLOAD_FILE'];
} else {
if (!move_uploaded_file($_FILES['upgrade_zip']['tmp_name'], getAbsolutePath($sugar_config['upload_dir'] . $_FILES['upgrade_zip']['name'], true))) {
unlinkTempFiles();
die($mod_strings['ERR_NOT_VALID_UPLOAD']);