Difference between revisions of "API:EPrints/Config"

From EPrints Documentation
Jump to: navigation, search
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<!-- Pod2Wiki=_preamble_  
 
<!-- Pod2Wiki=_preamble_  
This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost.
+
This page has been automatically generated from the EPrints 3.4 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost.
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=perl_lib/EPrints/Config.pm|package_name=EPrints::Config}}[[Category:API|CONFIG]][[Category:API:EPrints/Config|CONFIG]]<div><!-- Edit below this comment -->
+
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=EPrints/Config.pm|package_name=EPrints::Config}}[[Category:API|CONFIG]]<div><!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name -->
 
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name -->
 
==NAME==
 
==NAME==
'''EPrints::Config''' - software configuration handler
+
'''EPrints::Config''' - Software configuration handler.
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 +
</div>
 
<!-- Pod2Wiki=head_description -->
 
<!-- Pod2Wiki=head_description -->
 
==DESCRIPTION==
 
==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/
+
This module handles loading the main configuration for an instance of the EPrints repository software. Such as the list of language IDs  and the top level configurations for repositories and the XML files for the archives.
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_methods -->
 +
==METHODS==
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 
<!-- Pod2Wiki=head_deprecated_methods -->
 
<!-- Pod2Wiki=head_deprecated_methods -->
 
===Deprecated Methods===
 
===Deprecated Methods===
* EPrints::Config::abort
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
: Deprecated, use [[API:EPrints|EPrints]]::abort.
+
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
  
* EPrints::Config::get_archive_config
 
* EPrints::Config::get_archive_ids
 
* EPrints::Config::load_archive_config_module
 
: Deprecated, use *_repository_*.
 
  
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_eprints_config_abort -->
 +
====eprints_config_abort====
 +
 +
EPrints::Config::abort
 +
Deprecated, use [[API:EPrints|EPrints]]::abort.
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_methods -->
+
</div>
==METHODS==
+
<!-- Pod2Wiki=item_eprints_config_get_archive_config -->
<!-- Pod2Wiki=head_init -->
+
====eprints_config_get_archive_config====
===init===
 
  
<source lang="perl">EPrints::Config::init()
+
EPrints::Config::get_archive_config
 +
Deprecated, use <em>get_repository_config</em>.
  
</source>
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Load the EPrints configuration.
+
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
  
Do not use this method directly, it will be automatically called when using EPrints.
 
  
Defines the following configuration properties:
+
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_eprints_config_get_archive_ids -->
 +
====eprints_config_get_archive_ids====
  
<pre> cgi_path /cgi
+
EPrints::Config::get_archive_ids
  cfg_path /cfg
+
Deprecated, use <em>get_repository_ids</em>.
  lib_path /lib
 
  arc_path /archives
 
  bin_path /bin
 
  var_path /var</pre>
 
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_load_system_config -->
+
</div>
===load_system_config===
+
<!-- Pod2Wiki=item_eprints_config_load_archive_config_module -->
 +
====eprints_config_load_archive_config_module====
  
<source lang="perl">EPrints::Config::load_system_config()
+
EPrints::Config::load_archive_config_module
 +
Deprecated, use <em>get_repository_config_module</em>.
  
</source>
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Load the system configuration files.
+
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
  
Configuration files are loaded in order from (later files with the same name will be ignored):
 
 
<pre>  /cfg/cfg.d
 
  /lib/syscfg.d</pre>
 
  
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_normal_methods -->
 +
===Normal Methods===
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_system_config -->
+
</div>
===system_config===
+
<!-- Pod2Wiki=item_init -->
 +
====init====
  
<source lang="perl">$conf = EPrints::Config::system_config()
+
EPrints::Config::init()
 +
Load the EPrints configuration.
  
