Skip to content

Instantly share code, notes, and snippets.

@Zegnat
Last active January 31, 2018 11:52
Show Gist options
  • Select an option

  • Save Zegnat/062adb3e1f0ed935035f0e4fd4c36ecd to your computer and use it in GitHub Desktop.

Select an option

Save Zegnat/062adb3e1f0ed935035f0e4fd4c36ecd to your computer and use it in GitHub Desktop.
<?php
class KnownValetDriver extends BasicValetDriver
{
public function serves($sitePath, $siteName, $uri)
{
return is_file($sitePath . '/version.known');
}
public function isStaticFile($sitePath, $siteName, $uri)
{
return parent::isStaticFile(
$sitePath,
$siteName,
preg_replace('#^/(js|css)/[0-9]+/(.*)$#', '/\1/\2', $uri)
);
}
public function frontControllerPath($sitePath, $siteName, $uri)
{
$_SERVER['PHP_SELF'] = '/index.php';
return $sitePath . '/index.php';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment