/** * The class constructor method, to be used by child implementations. */ function __construct() { // Set the bucket processing strategy, based on the type. $dbType = $GLOBALS['_MAX']['CONF']['database']['type']; if ($this->type == 'aggregate') { $this->oProcessingStrategy = OX_Extension_DeliveryLog_BucketProcessingStrategyFactory::getAggregateBucketProcessingStrategy($dbType); } else { $this->oProcessingStrategy = OX_Extension_DeliveryLog_BucketProcessingStrategyFactory::getRawBucketProcessingStrategy($dbType); } }
/** * The method to test the factory's getRawBucketProcessingStrategy() * methiod. */ function testGetRawBucketProcessingStrategy() { $aConf =& $GLOBALS['_MAX']['CONF']; // Test the creation of an edge/aggregate server MySQL strategy class $aConf['lb']['enabled'] = true; $aConf['database']['type'] = 'mysql'; $oProcessingStrategy = OX_Extension_DeliveryLog_BucketProcessingStrategyFactory::getRawBucketProcessingStrategy($aConf['database']['type']); $this->assertTrue(is_a($oProcessingStrategy, 'OX_Extension_DeliveryLog_RawBucketProcessingStrategyMysql')); $aConf['database']['type'] = 'pgsql'; $oProcessingStrategy = OX_Extension_DeliveryLog_BucketProcessingStrategyFactory::getRawBucketProcessingStrategy($aConf['database']['type']); $this->assertTrue(is_a($oProcessingStrategy, 'OX_Extension_DeliveryLog_RawBucketProcessingStrategyPgsql')); // Restore the configuration file TestEnv::restoreConfig(); }
/** * Creates a BucketProcessingStrategy for raw type buckets. * * @return OX_Extension_DeliveryLog_BucketProcessingStrategy */ public static function getRawBucketProcessingStrategy() { return OX_Extension_DeliveryLog_BucketProcessingStrategyFactory::_getBucketProcessingStrategy('Raw'); }