Flake\Util\Frameworks::enabled PHP Method

enabled() static public method

static public enabled ( $sFramework )
    static function enabled($sFramework)
    {
        return false;
    }

Usage Example

Esempio n. 1
0
 public function addCss($sCssAbsPath)
 {
     if (\Flake\Util\Frameworks::enabled("LessPHP")) {
         $sCompiledPath = PATH_buildcss;
         $sFileName = basename($sCssAbsPath);
         $sCompiledFilePath = $sCompiledPath . \Flake\Util\Tools::shortMD5($sFileName) . "_" . $sFileName;
         if (substr(strtolower($sCompiledFilePath), -4) !== ".css") {
             $sCompiledFilePath .= ".css";
         }
         if (!file_exists($sCompiledPath)) {
             @mkdir($sCompiledPath);
             if (!file_exists($sCompiledPath)) {
                 die("Page: Cannot create " . $sCompiledPath);
             }
         }
         \Frameworks\LessPHP\Delegate::compileCss($sCssAbsPath, $sCompiledFilePath);
         $sCssUrl = \Flake\Util\Tools::serverToRelativeWebPath($sCompiledFilePath);
     } else {
         $sCssUrl = \Flake\Util\Tools::serverToRelativeWebPath($sCssAbsPath);
     }
     $sHtml = "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $sCssUrl . "\" media=\"all\"/>";
     $this->zone("head")->addBlock(new \Flake\Controller\HtmlBlock($sHtml));
 }