Returns the right adapter to use according to the filename extension.

@return RendererAdapterInterface
19818
private function determineWhichAdapterToUse($filename = null)
    {
        if (null === $filename || !is_string($filename)) {
            return;
        }

        $pieces = explode('.', $filename);
        if (1 > count($pieces)) {
            return;
        }

        $ext = '.'.$pieces[count($pieces) - 1];
        $adaptersForExt = $this->manageableExt->get($ext);
        if (!is_array($adaptersForExt) || 0 === count($adaptersForExt)) {
            return;
        }

        $adapter = $this->getRightAdapter($adaptersForExt);

        return $this->rendererAdapters->get($adapter);
    }
462105
public function getEngine()
    {
        $adapter = $this->getAdapter();

        if ($adapter) {
            return $adapter;
        }
        return ucfirst($this->dsn->scheme);
    }
729801
public function getAdapter(AbstractUri $uri) : AdapterInterface
    {
        $schemeIndex = $uri->scheme . '://' . $uri->host;
        if (! array_key_exists($schemeIndex, $this->collection)) {
            throw new SchemeException($uri->scheme . '://' . $uri->host);
        }

        return $this->collection[$schemeIndex];
    }
1370194
public function getAdapter($adapterName,  $arguments = array())
    {
        $stdName = ucfirst($adapterName);

        $classAdapterName = CheckoutApi_Client_Constant::ADAPTER_CLASS_GROUP.$stdName;
        
        $class = null;

        if (class_exists($classAdapterName)) {
            /** @var CheckoutApi_Client_Adapter_Abstract  $class */
            $class = CheckoutApi_Lib_Factory::getSingletonInstance($classAdapterName,$arguments);
            if(isset($arguments['uri'])) {
                $class->setUri($arguments['uri']);
            }

            if(isset($arguments['config'])) {
                $class->setConfig($arguments['config']);
            }

        } else {
          
            $this->exception("Not a valid Adapter", debug_backtrace());
        } 

        return $class;
        
    }
868593
public function defaultAdapter($adapterKey)
    {
        $exists = false;
        if (in_array($adapterKey, $this->rendererAdapters->keys())) {
            $this->defaultAdapter = $adapterKey;
            $exists = true;
        }

        return $exists;
    }
779239
public function getLayoutAdapter()
    {
        if (null === $this->layoutAdapter) {
            $class = $this->config['layout']['adapter'];

            $this->layoutAdapter = new $class;
            $this->layoutAdapter->setEditor($this);
        }

        return $this->layoutAdapter;
    }
129933
public function render()
    {
        parent::render();

        // security fix so that you cant access files from outside template dir
        $sTplName = basename((string) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("tpl"));
        if ($sTplName) {
            $sTplName = 'custom/' . $sTplName;
        }

        return $sTplName;
    }
339444
public function getAdminAdapter() {
		if ($this->adminAdapter === null) {
			$this->adminAdapter = $this->adapterFactory->createAdminAdapter($this);
		}
		return $this->adminAdapter;
	}
39633
public function getCacheAdapter()
    {
        if (!$this->cacheAdapter) {
            $this->setCacheAdapter(new Cache\Adapter\FileSystem());
        }

        return $this->cacheAdapter;
    }
1339501
public function getClassName()
    {
        $adapter = $this->getAdapter();

        if ($adapter) {
            return $adapter;
        }

        return ucfirst($this->dsn->scheme);
    }
1220273
private function getAdapterNode()
    {
        $node = $this->createRootNode('adapter');
        return $node
            ->isRequired()
            ->addDefaultsIfNotSet()
            ->children()
                ->enumNode('type')
                    ->values(['jsonapiorg', null])
                ->end()
                ->scalarNode('service')->cannotBeEmpty()->end()
            ->end()
            ->validate()
                ->always(function($v) {
                    $this->validateAdapter($v);
                    return $v;
                })
            ->end()
        ;
    }
592841
private function getLoader(): LoaderInterface
    {
        if (null !== $this->loader) {
            return $this->loader;
        }

        if (null !== $this->localFile) {
            $this->loader = new Local($this->localFile);

            return $this->loader;
        }

        if (extension_loaded('curl')) {
            $this->loader = new Curl($this);

            return $this->loader;
        }

        $streamHelper = new StreamCreator($this);

        if (ini_get('allow_url_fopen')) {
            $this->loader = new FopenLoader($this, $streamHelper);

            return $this->loader;
        }

        $this->loader = new SocketLoader($this, $streamHelper);

        return $this->loader;
    }
978284
private function getDefaultAdapter()
    {
        if (extension_loaded('curl')) {
            $this->parallelAdapter = new MultiAdapter($this->messageFactory);
            $this->adapter = function_exists('curl_reset')
                ? new CurlAdapter($this->messageFactory)
                : $this->parallelAdapter;
            if (ini_get('allow_url_fopen')) {
                $this->adapter = new StreamingProxyAdapter(
                    $this->adapter,
                    new StreamAdapter($this->messageFactory)
                );
            }
        } elseif (ini_get('allow_url_fopen')) {
            $this->adapter = new StreamAdapter($this->messageFactory);
        } else {
            throw new \RuntimeException('Guzzle requires cURL, the '
                . 'allow_url_fopen ini setting, or a custom HTTP adapter.');
        }
    }
154565
public function get_extension(){
    parent::get_extension();
		if ( !$this->ext2 && $this->file ){
			if ( function_exists('exif_imagetype') ){
				if ( $r = exif_imagetype($this->file) ){
          if ( !array_key_exists($r, bbn\file\image::$allowed_extensions) ){
            $this->ext = false;
          }
				}
				else{
          $this->ext = false;
        }
			}
			if ( $this->ext ){
				$this->ext2 = $this->ext;
				if ( $this->ext2 === 'jpg' ){
          $this->ext2 = 'jpeg';
        }
			}
		}
		return $this->ext;
	}
89207
public function getExtension()
    {
        if (is_null($this->extension) === true) {
            $filename = parent::getFilename();
            $str = new StringWrapper($filename);
            $this->extension = $str->getFirstEndMatch($this->predefinedExtensions);
            $this->hasPredefinedExt = true;

            if ($this->extension === '') {
                $this->hasPredefinedExt = false;
                $this->extension = parent::getExtension();
            }
        }

        return $this->extension;
    }
1143444
public static function getInstance(string $fileName) : AdapterInterface
    {
        foreach (static::$adapterClasses as $className) {
            $instance = static::getInstanceByClassName($className, $fileName);
            if ($instance !== null) {
                return $instance;
            }
        }

        throw new ParserConditionNotSatisfiedException(
            "No Sqlite extension found. Either 'pdo_sqlite' or 'sqlite3' extension required."
        );
    }
860556
public function getAdapter()
    {
        if ($this->adapter instanceof Compress\CompressionAlgorithmInterface) {
            return $this->adapter;
        }

        $adapter = $this->adapter;
        $options = $this->getAdapterOptions();
        if (!class_exists($adapter)) {
            $adapter = 'Zend\\Filter\\Compress\\' . ucfirst($adapter);
            if (!class_exists($adapter)) {
                throw new Exception\RuntimeException(sprintf(
                    '%s unable to load adapter; class "%s" not found',
                    __METHOD__,
                    $this->adapter
                ));
            }
        }

        $this->adapter = new $adapter($options);
        if (!$this->adapter instanceof Compress\CompressionAlgorithmInterface) {
            throw new Exception\InvalidArgumentException("Compression adapter '" . $adapter . "' does not implement Zend\\Filter\\Compress\\CompressionAlgorithmInterface");
        }
        return $this->adapter;
    }