summaryrefslogtreecommitdiffstats
path: root/provision.inc
diff options
context:
space:
mode:
authorSteven Jones2011-10-28 20:21:32 (GMT)
committerSteven Jones2011-10-28 20:21:32 (GMT)
commit9ee9e1a36314478ea34f2f651342812f61a3c621 (patch)
tree6fdce4e540544976509ea5a7d99160f146f6b843 /provision.inc
parent3f2403b1683fe2e583137891a64bedee2ffa93b3 (diff)
Move provisionChainedState out to an autoload.
Diffstat (limited to 'provision.inc')
-rw-r--r--provision.inc74
1 files changed, 0 insertions, 74 deletions
diff --git a/provision.inc b/provision.inc
index fbe3a9f..1df4520 100644
--- a/provision.inc
+++ b/provision.inc
@@ -419,80 +419,6 @@ function provision_version_parts() {
return explode('.', $version);
}
-/**
- * A base class for the service and file handling classes that implements
- * chaining of methods.
- */
-class provisionChainedState {
- protected $last_status;
- protected $tokens;
-
- /**
- * Clear internal state
- */
- protected function _clear_state() {
- $this->last_status = NULL;
- $this->tokens = NULL;
- }
-
- /**
- * Return the status of the last operation.
- *
- * @return
- * TRUE or FALSE for success or failure; NULL if there was not a previous
- * operation.
- */
- function status() {
- return $this->last_status;
- }
-
- /**
- * Log a notice into the logging system, if the last operation completed
- * succesfully.
- *
- * @param $message
- * The message to log, a string.
- */
- function succeed($message) {
- if ($this->last_status === TRUE) {
- drush_log(dt($message, $this->tokens), 'message');
- }
-
- return $this;
- }
-
- /**
- * Log a notice into the logging system, if the last operation did not
- * complete succesfully.
- *
- * @param $message
- * Log this as a error to the logging system, if the $error_codes parameter
- * has been set, otherwise, log this as a warning. If the operation
- * specifies an additional reason for the operation failing, it will be
- * appended to this message.
- *
- * @param error_codes
- * Generate these system level errors using the provision error bitmasks.
- */
- function fail($message, $error_codes = NULL) {
- if (!empty($this->tokens['@reason'])) {
- $message .= ' (@reason)';
- }
- if ($this->last_status === FALSE) {
- if (is_null($error_codes)) {
- // Trigger a warning
- drush_log(dt($message, $this->tokens), 'warning');
- }
- else {
- // Trigger a sysem halting error
- drush_set_error($error_codes, dt($message, $this->tokens));
- }
- }
-
- return $this;
- }
-}
-
// Base class for provision exceptions.
class provisionException extends Exception {