示例#1
0
 /**
  * server() returns an instance of Leafo\ScssPhp\Server, constructing it if
  * necessary.
  *
  * If you provide an instance of Server as argument, it uses that instead.
  *
  * @return Server
  */
 public static function server($instance = null)
 {
     if ($instance !== null) {
         static::$scss_server = $instance;
     } elseif (static::$scss_server === null) {
         $sass_cache_dir = craft()->path->getStoragePath() . '/scss_cache';
         IOHelper::ensureFolderExists($sass_cache_dir);
         static::$scss_server = new Server(dirname(craft()->request->getScriptFile()), $sass_cache_dir);
         static::$scss_server->showErrorsAsCSS();
     }
     return static::$scss_server;
 }