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:
parent
16d201bbc9
commit
df5a2e2aaa
3 changed files with 224 additions and 306 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue