original_string: public static function makeInstanceService($serviceType, $serviceSubType = '', $excludeServiceKeys = array()) {
  		$error = FALSE;
  
  		if (!is_array($excludeServiceKeys)) {
  			$excludeServiceKeys = self::trimExplode(',', $excludeServiceKeys, 1);
  		}
  
  		$requestInfo = array(
  			'requestedServiceType' => $serviceType,
  			'requestedServiceSubType' => $serviceSubType,
  			'requestedExcludeServiceKeys' => $excludeServiceKeys,
  		);
  
  		while ($info = t3lib_extMgm::findService($serviceType, $serviceSubType, $excludeServiceKeys)) {
  
  				// provide information about requested service to service object
  			$info = array_merge($info, $requestInfo);
  
  				// Check persistent object and if found, call directly and exit.
  			if (is_object($GLOBALS['T3_VAR']['makeInstanceService'][$info['className']])) {
  
  					// update request info in persistent object
  				$GLOBALS['T3_VAR']['makeInstanceService'][$info['className']]->info = $info;
  
  					// reset service and return object
  				$GLOBALS['T3_VAR']['makeInstanceService'][$info['className']]->reset();
  				return $GLOBALS['T3_VAR']['makeInstanceService'][$info['className']];
  
  				// include file and create object
  			} else {
  				$requireFile = self::getFileAbsFileName($info['classFile']);
  				if (@is_file($requireFile)) {
  					self::requireOnce($requireFile);
  					$obj = self::makeInstance($info['className']);
  					if (is_object($obj)) {
  						if (!@is_callable(array($obj, 'init'))) {
  								// use silent logging??? I don't think so.
  							die ('Broken service:' . t3lib_utility_Debug::viewArray($info));
  						}
  						$obj->info = $info;
  						if ($obj->init()) { // service available?
  
  								// create persistent object
  							$GLOBALS['T3_VAR']['makeInstanceService'][$info['className']] = $obj;
  
  								// needed to delete temp files
  							register_shutdown_function(array(&$obj, '__destruct'));
  
  							return $obj; // object is passed as reference by function definition
  						}
  						$error = $obj->getLastErrorArray();
  						unset($obj);
  					}
  				}
  			}
  				// deactivate the service
  			t3lib_extMgm::deactivateService($info['serviceType'], $info['serviceKey']);
  		}
  		return $error;
  	}
code: public static function makeInstanceService($serviceType, $serviceSubType = '', $excludeServiceKeys = array()) {
  		$error = FALSE;
  
  		if (!is_array($excludeServiceKeys)) {
  			$excludeServiceKeys = self::trimExplode(',', $excludeServiceKeys, 1);
  		}
  
  		$requestInfo = array(
  			'requestedServiceType' => $serviceType,
  			'requestedServiceSubType' => $serviceSubType,
  			'requestedExcludeServiceKeys' => $excludeServiceKeys,
  		);
  
  		while ($info = t3lib_extMgm::findService($serviceType, $serviceSubType, $excludeServiceKeys)) {
  
  				// provide information about requested service to service object
  			$info = array_merge($info, $requestInfo);
  
  				// Check persistent object and if found, call directly and exit.
  			if (is_object($GLOBALS['T3_VAR']['makeInstanceService'][$info['className']])) {
  
  					// update request info in persistent object
  				$GLOBALS['T3_VAR']['makeInstanceService'][$info['className']]->info = $info;
  
  					// reset service and return object
  				$GLOBALS['T3_VAR']['makeInstanceService'][$info['className']]->reset();
  				return $GLOBALS['T3_VAR']['makeInstanceService'][$info['className']];
  
  				// include file and create object
  			} else {
  				$requireFile = self::getFileAbsFileName($info['classFile']);
  				if (@is_file($requireFile)) {
  					self::requireOnce($requireFile);
  					$obj = self::makeInstance($info['className']);
  					if (is_object($obj)) {
  						if (!@is_callable(array($obj, 'init'))) {
  								// use silent logging??? I don't think so.
  							die ('Broken service:' . t3lib_utility_Debug::viewArray($info));
  						}
  						$obj->info = $info;
  						if ($obj->init()) { // service available?
  
  								// create persistent object
  							$GLOBALS['T3_VAR']['makeInstanceService'][$info['className']] = $obj;
  
  								// needed to delete temp files
  							register_shutdown_function(array(&$obj, '__destruct'));
  
  							return $obj; // object is passed as reference by function definition
  						}
  						$error = $obj->getLastErrorArray();
  						unset($obj);
  					}
  				}
  			}
  				// deactivate the service
  			t3lib_extMgm::deactivateService($info['serviceType'], $info['serviceKey']);
  		}
  		return $error;
  	}
