Loads the configuration data from a resource and returns it flattened.

@param mixed   $resource A resource.
@param string  $type     The resource type.
@param boolean $require  Require processing?

@return array The data.
498559
public function loadFlat($resource, $type = null, $require = false)
    {
        return ArrayUtil::flatten($this->load($resource, $type, $require));
    }
377132
public function parse($resource) {
        $result = array();
        $fieldcnt = mysql_num_fields($resource);
        $fields_transform = array();
        for($i=0;$i<$fieldcnt;$i++) {
            $type = mysql_field_type($resource, $i);
            if(isset(self::$fieldTypes[$type])) {
                $fields_transform[mysql_field_name($resource, $i)] = self::$fieldTypes[$type];
            }
        }

        while($row = mysql_fetch_object($resource)) {
            foreach($fields_transform as $fieldname => $fieldtype) {
               settype($row->$fieldname, $fieldtype);
            }
            $result[] = $row;
        }
        return $result;
    }
50702
public function load($resource, $type = null)
    {
        return $this->routeCollectionMapper->mapCollection($this->import($resource));
    }
193782
public function load($resource, $type = null): array
    {
        try {
            $path = $this->locator->locate($resource);
            $file = $this->filesystem->openFile($path);
            $configValues = $this->yamlParser->parse($file->getContents());

            return $configValues;
        } catch (FileLocatorFileNotFoundException $error) {
            return [];
        }
    }
493837
public function load($resource, $type = null): RouteCollection
    {
        $resource = (string)$resource;
        if (in_array($resource, $this->descriptions)) {
            throw new \RuntimeException("Resource '$resource' was already loaded");
        }

        $description = $this->repository->get($resource);

        $routes           = new RouteCollection();
        $router           = $description->getExtension('router') ?: "$this->typeName.controller";
        $routerController = $description->getExtension('router-controller');

        foreach ($description->getPaths() as $pathItem) {
            $relativePath = ltrim($pathItem->getPath(), '/');
            $resourceName = strpos($relativePath, '/')
                ? substr($relativePath, 0, strpos($relativePath, '/'))
                : $relativePath;

            $routerController = $pathItem->getExtension('router-controller') ?: $routerController;

            foreach ($pathItem->getOperations() as $operation) {
                $controllerKey = $this->resolveControllerKey(
                    $operation,
                    $resourceName,
                    $router,
                    $routerController
                );
                $defaults      = [
                    '_controller'               => $controllerKey,
                    RequestMeta::ATTRIBUTE_URI  => $resource,
                    RequestMeta::ATTRIBUTE_PATH => $pathItem->getPath(),
                ];

                $route = new Route(
                    $pathItem->getPath(),
                    $defaults,
                    $this->resolveRequirements($operation),
                    [],
                    '',
                    $description->getSchemes()
                );
                $route->setMethods($operation->getMethod());
                $routes->add($this->createRouteId($resource, $pathItem->getPath(), $controllerKey), $route);
            }
        }

        $this->descriptions[] = $resource;

        return $routes;
    }
281755
public function resolve(string $resource, string $type = ''): string
    {
        if (! $this->hasLocalPath()) {
            return $resource;
        }
        if ('' === $type) {
            $type = $this->obtainTypeFromUrl($resource);
        } else {
            $type = strtoupper($type);
        }
        $retriever = $this->newRetriever($type);
        if (null === $retriever) {
            throw new \RuntimeException("Unable to handle the resource (Type: $type) $resource");
        }
        $local = $retriever->buildPath($resource);
        if (! file_exists($local)) {
            $retriever->retrieve($resource);
        }
        return $local;
    }
