<?php

	define("STPBase" , true);

	error_reporting(0);

	require_once "../../admin/lib/composer.php";
	require_once "../../admin/lib/minify.php";
	require_once "../../admin/lib/common.php";
	require_once "../../admin/lib/include/file.php";
	require_once "../../admin/lib/include/dir.php";
	require_once "../../admin/lib/debug.php";

	ini_set("zlib.output_compression", 1);


	$dir	= dirname(__FILE__);
	$conf	= CFile::GetJson("../../upload/conf/assets.json");

	$minify = CMinify::newInstance()
		->setTypeJs()
		->setMinify($conf["js"]["type"] == "prod")
		->setConcatenate($conf["js"]["type"] == "prod")
		->addFiles(			
			array(
				$dir . "/jquery.min.js",
				$dir . "/jquery.mobile.custom.js",
		        $dir . "/jquery-migrate.min.js",
		        $dir . "/bootstrap.min.js",
				$dir . "/core.js",				
			),
			"first"
		)
		->addFilesByPrefix(
			$dir , 
			"plugin." , 
			"js"
		)
		->addFilesByPrefix(
			$dir , 
			"custom." , 
			"js" , 
			"last"
		)
		->setCacheFile("../../upload/_cache/style-" . $conf["js"]["type"] . "-" . $conf["js"]["ver"] . ".js")
		->setVersion($conf["js"]["ver"])
		->setNoCache(!$conf["js"]["cache"])
		->output();
