function updateSub($sub) { global $lastPrint; if ($lastPrint != "sub") { echo "\nUpdated {$sub}"; } else { echo ", {$sub}"; } $lastPrint = "sub"; $css = getStyle($sub); if (!$css) { touch("subs/{$sub}.min.css"); return; } file_put_contents("cachedsubs/{$sub}.css", $css); $cT = new cssEmoteParser(); $cT->parseString($css, $sub, true); $cT->finalize(); $d = $cT->toString(); if (!$d && file_exists("subs/{$sub}.min.css")) { unlink("subs/{$sub}.min.css"); $lastPrint = "delete"; echo "\nDeleted {$sub} - empty!"; return; } file_put_contents("subs/{$sub}.min.css", $d); file_put_contents("subs/{$sub}.count", $cT->emoteCount); }
} } $str .= "}"; return $str; } } if (@$argv[1] == "-ilcss") { $argv[1] = "-cssd"; cssEmoteParser::$testStr = $argv[2]; } if (@$argv[1] == "-cssf") { $argv[1] = "-cssd"; cssEmoteParser::$testFile = $argv[2]; } if (@$argv[1] == "-cssd") { $cT = new cssEmoteParser(); try { if (cssEmoteParser::$testStr === null) { $cT->parseFile(cssEmoteParser::$testFile); } else { $cT->parseString(cssEmoteParser::$testStr); } } catch (cssParseException $e) { die($e->getMessage()); } $cT->finalize(); var_dump($cT->tokens); //die(); echo @$cT->toString(); unset($cT); }