Changeset 29676
- Timestamp:
- 2015-01-09T13:10:56+13:00 (9 years ago)
- Location:
- main/trunk/package-kits/scripts
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/package-kits/scripts/perllib/Greenstone/Site.pm
r29675 r29676 10 10 11 11 our $VERSION = 1.00; 12 our @EXPORT = ( 'new', 'get_sites');12 our @EXPORT = ( ); 13 13 my $configTemplate; 14 14 … … 29 29 } 30 30 31 sub get {31 sub list { 32 32 ref shift and die "Static method called on object\n"; 33 33 my $sites = {}; … … 35 35 opendir DH, $dir or die "Could not open sites directory '$dir'\n"; 36 36 while (my $site = readdir DH) { 37 # skip hidden files and current/parent directory 38 $site =~ /^\./ and next; 39 # skip non-directories 40 -d "$dir/$site" or next; 37 41 # We don't really need to store anything more than the fact that the site exists 38 42 # So we just store nothing, which is enough to put the key in the hash … … 46 50 sub exists { 47 51 my $self = shift; 48 my $sites = get;52 my $sites = list; 49 53 return exists $sites->{$self->{name}}; 50 54 }
Note:
See TracChangeset
for help on using the changeset viewer.