You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
603 B
22 lines
603 B
<?php
|
|
|
|
require_once(__DIR__.'/CdataStrategyAlways.php');
|
|
require_once(__DIR__.'/CdataStrategyIllegalCharacters.php');
|
|
require_once(__DIR__.'/CdataStrategyNever.php');
|
|
|
|
|
|
class CdataStrategyFactory
|
|
{
|
|
public function create_strategy($strategy) {
|
|
|
|
if($strategy == 'all') {
|
|
return new CdataStrategyAlways();
|
|
} else if($strategy == 'never') {
|
|
return new CdataStrategyNever();
|
|
} else if($strategy == 'auto') {
|
|
return new CdataStrategyIllegalCharacters();
|
|
} else {
|
|
return new CdataStrategyIllegalCharacters();
|
|
}
|
|
}
|
|
} |