TYPO3 CMS  TYPO3_6-2
XmlParserFactory.php
Go to the documentation of this file.
1 <?php
3 
24 
31  static protected $instance = array();
32 
43  static protected $parsers = array(
44  'extension' => array(
45  'TYPO3\\CMS\\Extensionmanager\\Utility\\Parser\\ExtensionXmlPushParser' => 'ExtensionXmlPushParser.php',
46  'TYPO3\\CMS\\Extensionmanager\\Utility\\Parser\\ExtensionXmlPullParser' => 'ExtensionXmlPullParser.php',
47  ),
48  'mirror' => array(
49  'TYPO3\\CMS\\Extensionmanager\\Utility\\Parser\\MirrorXmlPushParser' => 'MirrorXmlPushParser.php',
50  'TYPO3\\CMS\\Extensionmanager\\Utility\\Parser\\MirrorXmlPullParser' => 'MirrorXmlPullParser.php',
51  )
52  );
53 
64  static public function getParserInstance($parserType, $excludeClassNames = '') {
65  if (!isset(self::$instance[$parserType]) || !is_object(self::$instance[$parserType]) || !empty($excludeClassNames)) {
66  // reset instance
67  self::$instance[$parserType] = ($objParser = NULL);
68  foreach (self::$parsers[$parserType] as $className => $file) {
69  if (!\TYPO3\CMS\Core\Utility\GeneralUtility::inList($excludeClassNames, $className)) {
71  if ($objParser->isAvailable()) {
72  self::$instance[$parserType] = &$objParser;
73  break;
74  }
75  $objParser = NULL;
76  }
77  }
78  }
79  return self::$instance[$parserType];
80  }
81 
82 }
static getParserInstance($parserType, $excludeClassNames='')