39704
public function supports($resource, $type = null)
    {
        if (!is_string($resource) || 'xml' !== pathinfo($resource, PATHINFO_EXTENSION)) {
            return false;
        }

        $file = $this->getLocator()->locate($resource);
        $document = XmlUtils::loadFile($file);
        $namespaces = $document->documentElement->attributes->getNamedItem('schemaLocation')->nodeValue;

        $start = strpos($namespaces, static::XML_NAMESPACE_URI) + strlen(static::XML_NAMESPACE_URI) + 1;
        $namespace = substr($namespaces, $start);

        $end = strpos($namespace, ' ');
        if (false !== $end) {
            $namespace = substr($namespace, 0, $end);
        }

        return $namespace === static::SCHEMA_URI;
    }
163092
public function load($resource, $type = null)
    {
        $collection = new RouteCollection();

        if ($this->components != null) {
            foreach ($this->components as $componentName => $component) {
                if (!isset($component['bundle'])) {
                    continue;
                }

                $bundleClassName = preg_replace('/^.*\\\/', '', $component['bundle']);
                $resource = '@' . $bundleClassName . '/Resources/config/routing.yml';
                $type = 'yaml';

                /** @var RouteCollection $importedRoutes */
                $importedRoutes = $this->import($resource, $type);

                foreach ($importedRoutes as $route) {
                    /** @var Route $route */
                    if (!strstr($route->getPath(), $componentName)) {
                        $route->setPath('/'. $componentName . $route->getPath());
                    }
                }

                $collection->addCollection($importedRoutes);
            }
        }

        return $collection;
    }
225407
public function load($resource, $type = null): RouteCollection
    {
        if (true === $this->loaded) {
            throw new \RuntimeException('Do not add the "sidus_admin" loader twice');
        }

        $routes = new RouteCollection();

        foreach ($this->adminRegistry->getAdmins() as $admin) {
            foreach ($admin->getActions() as $action) {
                $routes->add($action->getRouteName(), $action->getRoute());
            }
        }

        $this->loaded = true;

        return $routes;
    }
1221707
public function load($resource, $type = null)
    {
        $resource = (string) $resource;

        if (!is_file($resource)) {
            throw new InvalidArgumentException(sprintf('File "%s" is not a regular file.', $resource));
        }

        if (!is_readable($resource)) {
            throw new InvalidArgumentException(sprintf('File "%s" is not readable.', $resource));
        }

        $content = file_get_contents($resource);
        $decoded = @json_decode($content, true);

        if ($decoded === null) {
            throw new InvalidArgumentException(
                sprintf('File "%s" cannot be json decode (error code: %s).', $resource, json_last_error())
            );
        }

        return $decoded;
    }
1212816
public function load($resource, $type = null): RouteCollection
    {
        if ($this->loaded) {
            throw new \RuntimeException('Do not add the "extra" loader twice.', 1500587713);
        }

        $routes = new RouteCollection();
        $this->addModuleRoutes($routes);

        $this->loaded = true;

        return $routes;
    }
447306
private function getFromData($type, $key)
    {
        return $this->hasData($type, $key) ? $this->data[$type][$key] : null;
    }
1292347
public function load($file, $type = null)
    {
        $path = $this->locator->locate($file);
        $this->setCurrentDir(dirname($path));

        $config = require $path;

        // not an array
        if (!is_array($config)) {
            throw new \InvalidArgumentException(sprintf('The file "%s" must contain a PHP array.', $path));
        }

        return $config;
    }
7555
public static function items($type)
	{
		if(!isset(self::$_items[$type]))
			self::loadItems($type);
		return self::$_items[$type];
	}
840754
public function loadConfig($resource, $type = null)
    {
        $this->getConfigManager()->addConfig($resource, $type);

        return $this;
    }
107077
public function supports($resource, $type = null)
    {
        if (is_string($resource)) {
            if ($this->isFile($resource)) {
                return $this->validateExtension($resource);
            } else {
                return $this->isJson($resource);
            }
        }

        return false;
    }
704481
public function getResolverForResource($resource, $type = null){
		if(is_string($resource) && $resource[0] === '/'){
			$dir = dirname($resource);
			$resolver = $this->getResolverForPath($dir);
		}else{
			$resolver = $this->getResolver();
		}
		return $resolver;
	}