@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Faker\Generator as Faker; |
| 4 | 4 | |
| 5 | -$factory->define(\App\Models\Setting::class, function (Faker $faker) { |
|
| 5 | +$factory->define(\App\Models\Setting::class, function(Faker $faker) { |
|
| 6 | 6 | return [ |
| 7 | 7 | 'name' => $faker->word, |
| 8 | 8 | 'value' => $faker->word, |
@@ -2,11 +2,11 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Faker\Generator as Faker; |
| 4 | 4 | |
| 5 | -$factory->define(\App\Models\Site::class, function (Faker $faker) { |
|
| 5 | +$factory->define(\App\Models\Site::class, function(Faker $faker) { |
|
| 6 | 6 | return [ |
| 7 | 7 | 'name' => $faker->word, |
| 8 | 8 | 'nginx_conf' => 'default', |
| 9 | - 'php_version_id' => function () { |
|
| 9 | + 'php_version_id' => function() { |
|
| 10 | 10 | return factory(\App\Models\PhpVersion::class)->create()->id; |
| 11 | 11 | }, |
| 12 | 12 | 'secure' => false, |
@@ -2,14 +2,14 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Faker\Generator as Faker; |
| 4 | 4 | |
| 5 | -$factory->define(\App\Models\PhpVersion::class, function (Faker $faker) { |
|
| 5 | +$factory->define(\App\Models\PhpVersion::class, function(Faker $faker) { |
|
| 6 | 6 | return [ |
| 7 | 7 | 'version_number' => $faker->randomElement(['5.6', '7.0', '7.1', '7.2']), |
| 8 | 8 | 'default' => 'false', |
| 9 | 9 | ]; |
| 10 | 10 | }); |
| 11 | 11 | |
| 12 | -$factory->state(\App\Models\PhpVersion::class, 'default', function ($faker) { |
|
| 12 | +$factory->state(\App\Models\PhpVersion::class, 'default', function($faker) { |
|
| 13 | 13 | return [ |
| 14 | 14 | 'default' => true, |
| 15 | 15 | ]; |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('php_versions', function (Blueprint $table) { |
|
| 16 | + Schema::create('php_versions', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('version_number'); |
| 19 | 19 | $table->boolean('default'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('settings', function (Blueprint $table) { |
|
| 16 | + Schema::create('settings', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('name'); |
| 19 | 19 | $table->string('value'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('sites', function (Blueprint $table) { |
|
| 16 | + Schema::create('sites', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('name'); |
| 19 | 19 | $table->string('nginx_conf'); |
@@ -132,16 +132,16 @@ |
||
| 132 | 132 | // Build up docker-compose again - so we pick up any new PHP containers to be used |
| 133 | 133 | $this->compose(); |
| 134 | 134 | |
| 135 | - if (! $this->isUp()) { |
|
| 135 | + if (!$this->isUp()) { |
|
| 136 | 136 | return; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | PhpVersion::active() |
| 140 | 140 | ->get() |
| 141 | - ->reject(function ($phpVersion) { |
|
| 141 | + ->reject(function($phpVersion) { |
|
| 142 | 142 | return $this->isUp($phpVersion->fpm_name); |
| 143 | 143 | }) |
| 144 | - ->each(function ($phpVersion) { |
|
| 144 | + ->each(function($phpVersion) { |
|
| 145 | 145 | $this->start($phpVersion->fpm_name); |
| 146 | 146 | $this->start($phpVersion->cli_name); |
| 147 | 147 | }); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function boot(): void |
| 21 | 21 | { |
| 22 | - view()->getFinder()->prependLocation(config('porter.library_path').'/views'); |
|
| 22 | + view()->getFinder()->prependLocation(config('porter.library_path') . '/views'); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -27,22 +27,22 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function register(): void |
| 29 | 29 | { |
| 30 | - $this->app->singleton(ServerBag::class, function () { |
|
| 30 | + $this->app->singleton(ServerBag::class, function() { |
|
| 31 | 31 | return new ServerBag; |
| 32 | 32 | }); |
| 33 | - $this->app->bind(CliContract::class, function () { |
|
| 33 | + $this->app->bind(CliContract::class, function() { |
|
| 34 | 34 | return new Cli; |
| 35 | 35 | }); |
| 36 | - $this->app->bind(ImageSetRepositoryContract::class, function () { |
|
| 37 | - return (new ImageSetRepository)->addLocation(config('porter.library_path').'/docker'); |
|
| 36 | + $this->app->bind(ImageSetRepositoryContract::class, function() { |
|
| 37 | + return (new ImageSetRepository)->addLocation(config('porter.library_path') . '/docker'); |
|
| 38 | 38 | }); |
| 39 | 39 | |
| 40 | 40 | $this->app->singleton(Porter::class); |
| 41 | 41 | $this->app->singleton(ConsoleWriter::class); |
| 42 | - $this->app->singleton(CertificateBuilder::class, function () { |
|
| 42 | + $this->app->singleton(CertificateBuilder::class, function() { |
|
| 43 | 43 | return new CertificateBuilder(config('porter.library_path') . '/ssl'); |
| 44 | 44 | }); |
| 45 | 45 | |
| 46 | - $this->publishes([resource_path('stubs/config') => config('porter.library_path').'/config']); |
|
| 46 | + $this->publishes([resource_path('stubs/config') => config('porter.library_path') . '/config']); |
|
| 47 | 47 | } |
| 48 | 48 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | $this->oName = 'Klever Porter CA Self Signed Organization'; |
| 20 | 20 | $this->cName = 'Klever Porter CA Self Signed CN'; |
| 21 | 21 | $this->domain = 'klever.porter'; |
| 22 | - $this->email = 'rootcertificate@'.$this->domain; |
|
| 22 | + $this->email = 'rootcertificate@' . $this->domain; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | public function caPaths() |
| 31 | 31 | { |
| 32 | 32 | return (object) [ |
| 33 | - 'key' => $this->certificatesPath.'/KleverPorterSelfSigned.key', |
|
| 34 | - 'pem' => $this->certificatesPath.'/KleverPorterSelfSigned.pem', |
|
| 35 | - 'srl' => $this->certificatesPath.'/KleverPorterCASelfSigned.srl', |
|
| 33 | + 'key' => $this->certificatesPath . '/KleverPorterSelfSigned.key', |
|
| 34 | + 'pem' => $this->certificatesPath . '/KleverPorterSelfSigned.pem', |
|
| 35 | + 'srl' => $this->certificatesPath . '/KleverPorterCASelfSigned.srl', |
|
| 36 | 36 | ]; |
| 37 | 37 | } |
| 38 | 38 | |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | public function paths($url) |
| 46 | 46 | { |
| 47 | 47 | return (object) [ |
| 48 | - 'key' => $this->certificatesPath.'/'.$url.'.key', |
|
| 49 | - 'csr' => $this->certificatesPath.'/'.$url.'.csr', |
|
| 50 | - 'crt' => $this->certificatesPath.'/'.$url.'.crt', |
|
| 51 | - 'conf' => $this->certificatesPath.'/'.$url.'.conf', |
|
| 48 | + 'key' => $this->certificatesPath . '/' . $url . '.key', |
|
| 49 | + 'csr' => $this->certificatesPath . '/' . $url . '.csr', |
|
| 50 | + 'crt' => $this->certificatesPath . '/' . $url . '.crt', |
|
| 51 | + 'conf' => $this->certificatesPath . '/' . $url . '.conf', |
|
| 52 | 52 | ]; |
| 53 | 53 | } |
| 54 | 54 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | { |
| 160 | 160 | exec(sprintf( |
| 161 | 161 | 'openssl req -new -key %s -out %s -subj "/C=GB/ST=Berks/O=%s/localityName=Reading/commonName=%s/organizationalUnitName=Developers/emailAddress=%s%s/" -config %s', |
| 162 | - $keyPath, $csrPath, $this->domain, $url, $url, '@'.$this->domain, $confPath |
|
| 162 | + $keyPath, $csrPath, $this->domain, $url, $url, '@' . $this->domain, $confPath |
|
| 163 | 163 | )); |
| 164 | 164 | } |
| 165 | 165 | |
@@ -177,9 +177,9 @@ discard block |
||
| 177 | 177 | continue; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - $current = $this->certificatesPath.'/'.$item; |
|
| 180 | + $current = $this->certificatesPath . '/' . $item; |
|
| 181 | 181 | |
| 182 | - if (! $dropCA && in_array($current, $caPaths)) { |
|
| 182 | + if (!$dropCA && in_array($current, $caPaths)) { |
|
| 183 | 183 | continue; |
| 184 | 184 | } |
| 185 | 185 | |