本文整理汇总了PHP中RepairAndClear::clearExternalAPICache方法的典型用法代码示例。如果您正苦于以下问题:PHP RepairAndClear::clearExternalAPICache方法的具体用法?PHP RepairAndClear::clearExternalAPICache怎么用?PHP RepairAndClear::clearExternalAPICache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RepairAndClear
的用法示例。
在下文中一共展示了RepairAndClear::clearExternalAPICache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: RepairAndClear
if ($unzip_dir == null) {
$unzip_dir = $_SESSION['unzip_dir'];
}
//First repair the databse to ensure it is up to date with the new vardefs/tabledefs
logThis('About to repair the database.', $path);
//Use Repair and rebuild to update the database.
global $dictionary, $beanFiles;
require_once 'modules/Trackers/TrackerManager.php';
$trackerManager = TrackerManager::getInstance();
$trackerManager->pause();
$trackerManager->unsetMonitors();
require_once "modules/Administration/QuickRepairAndRebuild.php";
$rac = new RepairAndClear();
$rac->clearVardefs();
$rac->rebuildExtensions();
$rac->clearExternalAPICache();
$repairedTables = array();
foreach ($beanFiles as $bean => $file) {
if (file_exists($file)) {
require_once $file;
unset($GLOBALS['dictionary'][$bean]);
$focus = new $bean();
if ($focus instanceof SugarBean) {
if (!isset($repairedTables[$focus->table_name])) {
$sql = $GLOBALS['db']->repairTable($focus, true);
logThis('Running sql:' . $sql, $path);
$repairedTables[$focus->table_name] = true;
}
//Check to see if we need to create the audit table
if ($focus->is_AuditEnabled() && !$focus->db->tableExists($focus->get_audit_table_name())) {
logThis('Creating audit table:' . $focus->get_audit_table_name(), $path);
示例2: run
public function run()
{
global $dictionary, $beanFiles;
include "include/modules.php";
require_once "modules/Administration/QuickRepairAndRebuild.php";
$rac = new RepairAndClear('', '', false, false);
$rac->clearVardefs();
$rac->rebuildExtensions();
$rac->clearExternalAPICache();
// this is dirty, but otherwise SugarBean caches old defs :(
$GLOBALS['reload_vardefs'] = true;
$repairedTables = array();
foreach ($beanFiles as $bean => $file) {
if (file_exists($file)) {
unset($GLOBALS['dictionary'][$bean]);
require_once $file;
$focus = new $bean();
if (empty($focus->table_name) || isset($repairedTables[$focus->table_name])) {
continue;
}
if ($focus instanceof SugarBean) {
if (!isset($repairedTables[$focus->table_name])) {
$sql = $this->db->repairTable($focus, true);
if (trim($sql) != '') {
$this->log('Running sql: ' . $sql);
}
$repairedTables[$focus->table_name] = true;
}
//Check to see if we need to create the audit table
if ($focus->is_AuditEnabled() && !$focus->db->tableExists($focus->get_audit_table_name())) {
$this->log('Creating audit table:' . $focus->get_audit_table_name());
$focus->create_audit_table();
}
}
}
}
unset($dictionary);
include "modules/TableDictionary.php";
foreach ($dictionary as $meta) {
$tablename = $meta['table'];
if (isset($repairedTables[$tablename])) {
continue;
}
$fielddefs = $meta['fields'];
$indices = $meta['indices'];
$sql = $this->db->repairTableParams($tablename, $fielddefs, $indices, true);
if (!empty($sql)) {
$this->log('Running sql: ' . $sql);
$repairedTables[$tablename] = true;
}
}
$this->log('Database repaired');
$this->log('Start rebuilding relationships');
$_REQUEST['silent'] = true;
include 'modules/Administration/RebuildRelationship.php';
$_REQUEST['upgradeWizard'] = true;
include 'modules/ACL/install_actions.php';
$this->log('Done rebuilding relationships');
unset($GLOBALS['reload_vardefs']);
// enable metadata caching once the database schema has been rebuilt
MetaDataManager::enableCache();
}