Skip to content

Commit

Permalink
Merge pull request #246 from nikazooz/fix-installation
Browse files Browse the repository at this point in the history
Fix various issues
  • Loading branch information
jmarcher authored Dec 2, 2019
2 parents 14876df + 3896d65 commit 534b0c4
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions cli/valet.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/**
* Allow Valet to be run more conveniently by allowing the Node proxy to run password-less sudo.
*/
$app->command('install [--ignore-selinux]', static function ($ignoreSELinux) {
$app->command('install [--ignore-selinux]', function ($ignoreSELinux) {
passthru(dirname(__FILE__) . '/scripts/update.sh'); // Clean up cruft

Requirements::setIgnoreSELinux($ignoreSELinux)->check();
Expand Down Expand Up @@ -59,7 +59,7 @@
/**
* Get or set the domain currently being used by Valet.
*/
$app->command('domain [domain]', static function ($domain = null) {
$app->command('domain [domain]', function ($domain = null) {
if ($domain === null) {
return info(Configuration::read()['domain']);
}
Expand All @@ -79,7 +79,7 @@
/**
* Get or set the port number currently being used by Valet.
*/
$app->command('port [port] [--https]', static function ($port = null, $https = false) {
$app->command('port [port] [--https]', function ($port = null, $https) {
if ($port === null) {
info('Current Nginx port (HTTP): ' . Configuration::get('port', 80));
info('Current Nginx port (HTTPS): ' . Configuration::get('https_port', 443));
Expand Down Expand Up @@ -108,7 +108,7 @@
/**
* Determine if the site is secured or not
*/
$app->command('secured [site]', static function ($site) {
$app->command('secured [site]', function ($site) {
if (Site::secured()->contains($site)) {
info("{$site} is secured.");

Expand All @@ -123,7 +123,7 @@
/**
* Add the current working directory to the paths configuration.
*/
$app->command('park [path]', static function ($path = null) {
$app->command('park [path]', function ($path = null) {
Configuration::addPath($path ?: getcwd());

info(($path === null ? "This" : "The [{$path}]") . " directory has been added to Valet's paths.");
Expand All @@ -132,7 +132,7 @@
/**
* Remove the current working directory from the paths configuration.
*/
$app->command('forget [path]', static function ($path = null) {
$app->command('forget [path]', function ($path = null) {
Configuration::removePath($path ?: getcwd());

info(($path === null ? "This" : "The [{$path}]") . " directory has been removed from Valet's paths.");
Expand All @@ -149,7 +149,7 @@
/**
* Register a symbolic link with Valet.
*/
$app->command('link [name]', static function ($name) {
$app->command('link [name]', function ($name) {
$linkPath = Site::link(getcwd(), $name = $name ?: basename(getcwd()));

info('A [' . $name . '] symbolic link has been created in [' . $linkPath . '].');
Expand All @@ -158,7 +158,7 @@
/**
* Display all of the registered symbolic links.
*/
$app->command('links', static function () {
$app->command('links', function () {
$links = Site::links();

table(['Site', 'SSL', 'URL', 'Path'], $links->all());
Expand All @@ -167,7 +167,7 @@
/**
* Unlink a link from the Valet links directory.
*/
$app->command('unlink [name]', static function ($name) {
$app->command('unlink [name]', function ($name) {
Site::unlink($name = $name ?: basename(getcwd()));

info('The [' . $name . '] symbolic link has been removed.');
Expand All @@ -176,7 +176,7 @@
/**
* Secure the given domain with a trusted TLS certificate.
*/
$app->command('secure [domain]', static function ($domain = null) {
$app->command('secure [domain]', function ($domain = null) {
$url = ($domain ?: Site::host(getcwd())) . '.' . Configuration::read()['domain'];

Site::secure($url);
Expand All @@ -189,7 +189,7 @@
/**
* Stop serving the given domain over HTTPS and remove the trusted TLS certificate.
*/
$app->command('unsecure [domain]', static function ($domain = null) {
$app->command('unsecure [domain]', function ($domain = null) {
$url = ($domain ?: Site::host(getcwd())) . '.' . Configuration::read()['domain'];

Site::unsecure($url);
Expand All @@ -202,7 +202,7 @@
/**
* Determine which Valet driver the current directory is using.
*/
$app->command('which', static function () {
$app->command('which', function () {
require __DIR__ . '/drivers/require.php';

$driver = ValetDriver::assign(getcwd(), basename(getcwd()), '/');
Expand All @@ -217,7 +217,7 @@
/**
* Display all of the registered paths.
*/
$app->command('paths', static function () {
$app->command('paths', function () {
$paths = Configuration::read()['paths'];

if (count($paths) > 0) {
Expand All @@ -230,7 +230,7 @@
/**
* Open the current directory in the browser.
*/
$app->command('open [domain]', static function ($domain = null) {
$app->command('open [domain]', function ($domain = null) {
$url = 'http://' . ($domain ?: Site::host(getcwd())) . '.' . Configuration::read()['domain'] . '/';

passthru('xdg-open ' . escapeshellarg($url));
Expand All @@ -239,21 +239,21 @@
/**
* Generate a publicly accessible URL for your project.
*/
$app->command('share', static function () {
$app->command('share', function () {
warning("It looks like you are running `cli/valet.php` directly, please use the `valet` script in the project root instead.");
})->descriptions('Generate a publicly accessible URL for your project');

/**
* Echo the currently tunneled URL.
*/
$app->command('fetch-share-url', static function () {
$app->command('fetch-share-url', function () {
output(Ngrok::currentTunnelUrl());
})->descriptions('Get the URL to the current Ngrok tunnel');

/**
* Start the daemon services.
*/
$app->command('start', static function () {
$app->command('start', function () {
PhpFpm::restart();
Nginx::restart();

Expand All @@ -263,7 +263,7 @@
/**
* Restart the daemon services.
*/
$app->command('restart', static function () {
$app->command('restart', function () {
PhpFpm::restart();
Nginx::restart();

Expand All @@ -273,7 +273,7 @@
/**
* Stop the daemon services.
*/
$app->command('stop', static function () {
$app->command('stop', function () {
PhpFpm::stop();
Nginx::stop();

Expand All @@ -283,7 +283,7 @@
/**
* Uninstall Valet entirely.
*/
$app->command('uninstall', static function () {
$app->command('uninstall', function () {
Nginx::uninstall();
PhpFpm::uninstall();
DnsMasq::uninstall();
Expand All @@ -296,7 +296,7 @@
/**
* Determine if this is the latest release of Valet.
*/
$app->command('update', static function () use ($version) {
$app->command('update', function () use ($version) {
$script = dirname(__FILE__) . '/scripts/update.sh';

if (Valet::onLatestVersion($version)) {
Expand All @@ -312,7 +312,7 @@
/**
* Change the PHP version to the desired one.
*/
$app->command('use [preferedversion]', static function ($preferedversion = null) {
$app->command('use [preferedversion]', function ($preferedversion = null) {
info('Changing php-fpm version...');
info('This does not affect php -v.');
PhpFpm::changeVersion($preferedversion);
Expand Down

0 comments on commit 534b0c4

Please sign in to comment.