File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55interface 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 *
Original file line number Diff line number Diff 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 *
You can’t perform that action at this time.
0 commit comments