TYPO3 CMS  TYPO3_6-2
BackendFactory.php
Go to the documentation of this file.
1 <?php
3 
22 
30  static protected $availableBackends = array(
31  'TYPO3\\CMS\\Rsaauth\\Backend\\PhpBackend',
32  'TYPO3\\CMS\\Rsaauth\\Backend\\CommandLineBackend'
33  );
34 
41  static protected $initialized = FALSE;
42 
50  static protected $selectedBackend = NULL;
51 
59  static public function getBackend() {
60  if (!self::$initialized) {
61  // Backend does not exist yet. Create it.
62  foreach (self::$availableBackends as $backend) {
63  $backendObject = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($backend);
64  // Check that it is derived from the proper base class
65  if ($backendObject instanceof \TYPO3\CMS\Rsaauth\Backend\AbstractBackend) {
67  if ($backendObject->isAvailable()) {
68  // The backend is available, save it and stop the loop
69  self::$selectedBackend = $backendObject;
70  self::$initialized = TRUE;
71  break;
72  }
73  // Attempt to force destruction of the object
74  unset($backendObject);
75  }
76  }
77  }
78  return self::$selectedBackend;
79  }
80 
81 }
static getUserObj($classRef, $checkPrefix='', $silent=FALSE)