Cli/Optimizer.php
private function jssCompiler($config)
    {
        if (!isset($config->filename)) {
            echo "ERROR!!\n";
            return false;
        }

        $content = "var JSS = Array();\n";
        $width = 4096;

        //CSS
        if (isset($config->css)) {
            $tmp = $this->minify(false,
                                  $config->css,
                                  $this->yuicompressor,
                                  $this->config->baseDir);

            $tmp = explode("\n", str_replace("'", "\'", $tmp));

            foreach ($tmp as $k => $v) {
                $v = trim($v);
                if ($v == '') {
                    continue;
                }

                if (substr($v, -1) == '\\') {
                    $v .= '\\';
                }

                $content .= 'JSS['.$k.'] = \''.$v."';\n";
            }
        }

        //Função para montagem do STYLE
        $content .= 'for(var i in JSS){var etmp=document.createElement("STYLE");etmp.type="text/css";etmp.innerHTML=JSS[i];document.head.appendChild(etmp);}document.getElementsByClassName("container")[0].style.display="block";document.getElementById("loader").style.display="none";'."\n";

        //Javascripts
        if (isset($config->js)) {
            $content .= $this->minify(false,
                              $config->js,
                              $this->yuicompressor,
                              $this->config->baseDir);
        }

        file_put_contents($config->filename, $content);
        echo "\n\n Saving: ".$config->filename."\n";
    }
private function jssCompiler($config)
    {
        if (!isset($config->filename)) {
            echo "ERROR!!\n";
            return false;
        }

        $content = "var JSS = Array();\n";
        $width = 4096;

        //CSS
        if (isset($config->css)) {
            $tmp = $this->minify(false,
                                  $config->css,
                                  $this->yuicompressor,
                                  $this->config->baseDir);

            $tmp = explode("\n", str_replace("'", "\'", $tmp));

            foreach ($tmp as $k => $v) {
                $v = trim($v);
                if ($v == '') {
                    continue;
                }

                if (substr($v, -1) == '\\') {
                    $v .= '\\';
                }

                $content .= 'JSS['.$k.'] = \''.$v."';\n";
            }
        }

        //Função para montagem do STYLE
        $content .= 'for(var i in JSS){var etmp=document.createElement("STYLE");etmp.type="text/css";etmp.innerHTML=JSS[i];document.head.appendChild(etmp);}document.getElementsByClassName("container")[0].style.display="block";document.getElementById("loader").style.display="none";'."\n";

        //Javascripts
        if (isset($config->js)) {
            $content .= $this->minify(false,
                              $config->js,
                              $this->yuicompressor,
                              $this->config->baseDir);
        }

        file_put_contents($config->filename, $content);
        echo "\n\n Saving: ".$config->filename."\n";
    }
private function jssCompiler ( $ config ) { if ( ! isset ( $ config -> filename ) ) { echo "ERROR!!\n" ; return false ; } $ content = "var JSS = Array();\n" ; $ width = 4096 ; //CSS if ( isset ( $ config -> css ) ) { $ tmp = $ this -> minify ( false , $ config -> css , $ this -> yuicompressor , $ this -> config -> baseDir ) ; $ tmp = explode ( "\n" , str_replace ( "'" , "\'" , $ tmp ) ) ; foreach ( $ tmp as $ k => $ v ) { $ v = trim ( $ v ) ; if ( $ v == '' ) { continue ; } if ( substr ( $ v , - 1 ) == '\\' ) { $ v .= '\\' ; } $ content .= 'JSS[' . $ k . '] = \'' . $ v . "';\n" ; } } //Função para montagem do STYLE $ content .= 'for(var i in JSS){var etmp=document.createElement("STYLE");etmp.type="text/css";etmp.innerHTML=JSS[i];document.head.appendChild(etmp);}document.getElementsByClassName("container")[0].style.display="block";document.getElementById("loader").style.display="none";' . "\n" ; //Javascripts if ( isset ( $ config -> js ) ) { $ content .= $ this -> minify ( false , $ config -> js , $ this -> yuicompressor , $ this -> config -> baseDir ) ; } file_put_contents ( $ config -> filename , $ content ) ; echo "\n\n Saving: " . $ config -> filename . "\n" ; }
Jointer JS & CSS
@param  object $config configuration data
@return void         save file
Jointer JS & CSS