Removed logic to load /__pickles/(js|css)/*.(js|css) files. It didn't work in nginx without trickery and it was a fundamentally ignorant approach since it caused PHP overload just to load a static file. The inclusion of the boilerplate will allow users to fork said project and have all files readily available.

This commit is contained in:
Josh Sherman 2011-08-28 18:00:30 -04:00
parent 16d201bbc9
commit df5a2e2aaa
3 changed files with 224 additions and 306 deletions

View file

@ -59,24 +59,8 @@ class Controller extends Object
exit;
}
// Catches requests to PICKLES core files and passes them through
if (preg_match('/^__pickles\/(css|js)\/.+$/', $_REQUEST['request'], $matches))
{
// Checks that the file exists
$file = str_replace('__pickles/', PICKLES_PATH, $_REQUEST['request']);
if (file_exists($file))
{
// Sets the pass thru flag and dumps the data
$this->passthru = true;
// This is somewhat hacky, but mime_content_type() is deprecated and finfo_file() is only 5.3+
header('Content-Type: text/' . ($matches[1] == 'js' ? 'javascript' : $matches[1]));
exit(file_get_contents($file));
}
}
// Catches requests to the __shared directory
elseif (preg_match('/^__shared/', $_REQUEST['request']))
if (preg_match('/^__shared/', $_REQUEST['request']))
{
header('Location: /');
exit;