Returns an instance of this class

@static
@param  string $type caching type
@param  object $init the IDS_Init object

@return object $this
974100
public static function getInstance($type, $init)
    {

        if (!self::$cachingInstance) {
            self::$cachingInstance = new IDS_Caching_Database($type, $init);
        }
        return self::$cachingInstance;
    }
192023
public function addType($type)
    {
        if (!in_array($type, $this->validTypes())) {
            throw new InvalidArgumentException(
                sprintf('Invalid cache type: "%s"', $type)
            );
        }

        $this->types[$type] = true;
        return $this;
    }
661472
public static function Init($path = '')
	{
		if( !is_null(self::$_Instance) )
		{
			// TODO error
		}

		self::$_Instance = new static($path);

		return self::$_Instance;
	}
375131
public static function instantiateSubclassForType($type)
    {
        if ('rdf' === $type) {
            $instance = GeneralUtility::makeInstance(RDFRenderer::class);
        } else {
            if ('json-ld' === $type) {
                $instance = GeneralUtility::makeInstance(JSONLDRenderer::class);
            } else {
                $instance = GeneralUtility::makeInstance(TurtleRenderer::class);
            }
        }

        return $instance;
    }
361868
public function cacheSize( $type = self::PERSISTED )
    {
        switch( $type ) {
            case self::PERSISTED:
                return count( $this->instancesPersisted );
            case self::UNPERSISTED:
                return count( $this->instancesUnpersisted );
            case self::ALL:
                return $this->cacheSize( self::PERSISTED ) + $this->cacheSize( self::UNPERSISTED );
        }
        throw new \InvalidArgumentException("Bad source `{$source}` passed to " . __FUNCTION__);
    }
755631
public static function getType($type)
    {
        if (!isset(static::$mappedTypeInstances[$type])) {
            if (!static::hasType($type)) {
                throw TypeException::typeDoesNotExist($type);
            }

            static::$mappedTypeInstances[$type] = new static::$mappedTypeClasses[$type]();
        }

        return static::$mappedTypeInstances[$type];
    }
1233450
public static function autoDelete(string $name, Type $type): self
    {
        $self = new self($name, $type);
        $self->autoDelete = true;
        $self->durable = false;

        return $self;
    }
601589
public static function getInstance($type)
  {
    $type = strtolower(preg_replace('/[^A-Z0-9_]/i', '', $type));

    if ( !isset(self::$instances[$type]) ){
      $class = __NAMESPACE__ . '\\'.ucfirst($type).'Format';
      
      if ( !class_exists($class) ){
        throw new \RuntimeException('Unable to read Registry/Format class ('.$type.')');
      }
      
      self::$instances[$type] = new $class;
    }
    
    return self::$instances[$type];
  }
1095423
public function setType( $type )
    {
        $this->type = is_int( $type ) ? $type : self::getStorableType( $type );
        return $this;
    }
1078679
public static function getInstance($type, $init)
    {
        if (!self::$cachingInstance) {
            self::$cachingInstance = new MemcachedCache($type, $init);
        }

        return self::$cachingInstance;
    }
79580
final public function get(string $type): object
    {
        if ($this->supports($type)) {
            $ret = $this->getObject($type);
            if ($ret instanceof $type) {
                return $ret;
            }
            throw new TypeError;
        }

        throw new UnavailableTypeException;
    }
324422
public function getTempVariableForWrite($type, CompilationContext $context, $init = true)
    {
        $variable = $this->reuseTempVariable($type, 'heap');
        if (\is_object($variable)) {
            $variable->increaseUses();
            $variable->increaseMutates();
            if ($init && ('variable' == $type || 'string' == $type || 'array' == $type)) {
                $variable->initVariant($context);
            }

            return $variable;
        }

        $tempVar = $this->getNextTempVar();
        $variable = $this->addVariable($type, '_'.$tempVar, $context);
        $variable->setIsInitialized(true, $context);
        $variable->setTemporal(true);
        $variable->increaseUses();
        $variable->increaseMutates();
        if ('variable' == $type || 'string' == $type || 'array' == $type) {
            $variable->initVariant($context);
        }

        $this->registerTempVariable($type, 'heap', $variable);

        return $variable;
    }
50030
public function create(string $type) : ?Controller
    {
        if (\class_exists($type) === false) {
            return $this->fallthrough($type);
        }

        $ref = new \ReflectionClass($type);
        $ctor = $ref->getConstructor();
        if ($ctor === null || $ctor->getNumberOfParameters() === 0) {
            return new $type();
        }

        return $this->fallthrough($type);
    }
874779
function GetCache($type, $id) {
		if (!isset($this->cache[$type]) || !$this->cache[$type]) // Dont cache this type of call
			return FALSE;
		if (isset($this->_cache[$type][$id]))
			return $this->_cache[$type][$id];
		return FALSE;
	}
219567
public function getRequest($autoInit = false)
    {
        $this->setAutoInitRequest($autoInit);
        if ($this->request == null && $this->isAutoInitRequest()) {
            $this->initRequest();
        }

        return $this->request;
    }
1133034
public static function init($configPath = null)
    {
        if (!isset(self::$instances[$configPath])) {
            self::$instances[$configPath] = new IDS_Init($configPath);
        }

        return self::$instances[$configPath];
    }
249067
public static function getInstance($type, $init)
    {

        if (!self::$cachingInstance) {
            self::$cachingInstance = new DatabaseCache($type, $init);
        }

        return self::$cachingInstance;
    }