Newer
Older
Digital_Repository / OARiNZ / DIY / deb_package / eprints-3.0 / cgi / counter
nstanger on 7 Jun 2007 1 KB - Added debian package source.
  1. ######################################################################
  2. #
  3. # Show the number of eprints currently in the repository
  4. #
  5. # Used for remote monitoring of repository growth. eg. by
  6. # software.eprints.org
  7. #
  8. ######################################################################
  9. #
  10. # This file is part of GNU EPrints 2.
  11. #
  12. # Copyright (c) 2000-2004 University of Southampton, UK. SO17 1BJ.
  13. #
  14. # EPrints 2 is free software; you can redistribute it and/or modify
  15. # it under the terms of the GNU General Public License as published by
  16. # the Free Software Foundation; either version 2 of the License, or
  17. # (at your option) any later version.
  18. #
  19. # EPrints 2 is distributed in the hope that it will be useful,
  20. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. # GNU General Public License for more details.
  23. #
  24. # You should have received a copy of the GNU General Public License
  25. # along with EPrints 2; if not, write to the Free Software
  26. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  27. #
  28. ######################################################################
  29.  
  30. use EPrints;
  31.  
  32.  
  33. use strict;
  34.  
  35. my $session = new EPrints::Session;
  36. exit( 0 ) unless( defined $session );
  37.  
  38. $session->send_http_header( content_type=>"text/plain" );
  39.  
  40. my @ds_ids = &EPrints::DataSet::get_sql_dataset_ids;
  41. push @ds_ids, qw/ inbox buffer deletion archive /;
  42. foreach my $ds_id ( sort @ds_ids )
  43. {
  44. my $ds = $session->get_repository->get_dataset( $ds_id );
  45. print $ds_id.": ".$ds->count( $session )."\n";
  46. }
  47. print "version: ".$EPrints::SystemSettings::conf->{"version_id"}." (".$EPrints::SystemSettings::conf->{"version"}.")\n";
  48.  
  49. $session->terminate();
  50. exit;
  51.