Skip to content

Instantly share code, notes, and snippets.

@cpierce
Created March 7, 2016 03:53
Show Gist options
  • Save cpierce/f281424fea802ff14d4a to your computer and use it in GitHub Desktop.
Save cpierce/f281424fea802ff14d4a to your computer and use it in GitHub Desktop.
public function storeAdvancedCSS($cssID)
{
global $site;
$file = new TextFile($site->userFiles, 'css'.$cssID.'.css');
if ($site->S3_ON) {
S3New::getInstance()->deleteFile($site->S3_SITE_FOLDER.'/css'.$cssID.'.css');
//TODO: This would be a prime place to invalidate our cache because we know that we are about to delete the file.
//However it shouldn't be needed because the code attempts, to re-create the same file that we just deleted. Placing here for the future.
if (constant('ENVIRONMENT') != 'production') {
MemoryManager::getInstance()->invalidateCSSFile($site->userFileLoc.'css'.$site->designID.'.css');
}
} else {
$file->deleteFile();
}
$file->writeToFile($this->generateAdvancedCSS($cssID));
$this->storeCkCSS($site->userFiles);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment