| 1 | package DBIx::dbMan::Extension::Fallback; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use base 'DBIx::dbMan::Extension'; | ||
| 5 | |||
| 6 | our $VERSION = '0.05'; | ||
| 7 | |||
| 8 | 1; | ||
| 9 | |||
| 10 | sub IDENTIFICATION { return "000001-000002-000005"; } | ||
| 11 | |||
| 12 | sub preference { return -99999; } | ||
| 13 | |||
| 14 | sub handle_action { | ||
| 15 | my ($obj,%action) = @_; | ||
| 16 | |||
| 17 | $action{processed} = 1; | ||
| 18 | |||
| 19 | $action{action} = 'NONE' if $action{action} eq 'IDLE'; | ||
| 20 | |||
| 21 | # Not handled command | ||
| 22 | if ($action{action} eq 'COMMAND') { | ||
| 23 | $action{action} = 'OUTPUT'; | ||
| 24 | $action{output} = ''; | ||
| 25 | $obj->{-interface}->error( "Unknown command (".$action{cmd}.")." ); | ||
| 26 | delete $action{processed}; | ||
| 27 | } elsif (not $action{action}) { # internal - incorrect handling of action | ||
| 28 | $obj->{-interface}->print("INTERNAL: Action not correctly handled by some extension!\n"); | ||
| 29 | } elsif ($action{action} ne 'NONE' and $action{action} ne 'QUIT') { # internal - action not handled | ||
| 30 | $obj->{-interface}->print("INTERNAL: Not handled action $action{action}.\n"); | ||
| 31 | $action{action} = 'NONE'; | ||
| 32 | } | ||
| 33 | |||
| 34 | return %action; | ||
| 35 | } |