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


PHP ConnectorUtils::installSource方法代码示例

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


在下文中一共展示了ConnectorUtils::installSource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: upgradeEnableInsideViewConnector

/**
 * Enable the InsideView connector for the four default modules.
 */
function upgradeEnableInsideViewConnector($path = '')
{
    logThis('Begin upgradeEnableInsideViewConnector', $path);
    // Load up the existing mapping and hand it to the InsideView connector to have it setup the correct logic hooks
    $mapFile = 'modules/Connectors/connectors/sources/ext/rest/insideview/mapping.php';
    if (file_exists('custom/' . $mapFile)) {
        logThis('Found CUSTOM mappings', $path);
        require 'custom/' . $mapFile;
    } else {
        logThis('Used default mapping', $path);
        require $mapFile;
    }
    require_once 'include/connectors/sources/SourceFactory.php';
    $source = SourceFactory::getSource('ext_rest_insideview');
    // $mapping is brought in from the mapping.php file above
    $source->saveMappingHook($mapping);
    require_once 'include/connectors/utils/ConnectorUtils.php';
    ConnectorUtils::installSource('ext_rest_insideview');
    // Now time to set the various modules to active, because this part ignores the default config
    require CONNECTOR_DISPLAY_CONFIG_FILE;
    // $modules_sources come from that config file
    foreach ($source->allowedModuleList as $module) {
        $modules_sources[$module]['ext_rest_insideview'] = 'ext_rest_insideview';
    }
    if (!write_array_to_file('modules_sources', $modules_sources, CONNECTOR_DISPLAY_CONFIG_FILE)) {
        //Log error and return empty array
        logThis("Cannot write \$modules_sources to " . CONNECTOR_DISPLAY_CONFIG_FILE, $path);
    }
    logThis('End upgradeEnableInsideViewConnector', $path);
}
开发者ID:omusico,项目名称:sugar_work,代码行数:33,代码来源:uw_utils.php

示例2: install_connectors

 function install_connectors()
 {
     if (isset($this->installdefs['connectors'])) {
         foreach ($this->installdefs['connectors'] as $cp) {
             $this->log(translate('LBL_MI_IN_CONNECTORS') . $cp['name']);
             $dir = str_replace('_', '/', $cp['name']);
             $cp['connector'] = str_replace('<basepath>', $this->base_dir, $cp['connector']);
             $source_path = 'custom/modules/Connectors/connectors/sources/' . $dir . '/';
             $GLOBALS['log']->debug("Installing Connector " . $cp['name'] . "..." . $cp['connector']);
             if (!file_exists($source_path)) {
                 mkdir_recursive($source_path, true);
             }
             copy_recursive($cp['connector'], $source_path);
             //Install optional formatter code if it is specified
             if (!empty($cp['formatter'])) {
                 $cp['formatter'] = str_replace('<basepath>', $this->base_dir, $cp['formatter']);
                 $formatter_path = 'custom/modules/Connectors/connectors/formatters/' . $dir . '/';
                 if (!file_exists($formatter_path)) {
                     mkdir_recursive($formatter_path, true);
                 }
                 copy_recursive($cp['formatter'], $formatter_path);
             }
         }
         require_once 'include/connectors/utils/ConnectorUtils.php';
         ConnectorUtils::installSource($cp['name']);
     }
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:27,代码来源:ModuleInstaller.php


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