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); }
public function exec($exec) { return shell_exec_stdio($exec, $this->contents); }
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;