Skip to content

Commit

Permalink
Fixed Nginx installation problems, cleaned up total 0 output and upda…
Browse files Browse the repository at this point in the history
…ted readme and updates accordingly.
  • Loading branch information
cpriego committed Feb 7, 2017
1 parent 0c9ba76 commit 520b57b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
7 changes: 2 additions & 5 deletions cli/Valet/Nginx.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function install()
$this->files->ensureDirExists('/etc/nginx/sites-available');
$this->files->ensureDirExists('/etc/nginx/sites-enabled');

$this->stop();
$this->installConfiguration();
$this->installServer();
$this->installNginxDirectory();
Expand Down Expand Up @@ -141,11 +142,7 @@ function restart()
*/
function stop()
{
try {
$this->sm->stop('nginx');
} catch (DomainException $e) {
// Ignore if nginx is not installed
}
$this->sm->stop('nginx');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion cli/Valet/Valet.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Valet

var $valetBin = '/usr/local/bin/valet';
var $sudoers = '/etc/sudoers.d/valet';
var $github = 'https://api.github.com/repos/cpriego/valet-ubuntu/releases/latest';
var $github = 'https://api.github.com/repos/cpriego/valet-linux/releases/latest';

/**
* Create a new Valet instance.
Expand Down
5 changes: 2 additions & 3 deletions cli/valet.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
Container::setInstance(new Container);

$version = '2.0.3';
$version = '2.0.4';

$app = new Application('Valet', $version);

Expand All @@ -41,7 +41,6 @@
$app->command('install [--ignore-selinux]', function ($ignoreSELinux) {
Requirements::setIgnoreSELinux($ignoreSELinux)->check();
Configuration::install();
Nginx::stop();
Nginx::install();
PhpFpm::install();
DnsMasq::install();
Expand Down Expand Up @@ -113,7 +112,7 @@
* Display all of the registered symbolic links.
*/
$app->command('links', function () {
passthru('ls -la '.VALET_HOME_PATH.'/Sites');
passthru('ls -lh '.VALET_HOME_PATH.'/Sites');
})->descriptions('Display all of the registered Valet links');

/**
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ After upgrading, it may be necessary to re-park or re-link your sites.

## Requirements
- PHP >= 5.6
- Ubuntu (and derivates) OR Fedora (and derivates)
- PHP Packages: `php*-cli php*-curl php*-mbstring php*-mcrypt php*-xml php*-zip`
- Optional PHP Packages: `php*-sqlite3 php*-mysql php*-pgsql`

**Replace the star _(*)_ with your php version**

### Ubuntu
- Ubuntu >= 14.04
- Ubuntu
- Dependencies: `sudo apt-get install libnss3-tools jq xsel`

Regarding the **supported** Ubuntu version:
Expand Down
4 changes: 3 additions & 1 deletion tests/NginxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public function test_install_calls_the_right_methods()
$site = Mockery::mock(Site::class);
$conf = Mockery::mock(Configuration::class);
$cli = Mockery::mock(CommandLine::class);
$sm = Mockery::mock(ServiceManager::class);

$files = Mockery::mock(Filesystem::class);
$files->shouldReceive('ensureDirExists')->with('/etc/nginx/sites-available')->once();
Expand All @@ -40,6 +39,9 @@ public function test_install_calls_the_right_methods()
$pm = Mockery::mock(PackageManager::class);
$pm->shouldReceive('ensureInstalled')->with('nginx')->once();

$sm = Mockery::mock(ServiceManager::class);
$sm->shouldReceive('stop')->with('nginx')->once();

$nginx = Mockery::mock(Nginx::class.'[installConfiguration,installServer,installNginxDirectory]', [$pm, $sm, $cli, $files, $conf, $site]);

$nginx->shouldReceive('installConfiguration')->once();
Expand Down

0 comments on commit 520b57b

Please sign in to comment.