'text/css', 'js' => 'application/javascript', 'jpg' => 'image/jpg', 'png' => 'image/png', 'gif' => 'image/gif', 'svg' => 'image/svg+xml', 'map' => 'application/json', 'woff' => 'application/x-woff', 'woff2' => 'application/font-woff2', 'html' => 'text/html', ]; if (isset($mimeTypes[$ext])) { header("Content-Type: $mimeTypes[$ext]"); } readfile($file); return; } else { $debug('file does not exist'); if (strpos($route, 'static/') === 0) { $route = preg_replace('#static/#', '', $route, 1); $_GET['resource'] = $route; $debug("static: $route"); include($magentoPackagePubDir.'/static.php'); exit; } elseif (strpos($route, 'media/') === 0) { $debug("media: $route"); include($magentoPackagePubDir.'/get.php'); exit; } } } else { $debug("thunk to index in $route"); include($magentoPackagePubDir.'/index.php'); } }