Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2533fae

Browse files
committed
Work on remote connection interface and implementation.
1 parent 6d02776 commit 2533fae

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

src/Illuminate/Remote/ConnectionInterface.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@
44

55
interface ConnectionInterface {
66

7+
/**
8+
* Define a set of commands as a task.
9+
*
10+
* @param string $task
11+
* @param string|array $commands
12+
* @return void
13+
*/
14+
public function define($task, $commands);
15+
16+
/**
17+
* Run a task against the connection.
18+
*
19+
* @param string $task
20+
* @param \Closure $callback
21+
* @return void
22+
*/
23+
public function task($task, Closure $callback = null);
24+
725
/**
826
* Run a set of commands against the connection.
927
*

src/Illuminate/Remote/MultiConnection.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,36 @@ public function __construct(array $connections)
2222
$this->connections = $connections;
2323
}
2424

25+
/**
26+
* Define a set of commands as a task.
27+
*
28+
* @param string $task
29+
* @param string|array $commands
30+
* @return void
31+
*/
32+
public function define($task, $commands)
33+
{
34+
foreach ($this->connections as $conection)
35+
{
36+
$connection->define($task, $commands);
37+
}
38+
}
39+
40+
/**
41+
* Run a task against the connection.
42+
*
43+
* @param string $task
44+
* @param \Closure $callback
45+
* @return void
46+
*/
47+
public function task($task, Closure $callback = null)
48+
{
49+
foreach ($this->connections as $connection)
50+
{
51+
$connection->task($task, $callback);
52+
}
53+
}
54+
2555
/**
2656
* Run a set of commands against the connection.
2757
*

0 commit comments

Comments
 (0)