code_tokens: public static function makeInstanceService ( $ serviceType , $ serviceSubType = '' , $ excludeServiceKeys = array ( ) ) { $ error = FALSE ; if ( ! is_array ( $ excludeServiceKeys ) ) { $ excludeServiceKeys = self :: trimExplode ( ',' , $ excludeServiceKeys , 1 ) ; } $ requestInfo = array ( 'requestedServiceType' => $ serviceType , 'requestedServiceSubType' => $ serviceSubType , 'requestedExcludeServiceKeys' => $ excludeServiceKeys , ) ; while ( $ info = t3lib_extMgm :: findService ( $ serviceType , $ serviceSubType , $ excludeServiceKeys ) ) { // provide information about requested service to service object $ info = array_merge ( $ info , $ requestInfo ) ; // Check persistent object and if found, call directly and exit. if ( is_object ( $ GLOBALS [ 'T3_VAR' ] [ 'makeInstanceService' ] [ $ info [ 'className' ] ] ) ) { // update request info in persistent object $ GLOBALS [ 'T3_VAR' ] [ 'makeInstanceService' ] [ $ info [ 'className' ] ] -> info = $ info ; // reset service and return object $ GLOBALS [ 'T3_VAR' ] [ 'makeInstanceService' ] [ $ info [ 'className' ] ] -> reset ( ) ; return $ GLOBALS [ 'T3_VAR' ] [ 'makeInstanceService' ] [ $ info [ 'className' ] ] ; // include file and create object } else { $ requireFile = self :: getFileAbsFileName ( $ info [ 'classFile' ] ) ; if ( @ is_file ( $ requireFile ) ) { self :: requireOnce ( $ requireFile ) ; $ obj = self :: makeInstance ( $ info [ 'className' ] ) ; if ( is_object ( $ obj ) ) { if ( ! @ is_callable ( array ( $ obj , 'init' ) ) ) { // use silent logging??? I don't think so. die ( 'Broken service:' . t3lib_utility_Debug :: viewArray ( $ info ) ) ; } $ obj -> info = $ info ; if ( $ obj -> init ( ) ) { // service available? // create persistent object $ GLOBALS [ 'T3_VAR' ] [ 'makeInstanceService' ] [ $ info [ 'className' ] ] = $ obj ; // needed to delete temp files register_shutdown_function ( array ( & $ obj , '__destruct' ) ) ; return $ obj ; // object is passed as reference by function definition } $ error = $ obj -> getLastErrorArray ( ) ; unset ( $ obj ) ; } } } // deactivate the service t3lib_extMgm :: deactivateService ( $ info [ 'serviceType' ] , $ info [ 'serviceKey' ] ) ; } return $ error ; }
docstring: Find the best service and check if it works.
  Returns object of the service class.
  
  @param string $serviceType Type of service (service key).
  @param string $serviceSubType Sub type like file extensions or similar. Defined by the service.
  @param mixed $excludeServiceKeys List of service keys which should be excluded in the search for a service. Array or comma list.
  @return object The service object or an array with error info's.
docstring_tokens: Find the best service and check if it works . Returns object of the service class .