- Copy the WoltlabSuiteValetDriver.php to ~/.valet/Drivers
- Enter directory with installation files
- Use
valet link wbb
- Directory will be accessible as wbb.dev
Created
October 2, 2017 12:19
-
-
Save NBZ4live/8ed860443a3df6fc5115ed088ca97ce0 to your computer and use it in GitHub Desktop.
WoltlabSuiteValetDriver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class WoltlabSuiteValetDriver extends BasicValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri | |
* @return bool | |
*/ | |
public function serves($sitePath, $siteName, $uri) | |
{ | |
if (file_exists($sitePath.'/WCFSetup.tar.gz')) { | |
return true; | |
} | |
$appConfigFile = $sitePath.'/app.config.inc.php'; | |
if (file_exists($appConfigFile) && strpos(file_get_contents($appConfigFile), 'woltlab')) { | |
return true; | |
} | |
return false; | |
} | |
/** | |
* Determine if the incoming request is for a static file. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri | |
* @return string|false | |
*/ | |
public function isStaticFile($sitePath, $siteName, $uri) | |
{ | |
$staticFilePath = $sitePath.$uri; | |
if (file_exists($staticFilePath) && | |
!is_dir($staticFilePath) && | |
pathinfo($staticFilePath)['extension'] != 'php') { | |
return $staticFilePath; | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment