public function getFiles($css, $srcPath) { $srcName = FileFolder::getFileName($srcPath); $newFolder = FileFolder::getPathFromFile($this->fileCss) . $srcName . "/"; //--------------------------------------------------------- $origSrcFolder = FileFolder::getPathFromFile($srcPath); //--------------------------------------------------------- preg_match_all('/(url\\(\\"|url\\(\'|url\\(|src=\')(.*?)(\\)|\'|\\")/s', $css, $files); //--------------------------------------------------------- foreach ($files[2] as $file_key => $origFilePath) { $fileAbPath = NULL; $newAbPath = NULL; $origFilePath = Compile::getBetweenQuot($origFilePath); //----------------------------------------------------- if (strpos($origFilePath, "../") !== false) { $goBack = explode("../", $origFilePath); $goBackAmt = sizeof($goBack); $srcFolderArr = explode("/", $origSrcFolder); $fileLocationArr = array_slice($srcFolderArr, 0, -$goBackAmt); $srcFolder = implode($fileLocationArr, "/") . "/"; $filePath = end($goBack); } else { $srcFolder = $origSrcFolder; $filePath = $origFilePath; if (strpos($filePath, "http://") !== false) { $fileAbPath = $filePath; $filePath = FileFolder::getFileName($filePath, false); $newFilePath = $newFolder . $filePath; } } //----------------------------------------------------- $filePath = FileFolder::getFileName($filePath, false, true); //----------------------------------------------------- if (is_null($fileAbPath)) { $fileAbPath = $srcFolder . $filePath; } if (is_null($newAbPath)) { $newAbPath = $newFolder . $filePath; } //----------------------------------------------------- $newFilePath = $srcName . "/" . $filePath; //----------------------------------------------------- if (file_exists(Import::uber_src_path() . $fileAbPath)) { $fileAbPath = Import::uber_src_path() . $fileAbPath; } //----------------------------------------------------- if ($fileContent = file_get_contents($fileAbPath)) { if (!file_get_contents($newAbPath)) { $css = str_replace($origFilePath, $newFilePath, $css); FileFolder::file_put_contents($newAbPath, $fileContent); FileFolder::file_put_contents(Compile::$unminifiedPath . $this->cleanURL($fileAbPath), $fileContent); } } } return $css; }
//------------------------------------------- foreach (self::$filesLoaded as &$value) { if ($file == $value) { $bool = false; } } //------------------------------------------- if (!file_exists(GenFun::get_local_url($file))) { throw new Exception($file . " does not exist "); } //------------------------------------------- if ($bool) { array_push(self::$filesLoaded, $file); if ($include) { include_once $file; } } //------------------------------------------- return $bool; } } //---------------------------------------------------------------------------- Import::$uber_src_path = dirname(__FILE__) . "/"; //---------------------------------------------------------------------------- if (file_exists("ProjectGlobal.php")) { Import::current("ProjectGlobal.php"); } //---------------------------------------------------------------------------- require_once "server/werm/utils/Compile.php"; //---------------------------------------------------------------------------- Compile::go();
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> <?php Import::exJs(Import::uber_src_path(true) . "client/jquery/sliderPagination/jquery.pagination.js"); Import::exCss(Import::uber_src_path(true) . "client/jquery/sliderPagination/css/style.css"); ?> <!--===============================================================--> <style> .sliderPagination { @include center(); height:50px; } </style> <script id="SliderPagination" type="text/x-jQuery-tmpl"> <div class="sliderPagination"> <div id = "shell" class="sp-slider-wrapper"> <nav> <a href="#" class="sp-prev">Previous</a> <a href="#" class="sp-next">Next</a> </nav> </div> </div> </script> <!--===================================================================--> <script type="text/javascript"> var SliderPagination = Base.extend({ /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// //init var /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// //---------------------------------------------------------
if ($type == "code") { //krumo($ref->src_path); return Html::getExCss($newCss = self::compileSass($ref->src_path, $match[5], $index == 0 ? "" : "_match_" . $ref->index)); } return ""; } //------------------------------------------------------------------------ public static function replaceEnv($file) { $content = file_get_contents($file); preg_match_all('/\\${(.*?)}/', $content, $match, PREG_SET_ORDER); if (sizeof($match) > 0) { $content = str_replace($match[0][0], $_ENV[$match[0][1]], $content); } return $content; } //------------------------------------------------------------------------ public static function newPath_CFG($file) { return GlobalMas::$filesPath_absolute . "import/" . FileFolder::getFileName($file, true, true); } } //---------------------------------------------------------------------------- Import::$uber_src_path = $_ENV["uber_src"] . "/"; //---------------------------------------------------------------------------- //Import::$latestFiles = FileFolder::getLatestFile(NULL, NULL, 10); //FileFolder::delete(Compiler::$tmpPath); //---------------------------------------------------------------------------- //if (file_exists("ProjectGlobal.php")) Import::current("ProjectGlobal.php"); //---------------------------------------------------------------------------- //Compiler::go();
} //------------------------------------------------------------------------ public static function chk($file, $include = true) { //------------------------------------------- //init var //------------------------------------------- $bool = true; //------------------------------------------- foreach (self::$filesLoaded as &$value) { if ($file == $value) { $bool = false; } } //------------------------------------------- if (!file_exists(GenFun::get_local_url($file))) { throw new Exception($file . " does not exist"); } //------------------------------------------- if ($bool) { array_push(self::$filesLoaded, $file); if ($include) { include_once $file; } } //------------------------------------------- return $bool; } } Import::$uber_src_path = StringUtil::replaceOverlap($_SERVER['DOCUMENT_ROOT'] . "/", dirname(__FILE__) . "/");
public function getAllContent($arr, $type, $minify) { $txt = ""; $import = ""; foreach ($arr as $value) { $content = $this->getFileContent($type, $value, $minify); //--------------------------------------------------------- if ($this->isPropSet($this->code[$type], "type", "seperate")) { $file = $value['file']; $file = str_replace(array(Import::uber_src_path(), Import::getImportPath()), "", $file); //----------------------------------------------------- $path = $this->isPropSet($this->code[$type], "path", NULL) ? FileFolder::getFileName($file, true, true) : $this->code[$type]['path'] . FileFolder::getFileName($file, true); $file = $path . ($type == "tmpl" ? "_tmpl.html" : ".{$type}"); if (!is_null($value['file']) && is_null($value['ex']) && $this->isPropSet($this->code[$type], "type", "seperate")) { //$import .= $this->getExtLink($file).PHP_EOL; /*krumo($this->code[$type]); krumo($file); krumo($type); krumo($value);*/ //krumo($value); //krumo($file); FileFolder::file_put_contents($this->path . $file, $content); } } /*else if (!is_null($value['ex']) && $this->isPropSet($this->code[$type], "forceDownload", NULL)) { $txt .= $this->getExtLink($value['file']).PHP_EOL; //$this->import .= $value['ex']; }*/ $txt .= $content; } if ($this->code[$type]["createImportFile"]) { $import_path = NULL; //----------------------------------------------------- if (is_array($this->code[$type]["createImportFile"]) && isset($this->code[$type]["createImportFile"])) { if (isset($this->code[$type]["createImportFile"]["path"])) { $import_path = $this->code[$type]["createImportFile"]["path"]; } } //----------------------------------------------------- $import_path = $this->path . (is_null($import_path) ? $this->compiler->compile_id . "_" . $type . "_import.php" : $import_path); FileFolder::file_put_contents($import_path, $import); } /*else { $this->import .= $import; }*/ return $txt; }