@param string $containerPath

@return bool
511827
public function loadContainer($containerPath)
    {
        $containerPath = realpath($containerPath);

        if (false === $containerPath) {
            return false;
        }

        $this->container = new ContainerBuilder();

        try {
            $loader = new XmlFileLoader($this->container, new FileLocator(dirname($containerPath)));
            $loader->load(basename($containerPath));

            return true;
        } catch (\Exception $e) {
            return false;
        }
    }
748747
public function initResourceByPath($path)
    {
        $parsed = parse_url($path);

        if ($parsed === false) {
            return false;
        }
        $this->currentPath = $path;

        if (isset($parsed['host'])) {
            $this->containerName = $parsed['host'];
        }
        if (isset($parsed['path'])) {
            $this->resourceName = $this->cleanName($parsed['path']);
        }
        return $this;
    }
200825
public function saveFile($containerName, \SplFileInfo $file, $relativePath)
    {
        $fileName = $file->getFilename();
        $filePath = $this->getFullFileName($containerName, $fileName, $relativePath);

        return $this->move($file->getRealPath(), $filePath);
    }
694294
public function dir_opendir($path)
    {
        $container = $this->getContainerFromContext($path);

        $path = $this->stripScheme($path);

        if (!$container->hasNodeAt($path)) {
            trigger_error(sprintf('opendir(%s): failed to open dir: No such file or directory', $path), E_USER_WARNING);

            return false;
        }

        try {

            $dir = $container->directoryAt($path);

        } catch (NotDirectoryException $e) {
            trigger_error(sprintf('opendir(%s): failed to open dir: Not a directory', $path), E_USER_WARNING);

            return false;
        }

        $permissionHelper = $container->getPermissionHelper($dir);

        if (!$permissionHelper->isReadable()) {
            trigger_error(sprintf('opendir(%s): failed to open dir: Permission denied', $path), E_USER_WARNING);

            return false;
        }

        $this->currentlyOpenedDir = new DirectoryHandler();
        $this->currentlyOpenedDir->setDirectory($dir);

        return true;
    }
457170
public function fileExists($containerName, $fileName, $relativePath)
    {
        return $this->getFactory()
            ->createStorage($containerName)
            ->fileExists($containerName, $fileName, $relativePath);
    }
1246968
public static function isValid(string $filePath): bool
    {
        return self::myFilePathParse(
            DIRECTORY_SEPARATOR,
            $filePath,
            function ($p, $d, &$e) {
                return self::myPartValidator($p, $d, $e);
            });
    }
1205304
public function unlink($path)
    {
        $container = $this->getContainerFromContext($path);

        try {

            $path = $this->stripScheme($path);

            $parent = $container->nodeAt(dirname($path));

            $permissionHelper = $container->getPermissionHelper($parent);
            if (!$permissionHelper->isWritable()) {
                trigger_error(
                    sprintf('rm: %s: Permission denied', $path),
                    E_USER_WARNING
                );

                return false;
            }

            $container->remove($path = $this->stripScheme($path));
        } catch (NotFoundException $e) {
            trigger_error(
                sprintf('rm: %s: No such file or directory', $path),
                E_USER_WARNING
            );

            return false;
        } catch (\RuntimeException $e) {
            trigger_error(
                sprintf('rm: %s: is a directory', $path),
                E_USER_WARNING
            );

            return false;
        }

        return true;
    }
203490
protected function filterPath($absolutePath)
    {
        // Unresolved paths with '..' are invalid
        if (Str::contains($absolutePath, '..')) return false;
        return Str::startsWith($absolutePath, $this->outputdir . '/');
    }
171321
public function deleteFile($containerName, $fileName, $relativePath)
    {
        return $this->fileUploadFacade->deleteFile($containerName, $fileName, $relativePath);
    }
1087834
private function setTemplatePath($templatePath)
  {
    $return = false;

    if (is_string($templatePath)) {
      if ($this->checkTemplatePath($templatePath) === true) {
        $this->templatePath[] = $templatePath;

        $return = true;
      }
    }
    else if (is_array($templatePath)) {
      foreach ($templatePath as $path) {
        if ($this->checkTemplatePath($path) === true) {
          $this->templatePath[] = $path;

          $return = true;
        }
      }
    }

    return $return;
  }
278467
private function createLoader(ContainerBuilder $container, string $basePath): LoaderInterface
    {
        $fileLocator = new FileLocator($basePath);
        $loader = new DelegatingLoader(new LoaderResolver([
            new Loader\XmlFileLoader($container, $fileLocator),
            new Loader\YamlFileLoader($container, $fileLocator),
            new Loader\PhpFileLoader($container, $fileLocator),
            new Loader\GlobFileLoader($container, $fileLocator)
        ]));

        return $loader;
    }
430594
def contains_container(self, path):
        
        path = make_path(path)
        try:
            self.get_container(path)
            return True
        except KeyError:
            return False
752113
public function has($id)
    {
        if (!is_string($id)) {
            throw new ContainerException('$id must be a string');
        }

        if (array_key_exists($id, $this->definitions)) {
            return true;
        }

        return false;
    }
986568
public static function locateResource($path, ContainerBuilder $container)
    {
        if (0 === stripos($path, '@')) {
            // Treat as a bundle path, e.g. @SomeBundle/path/to/something.

            // Correct backslashed paths.
            $path = str_replace('\\', '/', $path);

            $parts = explode('/', $path);
            $bundle = array_shift($parts);

            $bundleName = str_replace('@', '', $bundle);
            $bundleClass = null;
            foreach ($container->getParameter('kernel.bundles') as $name => $class) {
                if ($name === $bundleName) {
                    $bundleClass = $class;
                    break;
                }
            }

            if (null === $bundleClass) {
                throw new \RuntimeException(sprintf('Unable to find a bundle named "%s" for resource path "%s"', $bundleName, $path));
            }

            $refl = new \ReflectionClass($bundleClass);
            $bundleDir = dirname($refl->getFileName());
            return sprintf('%s/%s', $bundleDir, implode('/', $parts));
        }
        return $path;
    }
14699
public function exists(string $filePath, string $mode = self::READ_BINARY) : bool
    {
        if (self::INPUT_STREAM === $filePath) {
            return true;
        }

        if (self::READ_BINARY === $mode && ! file_exists($filePath)) {
            throw new FileException('File not found.');
        }

        return true;
    }
269837
protected function isPatternMatch(CdnConfiguration $configuration, $imagePath)
    {
        if (empty($configuration->getPathPatterns())) {
            return true;
        }

        foreach ($configuration->getPathPatterns() as $pattern) {
            if (preg_match(sprintf('~%s~', $pattern), $imagePath)) {
                return true;
            }
        }

        return false;
    }
688368
public function isServiceLoaded(string $serviceName): bool {
        if($this->serviceExists($serviceName)) {
            if(in_array($serviceName, $this->getSelfReferenceNames()))
                return true;

            /** @var ContainerInterface $container */
            $container = $this->serviceData[$serviceName];
            return $container->isInstanceLoaded();
        }
        return false;
    }