当前位置: 首页>>代码示例>>PHP>>正文


PHP PackageManager::getinstalledPackages方法代码示例

本文整理汇总了PHP中PackageManager::getinstalledPackages方法的典型用法代码示例。如果您正苦于以下问题:PHP PackageManager::getinstalledPackages方法的具体用法?PHP PackageManager::getinstalledPackages怎么用?PHP PackageManager::getinstalledPackages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PackageManager的用法示例。


在下文中一共展示了PackageManager::getinstalledPackages方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
             }
         }
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:26,代码来源:8_RemoveWebUpgrader.php

示例2: 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;
 }
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:61,代码来源:PackageManagerDisplay.php


注:本文中的PackageManager::getinstalledPackages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。