From 7276276ba24290ba8486580a26b4cf5c8f5b70cc Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Mon, 1 Apr 2013 16:50:18 +0000 Subject: [PATCH] scripts/shells/shell.php: - implement "update" for all *Handler classes by using CliEdit class (yes, it's really that easy ;-) This gives us a working *) CLI for "update" in interactive and non-interactive mode. *) TODO: test if everything works ;-) git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1447 a1433add-5e2c-0410-b055-b7f2511e0802 --- scripts/shells/shell.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/shells/shell.php b/scripts/shells/shell.php index 891663f5..32f608da 100644 --- a/scripts/shells/shell.php +++ b/scripts/shells/shell.php @@ -207,7 +207,7 @@ if ( empty($this->params['q'] ) ) { $taskClass = Inflector::camelize($taskName.'Task'); $taskKey = Inflector::underscore($taskClass); - if ($taskName == 'Add') { + if ($taskName == 'Add' || $taskName == 'Update') { $taskClass = 'CliEdit'; } elseif (!class_exists($taskClass)) { @@ -230,6 +230,9 @@ if ( empty($this->params['q'] ) ) { if ($taskName == 'Add') { $this->{$taskName}->handler_to_use = ucfirst($this->shell) . 'Handler'; $this->{$taskName}->new = 1; + } elseif ($taskName == 'Update') { + $this->{$taskName}->handler_to_use = ucfirst($this->shell) . 'Handler'; + $this->{$taskName}->new = 0; } if (!isset($this->{$taskName})) {