</source>
+
Do not use this method directly, it will be automatically called when using EPrints.
Returns the system configuration variable. To access a specific configuration option use [[API:EPrints/Config#get|get]].
 
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_get_repository_config -->
+
</div>
===get_repository_config===
+
<!-- Pod2Wiki=item_load_system_config -->
 +
====load_system_config====
  
<source lang="perl">$repository = EPrints::Config::get_repository_config( $id )
+
EPrints::Config::load_system_config()
 
+
Load the system configuration files.
</source>
 
Returns a hash of the basic configuration for the repository with the given id. This hash will include the properties from SystemSettings.
 
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_get_repository_ids -->
+
</div>
===get_repository_ids===
+
<!-- Pod2Wiki=item_system_config -->
 +
====system_config====
  
<source lang="perl">@ids = EPrints::Config::get_repository_ids()
+
$conf = EPrints::Config::system_config()
 
+
Returns the system configuration variable. To access a specific  configuration option use [[API:EPrints/Config#get|get]].
</source>
 
Return a list of ids of all repositories belonging to this instance of the eprints software.
 
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_load_repository_config_module -->
+
</div>
===load_repository_config_module===
+
<!-- Pod2Wiki=item_get_repository_config -->
 +
====get_repository_config====
  
<source lang="perl">$arc_conf = EPrints::Config::load_repository_config_module( $id )
+
$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.
  
</source>
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Load the full configuration for the specified repository.
+
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
  
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):
+
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_get_repository_ids -->
 +
====get_repository_ids====
  
<pre> archives/[archiveid]/cfg/cfg.d
+
  @ids = EPrints::Config::get_repository_ids()
  site_lib/cfg.d
+
Return a list of ids of all repositories belonging to this instance of the EPrints repository software.
  lib/cfg.d</pre>
 
 
 
Defines the following configuration properties:
 
 
 
<pre>  archiveroot    archives/[archiveid]
 
  documents_path archives/[archiveid]/documents
 
  config_path    archives/[archiveid]/cfg
 
  htdocs_path    archives/[archiveid]/html
 
  cgi_path      archives/[archiveid]/cgi</pre>
 
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_get -->
+
</div>
===get===
+
<!-- Pod2Wiki=item_load_repository_config_module -->
 +
====load_repository_config_module====
  
<source lang="perl">$value = EPrints::Config::get( $confitem )
+
$arc_conf = EPrints::Config::load_repository_config_module( $id )
 +
Load the full configuration for the specified repository unless the  it has already been loaded.
  
</source>
+
Return a reference to a hash containing the full repository  configuration.  
Return the value of a given eprints configuration item. These values are obtained from SystemSettings plus a few extras for paths.
 
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_write_config -->
+
</div>
===write_config===
+
<!-- Pod2Wiki=item_get -->
 +
====get====
  
<source lang="perl">$ok = EPrints::Config::write_config( $dest, $names, $values )
+
$value = EPrints::Config::get( $confitem )
 
+
Return the value of a given eprints configuration item. These values  are obtained from [[API:EPrints/SystemSettings|EPrints::SystemSettings]] plus a few extras for paths.
</source>
 
Write name-value pairs to a configuration file $dest (overwriting any existing data). This uses [[API:EPrints/Dumper|EPrints::Dumper]] to serialise the passed Perl structures.
 
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 +
</div>
 
<!-- Pod2Wiki=head_copyright -->
 
<!-- Pod2Wiki=head_copyright -->
 
==COPYRIGHT==
 
==COPYRIGHT==
Copyright 2000-2011 University of Southampton.
+
{{API:Copyright}}
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #ccepadding: 0em 1em 0em 1em; font-size: 80%; '>
This file is part of EPrints http://www.eprints.org/.
+
<span style='display:none'>User Comments</span>
 
 
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/.
 
 
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=_postamble_ -->
+
</div>
<!-- Edit below this comment -->
+
<!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment -->

Latest revision as of 12:53, 4 March 2022

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.

User Comments


DESCRIPTION

This module handles loading the main configuration for an instance of the EPrints repository software. Such as the list of language IDs and the top level configurations for repositories and the XML files for the archives.

User Comments


METHODS

User Comments


Deprecated Methods

User Comments


eprints_config_abort

EPrints::Config::abort

Deprecated, use EPrints::abort.

User Comments


eprints_config_get_archive_config

EPrints::Config::get_archive_config

Deprecated, use get_repository_config.

User Comments


eprints_config_get_archive_ids

EPrints::Config::get_archive_ids

Deprecated, use get_repository_ids.

User Comments


eprints_config_load_archive_config_module

EPrints::Config::load_archive_config_module

Deprecated, use get_repository_config_module.

User Comments


Normal Methods

User Comments


init

EPrints::Config::init()

Load the EPrints configuration.

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

User Comments


load_system_config

EPrints::Config::load_system_config()

Load the system configuration files.

User Comments


system_config

$conf = EPrints::Config::system_config()

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

User Comments


get_repository_config

$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.

User Comments


get_repository_ids

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

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

User Comments


load_repository_config_module

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

Load the full configuration for the specified repository unless the it has already been loaded.

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

User Comments


get

$value = EPrints::Config::get( $confitem )

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

User Comments


COPYRIGHT

© Copyright 2000-2024 University of Southampton.

EPrints 3.4 is supplied by EPrints Services.

http://www.eprints.org/eprints-3.4/

LICENSE

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

EPrints 3.4 and this file are released under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation unless otherwise stated.

EPrints 3.4 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 3.4. If not, see http://www.gnu.org/licenses/.

User Comments