partner-discount-sdk
3 weeks ago
CdataStrategy.php
3 weeks ago
CdataStrategyAlways.php
3 weeks ago
CdataStrategyFactory.php
3 weeks ago
CdataStrategyIllegalCharacters.php
3 weeks ago
CdataStrategyIllegalCharactersHtmlEntities.php
3 weeks ago
CdataStrategyNever.php
3 weeks ago
XMLWriter.php
3 weeks ago
chunk.php
3 weeks ago
config.php
3 years ago
download.php
3 weeks ago
handler.php
3 weeks ago
helper.php
3 weeks ago
input.php
3 weeks ago
installer.php
3 weeks ago
session.php
10 years ago
wpallimport.php
3 weeks ago
zip.php
4 years ago
CdataStrategyFactory.php
23 lines
| 1 | <?php |
| 2 | |
| 3 | // phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound,WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound,WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- legitimate plugin prefixes (pmxe/PMXE/wpae/Wpae/wp_all_export/wpallexport/XmlExport/CdataStrategy/VariableProductTitle/Soflyy/GF_Export); Plugin Check does not honor phpcs.xml prefix declaration |
| 4 | require_once(__DIR__.'/CdataStrategyAlways.php'); |
| 5 | require_once(__DIR__.'/CdataStrategyIllegalCharacters.php'); |
| 6 | require_once(__DIR__.'/CdataStrategyNever.php'); |
| 7 | |
| 8 | |
| 9 | class CdataStrategyFactory |
| 10 | { |
| 11 | public function create_strategy($strategy) { |
| 12 | |
| 13 | if($strategy == 'all') { |
| 14 | return new CdataStrategyAlways(); |
| 15 | } else if($strategy == 'never') { |
| 16 | return new CdataStrategyNever(); |
| 17 | } else if($strategy == 'auto') { |
| 18 | return new CdataStrategyIllegalCharacters(); |
| 19 | } else { |
| 20 | return new CdataStrategyIllegalCharacters(); |
| 21 | } |
| 22 | } |
| 23 | } |