本文整理匯總了PHP中ConnectorUtils::connectors_cache方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConnectorUtils::connectors_cache方法的具體用法?PHP ConnectorUtils::connectors_cache怎麽用?PHP ConnectorUtils::connectors_cache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ConnectorUtils
的用法示例。
在下文中一共展示了ConnectorUtils::connectors_cache方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: saveConnectors
/**
* Save connectors array to file
* @param array $connectors Source data to write
* @param string $toFile filename to use
* @return bool success
*/
public static function saveConnectors($connectors, $toFile = '')
{
if (empty($toFile)) {
$toFile = 'custom/modules/Connectors/metadata/connectors.php';
if (defined('TEMPLATE_URL')) {
$toFile = SugarTemplateUtilities::getFilePath($toFile);
}
}
if (!is_array($connectors)) {
$connectors = array();
}
if (!write_array_to_file('connectors', $connectors, $toFile)) {
//Log error and return empty array
$GLOBALS['log']->fatal("Cannot write sources to file");
return false;
}
self::$connectors_cache = $connectors;
return true;
}
示例2: saveConnectors
/**
* Save connectors array to file
* @param array $connectors Source data to write
* @param string $toFile filename to use
* @return bool success
*/
public static function saveConnectors($connectors, $toFile = '')
{
if (empty($toFile)) {
$toFile = 'custom/modules/Connectors/metadata/connectors.php';
}
if (!is_array($connectors)) {
$connectors = array();
}
if (!write_array_to_file('connectors', $connectors, $toFile)) {
//Log error and return empty array
$GLOBALS['log']->fatal("Cannot write sources to file");
return false;
}
self::$connectors_cache = $connectors;
return true;
}