/** * @param string $fullJsonPath * @param bool $appendToExists * @throws Exception */ protected function loadAppsRules($fullJsonPath, $appendToExists = false) { $jsonData = $this->jsonLoader->load($fullJsonPath); $decoded = json_decode($jsonData, true); if ($appendToExists) { $decoded['apps'] = array_merge($this->apps, $decoded['apps']); } $this->apps = $decoded['apps']; }
function _outputFileLoaderFile($matches) { $fullPath = FileLoader::load($matches[1]); if ($fullPath) { CacheHeaders($fullPath); header('Content-type: '.mime_type($fullPath)); echo file_get_contents($fullPath); exit; } _404(); }
public function __construct(FileLoader $loader, $jsonFilePath) { $json = json_decode($loader->load($jsonFilePath), true); $this->categories = $json['categories']; }
function _outputFileLoaderFile($matches) { _outputFile(FileLoader::load($matches[1])); }
/** * @covers Zepto\FileLoader::load() * @dataProvider providerTestLoadMultipleFiles */ public function testLoadMultipleFiles($expected) { $actual = array_merge($this->loader->load('sub/page.md'), $this->loader->load('sub/index.md')); $this->assertEquals($expected, $actual); }
public static function loadClassByName($className) { return FileLoader::load($className); }
/** * Created by IntelliJ IDEA. * User: Voww * Date: 16.12.2015 * Time: 10:35 */ set_include_path("C:/wamp/www/testserver.int/imsmedia/"); include_once "parser/xml_parser/XMLParser.php"; include_once "loader/file_loader/FileLoader.php"; include_once "IMSMediaHeader.html"; $parser = new XMLParser(); $loader = new FileLoader(); $output = '<a href="/imsmedia/Import.html"><button>Back</button></a><hr>'; try { $uploadFileName = $loader->load(); $output .= "A file was imported succesfully<br>"; $content = file_get_contents($uploadFileName); $parser->parse($content); $currencies = $parser->parseCurrencies(); $measurements = $parser->parseMeasurements(); $categories = $parser->parseCategories(); $products = $parser->parseProducts(); AbstractDAO::closeConnection(); $output .= "<h2>Measurements</h2>"; $output .= nl2br($measurements); $output .= "<h2>Currencies</h2>"; $output .= nl2br($currencies); $output .= "<h2>Categories</h2>"; $output .= nl2br($categories); $output .= "<h2>Products</h2>";