Skip to content

Commit 0fecea0

Browse files
committed
Connection config improvements + L11 support
1 parent 756175c commit 0fecea0

File tree

4 files changed

+30
-14
lines changed

4 files changed

+30
-14
lines changed

.github/workflows/run-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-22.04]
16-
php: [8.3, 8.2, 8.1]
17-
laravel: [10.*]
16+
php: [8.3, 8.2]
17+
laravel: [11.*, 10.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:
20+
- laravel: 11.*
21+
testbench: 9.*
2022
- laravel: 10.*
2123
testbench: 8.*
2224

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@ A package to write Shell scripts like Blade Components and run them locally or o
1717

1818
It's the *magic* of Inertia.js with the *simplicity* of Blade. [Splade](https://github.com/protonemedia/laravel-splade) provides a super easy way to build Single Page Applications using Blade templates. Besides that magic SPA-feeling, it comes with more than ten components to sparkle your app and make it interactive, all without ever leaving Blade.
1919

20-
## Want to see this package in action?
21-
22-
Check out [Eddy Server Management](https://github.com/protonemedia/eddy-server-management), our open-source solution for Server Provisioning and Zero-Downtime PHP Deployment!
23-
2420
## Installation
2521

26-
This package requires Laravel 10 and PHP 8.1 or higher. You can install the package via composer:
22+
This package requires Laravel 10 and PHP 8.2 or higher. You can install the package via composer:
2723

2824
```bash
2925
composer require protonemedia/laravel-task-runner

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.1|^8.2|^8.3",
20-
"illuminate/process": "^10.0",
19+
"php": "^8.2|^8.3",
20+
"illuminate/process": "^10.0|^11.0",
2121
"spatie/laravel-package-tools": "^1.13.0",
2222
"spatie/temporary-directory": "^2.1"
2323
},
@@ -27,7 +27,7 @@
2727
"require-dev": {
2828
"laravel/pint": "^1.0",
2929
"nunomaduro/collision": "^7.0",
30-
"orchestra/testbench": "^8.0",
30+
"orchestra/testbench": "^8.0|^9.0",
3131
"pestphp/pest": "^2.0",
3232
"pestphp/pest-plugin-laravel": "^2.0",
3333
"phpunit/phpunit": "^10.4"

src/Connection.php

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static function fromArray(array $config): static
7272
{
7373
$username = $config['username'] ?: '';
7474

75-
$scriptPath = $config['script_path'] ?: null;
75+
$scriptPath = $config['script_path'] ?? null;
7676

7777
if ($scriptPath) {
7878
$scriptPath = rtrim($scriptPath, '/');
@@ -90,18 +90,36 @@ public static function fromArray(array $config): static
9090
$privateKey = $privateKey();
9191
}
9292

93-
if (! $privateKey && array_key_exists('private_key_path', $config)) {
94-
$privateKey = file_get_contents($config['private_key_path']);
93+
$privateKeyPath = $config['private_key_path'] ?? null;
94+
95+
if (! $privateKey && $privateKeyPath) {
96+
$privateKey = file_get_contents($privateKeyPath);
9597
}
9698

97-
return new static(
99+
$instance = new static(
98100
host: $config['host'] ?: null,
99101
port: $config['port'] ?: null,
100102
username: $username ?: null,
101103
privateKey: $privateKey,
102104
scriptPath: $scriptPath,
103105
proxyJump: $config['proxy_jump'] ?? null,
104106
);
107+
108+
if ($privateKeyPath) {
109+
$instance->setPrivateKeyPath($privateKeyPath);
110+
}
111+
112+
return $instance;
113+
}
114+
115+
/**
116+
* Sets the path to the private key.
117+
*/
118+
public function setPrivateKeyPath(string $privateKeyPath): self
119+
{
120+
$this->privateKeyPath = $privateKeyPath;
121+
122+
return $this;
105123
}
106124

107125
/**

0 commit comments

Comments
 (0)