本文整理汇总了PHP中PackageManager::performInstall方法的典型用法代码示例。如果您正苦于以下问题:PHP PackageManager::performInstall方法的具体用法?PHP PackageManager::performInstall怎么用?PHP PackageManager::performInstall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PackageManager
的用法示例。
在下文中一共展示了PackageManager::performInstall方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: post_install_modules
/**
* This method will look for a file modules_post_install.php in the root directory and based on the
* contents of this file, it will silently install any modules as specified in this array.
*/
function post_install_modules()
{
if (is_file('modules_post_install.php')) {
global $current_user, $mod_strings;
$current_user = new User();
$current_user->is_admin = '1';
require_once 'ModuleInstall/PackageManager/PackageManager.php';
require_once 'modules_post_install.php';
//we now have the $modules_to_install array in memory
$pm = new PackageManager();
$old_mod_strings = $mod_strings;
foreach ($modules_to_install as $module_to_install) {
if (is_file($module_to_install)) {
$pm->performSetup($module_to_install, 'module', false);
$file_to_install = sugar_cached('upload/upgrades/module/') . basename($module_to_install);
$_REQUEST['install_file'] = $file_to_install;
$pm->performInstall($file_to_install);
}
}
$mod_strings = $old_mod_strings;
}
}
示例2: ModuleBuilder
function action_DeployPackage()
{
global $current_user;
if (defined('TEMPLATE_URL')) {
sugar_cache_reset();
SugarTemplateUtilities::disableCache();
}
//increment etag for menu so the new module shows up when the AJAX UI reloads
$current_user->incrementETag("mainMenuETag");
$mb = new ModuleBuilder();
$load = $_REQUEST['package'];
$message = $GLOBALS['mod_strings']['LBL_MODULE_DEPLOYED'];
if (!empty($load)) {
$zip = $mb->getPackage($load);
require_once 'ModuleInstall/PackageManager/PackageManager.php';
$pm = new PackageManager();
$info = $mb->packages[$load]->build(false);
$uploadDir = $pm->upload_dir . '/upgrades/module/';
mkdir_recursive($uploadDir);
rename($info['zip'], $uploadDir . $info['name'] . '.zip');
copy($info['manifest'], $uploadDir . $info['name'] . '-manifest.php');
$_REQUEST['install_file'] = $uploadDir . $info['name'] . '.zip';
$GLOBALS['mi_remove_tables'] = false;
$pm->performUninstall($load);
//#23177 , js cache clear
clearAllJsAndJsLangFilesWithoutOutput();
//#30747, clear the cache in memory
$cache_key = 'app_list_strings.' . $GLOBALS['current_language'];
sugar_cache_clear($cache_key);
sugar_cache_reset();
//clear end
$pm->performInstall($_REQUEST['install_file'], true);
//clear the unified_search_module.php file
require_once 'modules/Home/UnifiedSearchAdvanced.php';
UnifiedSearchAdvanced::unlinkUnifiedSearchModulesFile();
//bug 44269 - start
//clear workflow admin modules cache
if (isset($_SESSION['get_workflow_admin_modules_for_user'])) {
unset($_SESSION['get_workflow_admin_modules_for_user']);
}
//clear "is_admin_for_module" cache
$sessionVar = 'MLA_' . $current_user->user_name;
foreach ($mb->packages as $package) {
foreach ($package->modules as $module) {
$_SESSION[$sessionVar][$package->name . '_' . $module->name] = true;
}
}
//recreate acl cache
$actions = ACLAction::getUserActions($current_user->id, true);
//bug 44269 - end
}
echo 'complete';
}
示例3: ModuleBuilder
function action_DeployPackage()
{
if (defined('TEMPLATE_URL')) {
sugar_cache_reset();
SugarTemplateUtilities::disableCache();
}
$mb = new ModuleBuilder();
$load = $_REQUEST['package'];
$message = $GLOBALS['mod_strings']['LBL_MODULE_DEPLOYED'];
if (!empty($load)) {
$zip = $mb->getPackage($load);
require_once 'ModuleInstall/PackageManager/PackageManager.php';
$pm = new PackageManager();
$info = $mb->packages[$load]->build(false);
mkdir_recursive($GLOBALS['sugar_config']['cache_dir'] . '/upload/upgrades/module/');
rename($info['zip'], $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '.zip');
copy($info['manifest'], $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '-manifest.php');
$_REQUEST['install_file'] = $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '.zip';
$GLOBALS['mi_remove_tables'] = false;
$pm->performUninstall($load);
//#23177 , js cache clear
clearAllJsAndJsLangFilesWithoutOutput();
//#30747, clear the cache in memoy
$cache_key = 'app_list_strings.' . $GLOBALS['current_language'];
sugar_cache_clear($cache_key);
sugar_cache_reset();
//clear end
$pm->performInstall($_REQUEST['install_file']);
}
echo 'complete';
}
示例4: ModuleBuilder
function action_DeployPackage()
{
$mb = new ModuleBuilder();
$load = $_REQUEST['package'];
$message = $GLOBALS['mod_strings']['LBL_MODULE_DEPLOYED'];
if (!empty($load)) {
$zip = $mb->getPackage($load);
require_once 'ModuleInstall/PackageManager/PackageManager.php';
$pm = new PackageManager();
$info = $mb->packages[$load]->build(false);
mkdir_recursive($GLOBALS['sugar_config']['cache_dir'] . '/upload/upgrades/module/');
rename($info['zip'], $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '.zip');
copy($info['manifest'], $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '-manifest.php');
$_REQUEST['install_file'] = $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '.zip';
$GLOBALS['mi_remove_tables'] = false;
$pm->performUninstall($load);
$pm->performInstall($_REQUEST['install_file']);
}
echo 'complete';
}