public static function getDate($timestamp, $type = 'rfc1123')
{
$type = strtolower($type);
if ($type == 'rfc1123') {
return substr(gmdate('r', $timestamp), 0, -5) . 'GMT';
} else {
if ($type == 'rfc1036') {
return gmdate('l, d-M-y H:i:s ', $timestamp) . 'GMT';
} else {
if ($type == 'asctime') {
return gmdate('D M j H:i:s', $timestamp);
} else {
throw new InvalidArgumentException('The second getDate() method parameter must be one of: rfc1123, rfc1036 or asctime.');
}
}
}
}
public function execute($request) { $css = Doctrine::getTable('SnsConfig')->get('customizing_css', ''); $this->getResponse()->setContent($css); $this->getResponse()->setContentType('text/css'); // cache $filesystem = new sfFilesystem(); $dir = sfConfig::get('sf_web_dir') . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'css'; @$filesystem->mkdirs($dir); file_put_contents($dir . DIRECTORY_SEPARATOR . 'customizing.css', $css); $this->getResponse()->setHttpHeader('Last-Modified', sfWebResponse::getDate(time())); return sfView::NONE; }