Check if a container exists

@param  string $container Container name

@throws DfException
@return boolean
325088
public function containerExists($container = '')
    {
        $this->checkConnection();

        try {
            /** @var Container $container */
            $container = $this->blobConn->getContainer($container);

            return !empty($container);
        } catch (\Exception $ex) {
            if ($ex instanceof ClientErrorResponseException) {
                if ($ex->getCode() === 404 || str_contains($ex->getMessage(), '404')) {
                    return false;
                }
            }
            static::handleGuzzleException($ex);
            throw new DfException('Failed to list containers: ' . $ex->getMessage());
        }
    }
384255
public function fileExists($containerName, $fileName, $relativePath)
    {
        $fullFileName = $this->getFullFileName($containerName, $fileName, $relativePath);

        return $this->filesystem->has($fullFileName);
    }
952539
public function has($key)
	{
		$key = $this->resolveAlias($key);

		$exists = (bool) $this->getRaw($key);

		if ($exists === false && $this->parent instanceof ContainerInterface)
		{
			$exists = $this->parent->has($key);
		}

		return $exists;
	}
818051
public function get(Container $container)
    {
        if ($this->singleton) {
            if ($this->instance === null) {
                $f = $this->factory;
                $this->instance = $f($container);
            }
            return $this->instance;
        } else {
            $f = $this->factory;
            return $f($container);
        }
    }
278793
public function has($key)
	{
		$key = $this->id($key);
		return $this->apcu ? apcu_exists($key) : apc_exists($key);
	}
679446
public function exists($key)
    {
        $this->init();
        $result = $this->driver->exists($key);
        return (bool)$result;
    }
1259568
public function has($id)
    {
        /** @var ContainerInterface $item */
        foreach ($this->list as $item) {
            if ($item->has($id)) {
                return true;
            }
        }

        return false;
    }
243377
private function definitionClassExists($type, ContainerBuilder $container)
    {
        if ($container->hasParameter($this->getCustomDefinitionClassParameter($type))) {
            return true;
        }

        return class_exists($this->getDefinitionClass($type, $container));
    }
170730
public static function has( $key )
	{
		$cache = self::instance();
		if ( $cache ) {
			return $cache->isExisting( $key );
		}
		return false;
	}
882385
public function deleteContainers($containers, $force = false)
    {
        if (!empty($containers)) {
            if (!isset($containers[0])) {
                // single folder, make into array
                $containers = [$containers];
            }
            foreach ($containers as $key => $folder) {
                try {
                    // path is full path, name is relative to root, take either
                    $name = array_get($folder, 'name', trim(array_get($folder, 'path'), '/'));
                    if (!empty($name)) {
                        $this->deleteContainer($name, $force);
                    } else {
                        throw new DfException('No name found for container in delete request.');
                    }
                } catch (\Exception $ex) {
                    // error whole batch here?
                    $containers[$key]['error'] = ['message' => $ex->getMessage(), 'code' => $ex->getCode()];
                }
            }
        }

        return $containers;
    }
13512
public function exists(string $key): bool
    {
        $result = $this->execute([
            [
                'command' => 'get',
                'key' => $key,
                'result' => ['key']
            ]
        ]);
        return isset($result[0]['key']);
    }
270672
public function bundleExists($bundle)
    {
        $kernelBundles = $this->getConfigurationPool()->getContainer()->getParameter('kernel.bundles');
        if (array_key_exists($bundle, $kernelBundles)) {
            return true;
        }
        if (in_array($bundle, $kernelBundles)) {
            return true;
        }

        return false;
    }
256663
public function has($name, $checkAbstractFactories = true, $usePeeringServiceManagers = false)
    {
        if (is_string($name) && $this->container->has($name)) {
            return true;
        } elseif (parent::has($name, $checkAbstractFactories, $usePeeringServiceManagers)) {
            return true;
        }

        return false;
    }
365368
public function container($container = null)
    {
        if (is_null($container)) {
            return $this->factory->getContainer();
        }
        else {
            $this->factory->share($name, $handler);
            return null;
        }
    }
353640
public function exists($key) {
        if (!array_key_exists($key, $this->storage))
            return false;

        if ($this->storage[$key]['expires'] > 0 && time() > $this->storage[$key]['expires'])
            return false;

        return true;
    }
43480
public function container($container = 'default')
	{
		if (!isset($this->containers[$container])) {
			$this->containers[$container] = new Container($container);
		}
		
		return $this->containers[$container];
	}
825883
public function has($name)
    {
        foreach ($this->containers as $container) {
            if ($container->has($name)) {
                return true;
            }
        }

        return false;
    }