PHP Classes

File: sample2/icss-translate.php

Recommend this page to a friend!
  Classes of mehmet emin akyüz   Inherited CSS   sample2/icss-translate.php   Download  
File: sample2/icss-translate.php
Role: Example script
Content type: text/plain
Description: automatically handles requests to *.css files by translating *.i.css files.
Class: Inherited CSS
Build CSS styles that inherit from parent styles
Author: By
Last change:
Date: 12 years ago
Size: 538 bytes
 

Contents

Class file image Download
<?php
require_once '../icss.php';
$css = $_REQUEST['css'];

header( 'Content-Type: text/css' );
if( isset(
$_REQUEST['clear'] ) || !file_exists( $css . '.i.css' ) || filemtime( $css . '.i.css' ) > @filemtime( $css . '.css' ) ){
   
$icss = new ICSS( $css . '.i.css' );
   
$output = $icss->build( true );
    if(
$output === false ){
        echo
"/* ERROR: " . $icss->error . " */\n";
       
readfile( $css . '.i.css' );
    } else {
       
file_put_contents( $css . '.css', $output );
        echo
$output;
    }
} else {
   
readfile( $css . '.css' );
}
?>