| 1 | # -*- perl -*- | ||||||||||
| 2 | |||||||||||
| 3 | # | ||||||||||
| 4 | # $Id: IndexerLive.pm,v 1.3 2005/03/13 17:33:31 cmuellermeta Exp $ | ||||||||||
| 5 | # Author: Slaven Rezic | ||||||||||
| 6 | # | ||||||||||
| 7 | # Copyright (C) 2004 Slaven Rezic. All rights reserved. | ||||||||||
| 8 | # This package is free software; you can redistribute it and/or | ||||||||||
| 9 | # modify it under the same terms as Perl itself. | ||||||||||
| 10 | # | ||||||||||
| 11 | # Mail: slaven@rezic.de | ||||||||||
| 12 | # WWW: http://www.rezic.de/eserte/ | ||||||||||
| 13 | # | ||||||||||
| 14 | |||||||||||
| 15 | package WebEditor::OldFeatures::IndexerLive; | ||||||||||
| 16 | |||||||||||
| 17 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | 1 | ▶ | use vars qw($VERSION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | 1 | $VERSION = sprintf("%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/); | |||||||||
| 20 | |||||||||||
| 21 | 1 | ▶ | use mixin::with "WebEditor::OldController"; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 22 | |||||||||||
| 23 | 0 | ▶ | sub run_live_indexer { | ||||||||
|
Subroutine
run_live_indexer: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 24 | 0 | require File::Basename; | |||||||||
| 25 | 0 | require File::Spec; | |||||||||
| 26 | 0 | my $self = shift; | |||||||||
| 27 | 0 | my $c = $self->C; | |||||||||
| 28 | 0 | my $liveuser=$c->staging->user; | |||||||||
| 29 | |||||||||||
| 30 | 0 | my @cmd; | |||||||||
| 31 | |||||||||||
| 32 | 0 | ▶ | unless ("$liveuser"){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | 0 | print "creating Live Index for localhost...<br>\n"; | |||||||||
| 34 | 0 | @cmd = (File::Spec->catfile(File::Basename::dirname($c->staging->directory), "etc", "run_indexer")); | |||||||||
| 35 | |||||||||||
| 36 | }else{ | ||||||||||
| 37 | 0 | print "creating Live Index for remote host...<br>\n"; | |||||||||
| 38 | 0 | my @cmd = (qw(ssh -l) , $c->staging->user, | |||||||||
| 39 | $c->staging->host, | ||||||||||
| 40 | File::Spec->catfile(File::Basename::dirname($c->staging->directory), | ||||||||||
| 41 | "etc", "run_indexer"), | ||||||||||
| 42 | ); | ||||||||||
| 43 | } | ||||||||||
| 44 | 0 | print "<pre>"; | |||||||||
| 45 | 0 | print "Run: @cmd\n"; | |||||||||
| 46 | 0 | system(@cmd); | |||||||||
| 47 | 0 | print "Exit code: $?\n"; | |||||||||
| 48 | 0 | print "</pre>"; | |||||||||
| 49 | } | ||||||||||
| 50 | |||||||||||
| 51 | 1 | 1; | |||||||||
| 52 | |||||||||||
| 53 | __END__ | ||||||||||