Loads formulae from a resource.
Formulae should be loaded the same regardless of the current debug mode. Debug considerations should happen downstream.
ResourceInterface $resource A resource:
array An array of formulae
Overrides FormulaLoaderInterface::load
public function load(ResourceInterface $resources) {
if (!$resources instanceof IteratorResourceInterface) {
$resources = array(
$resources,
);
}
$formulae = array();
foreach ($resources as $resource) {
$id = (string) $resource;
if (!$this->configCache
->has($id) || $this->debug && !$resource
->isFresh($this->configCache
->getTimestamp($id))) {
$formulae += $this->loader
->load($resource);
$this->configCache
->set($id, $formulae);
}
else {
$formulae += $this->configCache
->get($id);
}
}
return $formulae;
}