Changeset 5795
- Timestamp:
- 04/24/07 12:19:26 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/midcom.helper.replicator/exporter.php
r5711 r5795 434 434 function is_exportable(&$object) 435 435 { 436 if (!array_key_exists($object->guid, $this->exportability)) 437 { 438 // This is where the exporter should check whether to export 439 if ($object->sitegroup != $_MIDGARD['sitegroup']) 440 { 436 if (isset($this->exportability[$object->guid])) 437 { 438 // expotability is set, return early 439 return $this->exportability[$object->guid]; 440 } 441 442 // Basic export checks (SG limits, limited objects) 443 return $this->is_exportable_baseline($object); 444 } 445 446 function is_exportable_baseline(&$object) 447 { 448 switch (true) 449 { 450 // Never replicate login sessions 451 case (is_a($object, 'midcom_core_login_session_db')): 452 // Never replicate across SG borders 453 case ($object->sitegroup != $_MIDGARD['sitegroup']): 441 454 $this->exportability[$object->guid] = false; 442 }443 else444 {455 break; 456 // Replicate everything else by default 457 default: 445 458 $this->exportability[$object->guid] = true; 446 } 447 } 459 break; 460 } 461 448 462 return $this->exportability[$object->guid]; 449 463 } trunk/src/midcom.helper.replicator/exporter/mirror.php
r5762 r5795 97 97 98 98 // Otherwise start checking... 99 if ($object->sitegroup != $_MIDGARD['sitegroup'])100 {101 $this->exportability[$object->guid] = false;99 // Check baseline checks first 100 if (!$this->is_exportable_baseline($object)) 101 { 102 102 return false; 103 }104 else105 {106 $this->exportability[$object->guid] = true;107 103 } 108 104 trunk/src/midcom.helper.replicator/exporter/staging2live.php
r5759 r5795 55 55 } 56 56 57 // We might see SG0 content as well, make sure not to include that58 if ($object->sitegroup != $_MIDGARD['sitegroup'])59 {60 $GLOBALS['midcom_helper_replicator_logger']->push_prefix('exporter');61 $GLOBALS['midcom_helper_replicator_logger']->log_object($object, "Sitegroup mismatch: \$_MIDGARD['sitegroup']={$_MIDGARD['sitegroup']} != {$object->sitegroup}", MIDCOM_LOG_ERROR);62 $GLOBALS['midcom_helper_replicator_logger']->pop_prefix();63 $this->exportability[$object->guid] = false;64 return false;65 }66 67 57 $GLOBALS['midcom_helper_replicator_logger']->push_prefix('exporter'); 68 58 69 59 // Otherwise start checking... 60 // we need AT service 70 61 if (!class_exists('midcom_services_at_interface')) 71 62 { … … 75 66 return $this->exportability[$object->guid]; 76 67 } 77 // Default to true 68 69 // Check baseline checks first 70 if (!$this->is_exportable_baseline($object)) 71 { 72 return false; 73 } 74 75 // Then default to true 78 76 $this->exportability[$object->guid] = true; 79 77
