本文整理匯總了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);
}
示例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']);
}
}