Example #1
0
 * @return true if the client has same version
 * of the document corresponding to $etag
 */
function isClientCachingDocument($etag)
{
    if (!isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
        return false;
    }
    if ($_SERVER['HTTP_IF_NONE_MATCH'] == $etag) {
        return true;
    }
    return false;
}
$viewName = $param[0];
///< base name of the scss file
$scss = new \Core3\Writer\Scss();
$scss->setImportPath($this->applicationDirectoryRoot . '/scss');
header('Content-Type: text/css');
try {
    if ($requestMethod != 'GET') {
        throw new \Exception('only GET supported');
    }
    $scssFile = $scss->getScssFileName($viewName);
    if (!file_exists($scssFile)) {
        throw new \Core3\Exception\FileNotFound();
    }
    $cachedFile = $scss->getCachedFileName($viewName);
    if (file_exists($cachedFile)) {
        $orgMtime = filemtime($scssFile);
        $cacheMtime = filemtime($cachedFile);
        if ($cacheMtime > $orgMtime) {
Example #2
0
 private function getScssInstance()
 {
     $scss = new \Core3\Writer\Scss();
     $scss->setFormatterModeCompressed();
     return $scss;
 }