Skip to content

Commit

Permalink
Added check for missing host files
Browse files Browse the repository at this point in the history
  • Loading branch information
peteboere committed Jul 28, 2011
1 parent 7a33714 commit 9d8c016
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CssCrush/CssCrush.php
Expand Up @@ -205,13 +205,17 @@ public static function file ( $file, $options = null ) {
$hostfile = new stdClass;
$hostfile->name = basename( $file );
$hostfile->path = "{$config->baseDir}/{$hostfile->name}";
$hostfile->mtime = filemtime( $hostfile->path );

if ( !file_exists( $hostfile->path ) ) {
// If host file doesn't exist return an empty string
// If host file is not found return an empty string
self::triggerWarning( "File \"$hostfile->name\" not found", __METHOD__ );
return '';
}

else {
// Capture the modified time
$hostfile->mtime = filemtime( $hostfile->path );
}

self::parseOptions( $options );

// Compiled filename we're searching for
Expand Down

0 comments on commit 9d8c016

Please sign in to comment.