-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scheduled commands may now implement ScheduledCommandInterface
- Loading branch information
Ben Kuhl
committed
Mar 24, 2014
1 parent
d5290df
commit 3add68a
Showing
5 changed files
with
47 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* @author Ben Kuhl <[email protected]> | ||
*/ | ||
namespace Indatus\Dispatcher; | ||
|
||
interface ScheduledCommandInterface | ||
{ | ||
/** | ||
* User to run the command as | ||
* @return string Defaults to false to run as default user | ||
*/ | ||
public function user(); | ||
|
||
/** | ||
* When a command should run | ||
* @param Schedulable $scheduler | ||
* @return \Indatus\Dispatcher\Schedulable | ||
*/ | ||
public function schedule(Schedulable $scheduler); | ||
|
||
/** | ||
* Environment(s) under which the given command should run | ||
* Defaults to '*' for all environments | ||
* @return string | ||
*/ | ||
public function environment(); | ||
|
||
/** | ||
* Checks whether the command is enabled or not in the current environment | ||
* Override this to check for x or y and return false if the command can not | ||
* run properly under the current conditions. | ||
* @return Boolean | ||
*/ | ||
public function isEnabled(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters