Skip to content

Commit 5f2c2fb

Browse files
committed
Kept logic around checking if a "default" site path is set and serving that if needed, but removed the actual CLI commands to set it (recommending people add/change their "default" path in their ~/.valet/config.json file manually).
1 parent d62b7b2 commit 5f2c2fb

File tree

2 files changed

+5
-35
lines changed

2 files changed

+5
-35
lines changed

cli/valet.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -253,36 +253,6 @@
253253
output('NO');
254254
}
255255
})->descriptions('Determine if this is the latest version of Valet');
256-
257-
/**
258-
* Get or set the fallback site path used by Valet for uncaught urls.
259-
*/
260-
$app->command('fallback [path]', function ($path = null) {
261-
if ($path === '?') {
262-
if (($config = Configuration::read()) && isset($config['fallback'])) {
263-
return info($config['fallback']);
264-
} else {
265-
return warning('Fallback path not set.');
266-
}
267-
}
268-
269-
if ($path && !is_dir($path)) {
270-
return warning('The fallback path ['.$path.'] is not a valid directory.');
271-
}
272-
273-
Configuration::updateKey('fallback', $path ?: getcwd());
274-
275-
info('Your Valet fallback path has been updated to '.($path === null ? 'the current directory' : "[{$path}]").'.');
276-
})->descriptions('Set the current working (or specified) directory as the fallback site path for uncaught urls');
277-
278-
/**
279-
* Removes the fallback site path used by Valet.
280-
*/
281-
$app->command('unfallback', function () {
282-
Configuration::updateKey('fallback', null);
283-
284-
info('Your Valet fallback path has been removed.');
285-
})->descriptions('Remove the fallback site path for uncaught urls');
286256
}
287257

288258
/**

server.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ function valet_support_xip_io($domain)
3838
/**
3939
* @param array $config Valet configuration array
4040
*
41-
* @return string|null If set, fallback site path for uncaught urls
41+
* @return string|null If set, default site path for uncaught urls
4242
* */
43-
function valet_fallback_site_path($config)
43+
function valet_default_site_path($config)
4444
{
45-
if (isset($config['fallback']) && is_string($config['fallback']) && is_dir($config['fallback'])) {
46-
return $config['fallback'];
45+
if (isset($config['default']) && is_string($config['default']) && is_dir($config['default'])) {
46+
return $config['default'];
4747
}
4848

4949
return null;
@@ -91,7 +91,7 @@ function valet_fallback_site_path($config)
9191
}
9292
}
9393

94-
if (is_null($valetSitePath) && is_null($valetSitePath = valet_fallback_site_path($valetConfig))) {
94+
if (is_null($valetSitePath) && is_null($valetSitePath = valet_default_site_path($valetConfig))) {
9595
show_valet_404();
9696
}
9797

0 commit comments

Comments
 (0)