API:EPrints/Config

From EPrints Documentation
Revision as of 14:56, 30 July 2013 by Tdb01r (talk | contribs)
Jump to: navigation, search

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


API: Core API

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


NAME

EPrints::Config - software configuration handler


DESCRIPTION

This module handles loading the main configuration for an instance of the eprints software - such as the list of language id's and the top level configurations for repositories - the XML files in /archives/


METHODS

Deprecated Methods

EPrints::Config::abort

Deprecated, use EPrints::abort.

EPrints::Config::get_archive_config
EPrints::Config::get_archive_ids
EPrints::Config::load_archive_config_module

Deprecated, use *_repository_*.


Normal Methods

EPrints::Config::init()

Load the EPrints configuration.

Do not use this method directly, it will be automatically called when using EPrints.

Defines the following configuration properties:

  cgi_path /cgi
  cfg_path /cfg
  lib_path /lib
  arc_path /archives
  bin_path /bin
  var_path /var
EPrints::Config::load_system_config()

Load the system configuration files.

Configuration files are loaded in order from (later files with the same name will be ignored):

  /cfg/cfg.d
  /lib/syscfg.d
$conf = EPrints::Config::system_config()

Returns the system configuration variable. To access a specific configuration option use get.

$repository = EPrints::Config::get_repository_config( $id )

Returns a hash of the basic configuration for the repository with the given id. This hash will include the properties from SystemSettings.

@ids = EPrints::Config::get_repository_ids()

Return a list of ids of all repositories belonging to this instance of the eprints software.

$arc_conf = EPrints::Config::load_repository_config_module( $id )

Load the full configuration for the specified repository.

Returns a reference to a hash containing the full repository configuration.

Configuration files are loaded in order from (later files with the same name will be ignored):

  archives/[archiveid]/cfg/cfg.d
  site_lib/cfg.d
  lib/cfg.d

Defines the following configuration properties:

  archiveroot    archives/[archiveid]
  documents_path archives/[archiveid]/documents
  config_path    archives/[archiveid]/cfg
  htdocs_path    archives/[archiveid]/html
  cgi_path       archives/[archiveid]/cgi
$value = EPrints::Config::get( $confitem )

Return the value of a given eprints configuration item. These values are obtained from SystemSettings plus a few extras for paths.

$ok = EPrints::Config::write_config( $dest, $names, $values )

Write name-value pairs to a configuration file $dest (overwriting any existing data). This uses EPrints::Dumper to serialise the passed Perl structures.


COPYRIGHT

Copyright 2000-2011 University of Southampton.

This file is part of EPrints http://www.eprints.org/.

EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with EPrints. If not, see http://www.gnu.org/licenses/.