本文整理汇总了PHP中PackageManager::getPackagesInStaging方法的典型用法代码示例。如果您正苦于以下问题:PHP PackageManager::getPackagesInStaging方法的具体用法?PHP PackageManager::getPackagesInStaging怎么用?PHP PackageManager::getPackagesInStaging使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PackageManager
的用法示例。
在下文中一共展示了PackageManager::getPackagesInStaging方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
require_once 'ModuleInstall/PackageManager/PackageManager.php';
$pm = new PackageManager();
$packages = $pm->getinstalledPackages(array('module'));
foreach ($packages as $pack) {
if (strpos($pack['name'], 'SugarCRM Upgrader') !== false) {
$uh = new UpgradeHistory();
$uh->name = $pack['name'];
$history = $uh->checkForExisting($uh);
$this->filesToRemove[] = "custom/Extension/application/Ext/Include/{$history->id_name}.php";
$history->delete();
$this->fileToDelete($this->filesToRemove);
$this->log("Useless files of {$pack['name']} v{$pack['version']} removed");
}
}
foreach ($pm->getPackagesInStaging() as $pack) {
if (strpos($pack['name'], 'SugarCRM Upgrader') !== false) {
$file = UploadStream::getFSPath(hashToFile($pack['file']));
$this->fileToDelete($file);
foreach (array('manifest', 'icon') as $meta) {
$this->fileToDelete(pathinfo($file, PATHINFO_DIRNAME) . '/' . pathinfo($file, PATHINFO_FILENAME) . "-{$meta}.php");
}
}
}
}
示例2: testCheckedArrayKey
public function testCheckedArrayKey()
{
$package = new PackageManager();
$returnJson = $package->getPackagesInStaging('module');
foreach ($returnJson as $module) {
$this->assertArrayHasKey('unFile', $module, 'Key "unFile" is missing in return array');
}
}
示例3: getDisplayScript
/**
* A Static method used to generate the javascript for the page
*
* @return String - the javascript required for the page
*/
function getDisplayScript($install = false, $type = 'module', $releases = null, $types = array(), $isAlive = true)
{
global $sugar_version, $sugar_config;
global $current_language;
$mod_strings = return_module_language($current_language, "Administration");
$ss = new Sugar_Smarty();
$ss->assign('MOD', $mod_strings);
if (!$install) {
$install = 0;
}
$ss->assign('INSTALLATION', $install);
$ss->assign('WAIT_IMAGE', SugarThemeRegistry::current()->getImage("loading", "border='0' align='bottom'", null, null, '.gif', "Loading"));
$ss->assign('sugar_version', $sugar_version);
$ss->assign('js_custom_version', $sugar_config['js_custom_version']);
$ss->assign('IS_ALIVE', $isAlive);
//if($type == 'patch' && $releases != null){
if ($type == 'patch') {
$ss->assign('module_load', 'false');
$patches = PackageManagerDisplay::createJavascriptPackageArray($releases);
$ss->assign('PATCHES', $patches);
$ss->assign('GRID_TYPE', implode(',', $types));
} else {
$pm = new PackageManager();
$releases = $pm->getPackagesInStaging();
$patches = PackageManagerDisplay::createJavascriptModuleArray($releases);
$ss->assign('PATCHES', $patches);
$installeds = $pm->getinstalledPackages();
$patches = PackageManagerDisplay::createJavascriptModuleArray($installeds, 'mti_installed_data');
$ss->assign('INSTALLED_MODULES', $patches);
$ss->assign('UPGARDE_WIZARD_URL', 'index.php?module=UpgradeWizard&action=index');
$ss->assign('module_load', 'true');
}
if (!empty($GLOBALS['ML_STATUS_MESSAGE'])) {
$ss->assign('ML_STATUS_MESSAGE', $GLOBALS['ML_STATUS_MESSAGE']);
}
//Bug 24064. Checking and Defining labels since these might not be cached during Upgrade
if (!isset($mod_strings['LBL_ML_INSTALL']) || empty($mod_strings['LBL_ML_INSTALL'])) {
$mod_strings['LBL_ML_INSTALL'] = 'Install';
}
if (!isset($mod_strings['LBL_ML_ENABLE_OR_DISABLE']) || empty($mod_strings['LBL_ML_ENABLE_OR_DISABLE'])) {
$mod_strings['LBL_ML_ENABLE_OR_DISABLE'] = 'Enable/Disable';
}
if (!isset($mod_strings['LBL_ML_DELETE']) || empty($mod_strings['LBL_ML_DELETE'])) {
$mod_strings['LBL_ML_DELETE'] = 'Delete';
}
//Add by jchi 6/23/2008 to fix the bug 21667
$filegrid_column_ary = array('Name' => $mod_strings['LBL_ML_NAME'], 'Install' => $mod_strings['LBL_ML_INSTALL'], 'Delete' => $mod_strings['LBL_ML_DELETE'], 'Type' => $mod_strings['LBL_ML_TYPE'], 'Version' => $mod_strings['LBL_ML_VERSION'], 'Published' => $mod_strings['LBL_ML_PUBLISHED'], 'Uninstallable' => $mod_strings['LBL_ML_UNINSTALLABLE'], 'Description' => $mod_strings['LBL_ML_DESCRIPTION']);
$filegridinstalled_column_ary = array('Name' => $mod_strings['LBL_ML_NAME'], 'Install' => $mod_strings['LBL_ML_INSTALL'], 'Action' => $mod_strings['LBL_ML_ACTION'], 'Enable_Or_Disable' => $mod_strings['LBL_ML_ENABLE_OR_DISABLE'], 'Type' => $mod_strings['LBL_ML_TYPE'], 'Version' => $mod_strings['LBL_ML_VERSION'], 'Date_Installed' => $mod_strings['LBL_ML_INSTALLED'], 'Uninstallable' => $mod_strings['LBL_ML_UNINSTALLABLE'], 'Description' => $mod_strings['LBL_ML_DESCRIPTION']);
$ss->assign('ML_FILEGRID_COLUMN', $filegrid_column_ary);
$ss->assign('ML_FILEGRIDINSTALLED_COLUMN', $filegridinstalled_column_ary);
//end
$ss->assign('SHOW_IMG', SugarThemeRegistry::current()->getImage('advanced_search', 'border="0"', 8, 8, '.gif', 'Show'));
$ss->assign('HIDE_IMG', SugarThemeRegistry::current()->getImage('basic_search', 'border="0"', 8, 8, '.gif', 'Hide'));
$str = $ss->fetch('ModuleInstall/PackageManager/tpls/PackageManagerScripts.tpl');
return $str;
}