Skip to content

Instantly share code, notes, and snippets.

@gathercontent
gathercontent / AutoVersion.php
Created June 19, 2012 12:56
AutoVersion.php for GatherContent.com
<?
class AutoVersion {
public function fly($folder, $files_array = array(), $content_type = 'text/css', $compress = true) {
$code = '';
$path = $_SERVER['DOCUMENT_ROOT'] . $folder;
$last_modified = $this->last_modified($folder, $files_array);
$max_age = 60 * 60 * 24 * 365; // refresh if older than a year
<link rel="stylesheet" href="css/global/_dynamic.php?v=<?=@include('css/global/_dynamic.php');?>">
<link rel="stylesheet" href="css/homepage/_dynamic.php?v=<?=@include('css/homepage/_dynamic.php');?>">