示例#1
0
 public function __construct(Process $process)
 {
     $this->process = $process;
     $io = $process->io;
     Crush::runStat('paths');
     if ($process->options->cache) {
         $process->cacheData = $io->getCacheData();
         if ($io->validateCache()) {
             $this->url = $io->getOutputUrl();
             $this->path = $io->getOutputDir() . '/' . $io->getOutputFilename();
             $process->release();
             return;
         }
     }
     $string = $process->compile();
     if ($io->write($string)) {
         $this->url = $io->getOutputUrl();
         $this->path = $io->getOutputDir() . '/' . $io->getOutputFilename();
     }
 }
示例#2
0
        }
    }
}
function warning($message, $context = array())
{
    Crush::$process->errors[] = $message;
    $logger = Crush::$config->logger;
    if ($logger instanceof Logger) {
        $message = "[[CssCrush]] - {$message}";
    }
    $logger->warning($message, $context);
}
function notice($message, $context = array())
{
    Crush::$process->warnings[] = $message;
    $logger = Crush::$config->logger;
    if ($logger instanceof Logger) {
        $message = "[[CssCrush]] - {$message}";
    }
    $logger->notice($message, $context);
}
function debug($message, $context = array())
{
    Crush::$config->logger->debug($message, $context);
}
function log($message, $context = array(), $type = 'debug')
{
    Crush::$config->logger->{$type}($message, $context);
}
Crush::init();
示例#3
0
 public function postCompile()
 {
     foreach ($this->plugins as $plugin) {
         Plugin::disable($plugin);
     }
     $this->release();
     Crush::runStat('compile_time');
 }