예제 #1
0
 private function compile($processor, $exec, $ext)
 {
     $content = $processor->getContents();
     $content = shell_exec_stdio($exec, $content);
     $relativePath = $processor->getRelativePath();
     $relativePath = str_slice($relativePath, 0, -strlen($processor->getType())) . $ext;
     $processor->setType($ext);
     $processor->setRelativePath($relativePath);
     $processor->setContents($content);
 }
예제 #2
0
 public function exec($exec)
 {
     return shell_exec_stdio($exec, $this->contents);
 }
예제 #3
0
파일: prolang.php 프로젝트: chenyongze/m3d
    if (in_array($ext, $value)) {
        $type = $key;
        break;
    }
}
switch ($type) {
    case 'js':
        header('Content-Type: text/javascript;');
        break;
    case 'css':
        header('Content-Type: text/css;');
        break;
}
foreach ($langExt[$type] as $_ext) {
    $_path = str_replace('.' . $ext, '.' . $_ext, $uriPath);
    if (file_exists($_path)) {
        $contents = file_get_contents($_path);
        switch ($_ext) {
            case 'coffee':
                $contents = shell_exec_stdio(C('COFFEE') . ' -bsp', $contents);
                break;
            case 'sass':
                $contents = shell_exec_stdio(C('SASS') . ' -s -I ' . $docRoot, $contents);
                break;
        }
        echo $contents;
        exit;
    }
}
header("Status: 404 Not Found");
exit;