Restructure theme, use autoloader

This commit is contained in:
QWp6t
2015-12-18 16:41:37 -08:00
committed by Ben Word
parent 463d6bcf07
commit 3f9b112ffa
13 changed files with 608 additions and 6 deletions

View File

@@ -0,0 +1,29 @@
<?php namespace Roots\Sage\Assets;
/**
* Class JsonManifest
* @package Roots\Sage
* @author QWp6t
*/
class JsonManifest implements IManifest {
/** @var array */
protected $manifest = [];
/**
* JsonManifest constructor
* @param string $manifestPath Local filesystem path to JSON-encoded manifest
*/
public function __construct($manifestPath) {
$this->manifest = file_exists($manifestPath) ? json_decode(file_get_contents($manifestPath), true) : [];
}
/** @inheritdoc */
public function get($file) {
return isset($this->manifest[$file]) ? $this->manifest[$file] : $file;
}
/** @inheritdoc */
public function getAll() {
return $this->manifest;
}
}