This commit is contained in:
Joshua Ferraro 2007-12-19 13:48:55 -06:00
commit de04e990f2
84 changed files with 1593 additions and 202 deletions

View File

@ -71,7 +71,7 @@ C4::Context - Maintain and manipulate the context of a Koha script
use C4::Context;
use C4::Context("/path/to/koha.xml");
use C4::Context("/path/to/koha-conf.xml");
$config_value = C4::Context->config("config_variable");
@ -86,7 +86,7 @@ C4::Context - Maintain and manipulate the context of a Koha script
=head1 DESCRIPTION
When a Koha script runs, it makes use of a certain number of things:
configuration settings in F</etc/koha.xml>, a connection to the Koha
configuration settings in F</etc/koha/koha-conf.xml>, a connection to the Koha
databases, and so forth. These things make up the I<context> in which
the script runs.
@ -107,7 +107,7 @@ different contexts to search both databases. Such scripts should use
the C<&set_context> and C<&restore_context> functions, below.
By default, C4::Context reads the configuration from
F</etc/koha.xml>. This may be overridden by setting the C<$KOHA_CONF>
F</etc/koha/koha-conf.xml>. This may be overridden by setting the C<$KOHA_CONF>
environment variable to the pathname of a configuration file to use.
=head1 METHODS
@ -123,7 +123,7 @@ environment variable to the pathname of a configuration file to use.
# config
# A reference-to-hash whose keys and values are the
# configuration variables and values specified in the config
# file (/etc/koha.xml).
# file (/etc/koha/koha-conf.xml).
# dbh
# A handle to the appropriate database for this context.
# dbh_stack
@ -132,8 +132,30 @@ environment variable to the pathname of a configuration file to use.
# Zconn
# A connection object for the Zebra server
use constant CONFIG_FNAME => "/etc/koha.xml";
# Koha's main configuration file koha-conf.xml
# is searched for according to this priority list:
#
# 1. Path supplied via use C4::Context '/path/to/koha-conf.xml'
# 2. Path supplied in KOHA_CONF environment variable.
# 3. Path supplied in INSTALLED_CONFIG_FNAME, as long
# as value has changed from its default of
# '__KOHA_CONF_DIR__/koha-conf.xml', as happens
# when Koha is installed in 'standard' or 'single'
# mode.
# 4. Path supplied in CONFIG_FNAME.
#
# The first entry that refers to a readable file is used.
use constant CONFIG_FNAME => "/etc/koha/koha-conf.xml";
# Default config file, if none is specified
my $INSTALLED_CONFIG_FNAME = '__KOHA_CONF_DIR__/koha-conf.xml';
# path to config file set by installer
# __KOHA_CONF_DIR__ is set by rewrite-confg.PL
# when Koha is installed in 'standard' or 'single'
# mode. If Koha was installed in 'dev' mode,
# __KOHA_CONF_DIR__ is *not* rewritten; instead
# developers should set the KOHA_CONF environment variable
$context = undef; # Initially, no context is set
@context_stack = (); # Initially, no saved contexts
@ -167,7 +189,7 @@ Reads the specified Koha config file.
Returns an object containing the configuration variables. The object's
structure is a bit complex to the uninitiated ... take a look at the
koha.xml file as well as the XML::Simple documentation for details. Or,
koha-conf.xml file as well as the XML::Simple documentation for details. Or,
here are a few examples that may give you what you need:
The simple elements nested within the <config> element:
@ -223,11 +245,11 @@ sub import {
=item new
$context = new C4::Context;
$context = new C4::Context("/path/to/koha.xml");
$context = new C4::Context("/path/to/koha-conf.xml");
Allocates a new context. Initializes the context from the specified
file, which defaults to either the file given by the C<$KOHA_CONF>
environment variable, or F</etc/koha.xml>.
environment variable, or F</etc/koha/koha-conf.xml>.
C<&new> does not set this context as the new default context; for
that, use C<&set_context>.
@ -250,7 +272,18 @@ sub new {
{
# If the $KOHA_CONF environment variable is set, use
# that. Otherwise, use the built-in default.
$conf_fname = $ENV{"KOHA_CONF"} || CONFIG_FNAME;
if (exists $ENV{"KOHA_CONF"} and $ENV{'KOHA_CONF'} and -e $ENV{"KOHA_CONF"} and -s $ENV{"KOHA_CONF"}) {
$conf_fname = $ENV{"KOHA_CONF"};
} elsif ($INSTALLED_CONFIG_FNAME !~ /__KOHA_CONF_DIR/ and -e $INSTALLED_CONFIG_FNAME and -s $INSTALLED_CONFIG_FNAME) {
# NOTE: be careful -- don't change __KOHA_CONF_DIR in the above
# regex to anything else -- don't want installer to rewrite it
$conf_fname = $INSTALLED_CONFIG_FNAME;
} elsif (-e CONFIG_FNAME and -s CONFIG_FNAME) {
$conf_fname = CONFIG_FNAME;
} else {
warn "unable to locate Koha configuration file koha-conf.xml";
return undef;
}
}
# Load the desired config file.
$self = read_config_file($conf_fname);
@ -447,7 +480,7 @@ creates one and connects.
C<$self>
C<$server> one of the servers defined in the koha.xml file
C<$server> one of the servers defined in the koha-conf.xml file
C<$async> whether this is a asynchronous connection
@ -478,7 +511,7 @@ $context->{"Zconn"} = &_new_Zconn($server,$async);
Internal function. Creates a new database connection from the data given in the current context and returns it.
C<$server> one of the servers defined in the koha.xml file
C<$server> one of the servers defined in the koha-conf.xml file
C<$async> whether this is a asynchronous connection

View File

@ -158,7 +158,7 @@ this function performs a simple search on the catalog using zoom.
=item C<input arg:>
* $query could be a simple keyword or a complete CCL query wich is depending on your ccl file.
* @servers is optionnal. default one is read on koha.xml
* @servers is optionnal. default one is read on koha-conf.xml
=item C<Output arg:>
* $error is a string which containt the description error if there is one. Else it's empty.

1128
Makefile.PL Executable file → Normal file

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,8 @@ and some webserver (preferably Apache) before installing Koha.
MySQL 5: Create a database called 'koha,' owned by 'kohaadmin'
user, with a password set. Note: kohaadmin must have at least the
following privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP.
following privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP,
ALTER, and LOCK TABLES.
PostgreSQL 8.2.5: Create a database called 'koha,' owned by 'kohaadmin'
user, with a password set. Note: kohaadmin must be a superuser. You
@ -48,15 +49,16 @@ must also add plpgsql to the koha database.
Default installation instructions:
0. export DB_PASS=thePasswordYouChose
1. perl Makefile.PL
(you will be prompted to answer a number of questions)
2. make
3. sudo make install
4. ln -s /usr/share/koha/etc/koha-httpd.conf /etc/apache2/sites-available/koha
5. a2enmod rewrite
6. a2ensite koha && /etc/init.d/apache2 reload
7. zebrasrv -c /usr/share/koha/etc/koha-conf.xml
8. Browse to http://servername:8080/ and answer the questions
3.(optional) make test
4. sudo make install
5. ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha
6. a2enmod rewrite
7. a2ensite koha && /etc/init.d/apache2 reload
8. zebrasrv -f /etc/koha/koha-conf.xml
9. Browse to http://servername:8080/ and answer the questions
OR if you want to install all dependencies from CPAN and are root, you can
replace steps 1-3 with "perl install-CPAN.pl" but this is non-standard and
@ -64,11 +66,8 @@ may not be safe. Nevertheless, it's pretty cool when it works.
The defaults will install Koha to places that follow relevant standards,
such as the File Hierarchy Standard. If you want to install Koha to a
different directory like /opt/koha, then replace step 1 with:
1a. export PREFIX=/opt/koha
1b. export CGI_DIR=/opt/koha/cgi
1c. export LOG_DIR=/opt/koha/log
1d. perl Makefile.PL PREFIX=/opt/koha
different directory like /opt/koha, then replace step 1 with (for example):
1. perl Makefile.PL INTRANET_CGI_DIR=/www/cgi-bin
You can change most of the defaults in a similar way, such as DB_HOST.
For full instructions on how to override the default settings, run

View File

@ -4,30 +4,30 @@
<!-- scheme: tcp, ssl, unix, http, sru -->
<!-- can run all servers on tcp, but the unix socket is faster -->
<listen id="biblioserver" >unix:__BASE_DIR__/tmp/bibliosocket</listen>
<listen id="authorityserver" >unix:__BASE_DIR__/tmp/authoritysocket</listen>
<listen id="biblioserver" >unix:__ZEBRA_RUN_DIR__/bibliosocket</listen>
<listen id="authorityserver" >unix:__ZEBRA_RUN_DIR__/authoritysocket</listen>
<!-- public server runs on tcp -->
<!-- <listen id="publicserver" >tcp:@:9999</listen> -->
<!-- BIBLIOGRAPHIC RECORDS -->
<server id="biblioserver" listenref="biblioserver">
<directory>__BASE_DIR__/zebradb/biblios</directory>
<config>__PREFIX__/share/koha/etc/zebradb/zebra-biblios.cfg</config>
<cql2rpn>__PREFIX__/share/koha/etc/zebradb/pqf.properties</cql2rpn>
<directory>__ZEBRA_DATA_DIR__/biblios</directory>
<config>__ZEBRA_CONF_DIR__/zebra-biblios.cfg</config>
<cql2rpn>__ZEBRA_CONF_DIR__/pqf.properties</cql2rpn>
</server>
<serverinfo id="biblioserver">
<ccl2rpn>__PREFIX__/share/koha/etc/zebradb/ccl.properties</ccl2rpn>
<ccl2rpn>__ZEBRA_CONF_DIR__/ccl.properties</ccl2rpn>
<user>__ZEBRA_USER__</user>
<password>__ZEBRA_PASS__</password>
</serverinfo>
<!-- AUTHORITY RECORDS -->
<server id="authorityserver" listenref="authorityserver" >
<directory>__BASE_DIR__/zebradb/authorities</directory>
<config>__PREFIX__/share/koha/etc/zebradb/zebra-authorities.cfg</config>
<directory>__ZEBRA_DATA_DIR__/authorities</directory>
<config>__ZEBRA_CONF_DIR__/zebra-authorities.cfg</config>
</server>
<serverinfo id="authorityserver">
<ccl2rpn>__PREFIX__/share/koha/etc/zebradb/ccl.properties</ccl2rpn>
<ccl2rpn>__ZEBRA_CONF_DIR__/ccl.properties</ccl2rpn>
<user>__ZEBRA_USER__</user>
<password>__ZEBRA_PASS__</password>
</serverinfo>
@ -46,10 +46,10 @@
<biblioservershadow>1</biblioservershadow>
<authorityserver>authorities</authorityserver>
<authorityservershadow>1</authorityservershadow>
<intranetdir>__CGI_DIR__</intranetdir>
<opacdir>__CGI_DIR__/opac</opacdir>
<opachtdocs>__BASE_DIR__/templates/koha-tmpl/opac-tmpl</opachtdocs>
<intrahtdocs>__BASE_DIR__/templates/koha-tmpl/intranet-tmpl</intrahtdocs>
<includes>__BASE_DIR__/templates/koha-tmpl/intranet-tmpl/default/en/includes/</includes>
<intranetdir>__INTRANET_CGI_DIR__</intranetdir>
<opacdir>__OPAC_CGI_DIR__/opac</opacdir>
<opachtdocs>__OPAC_TMPL_DIR__</opachtdocs>
<intrahtdocs>__INTRANET_TMPL_DIR__</intrahtdocs>
<includes>__INTRANET_TMPL_DIR__/default/en/includes/</includes>
</config>
</yazgfs>

View File

@ -5,16 +5,17 @@
## OPAC
<VirtualHost __WEBSERVER_IP__:__WEBSERVER_PORT__>
ServerAdmin __WEBMASTER_EMAIL__
DocumentRoot __BASE_DIR__/templates/koha-tmpl/
DocumentRoot __OPAC_WWW_DIR__
ServerName __WEBSERVER_HOST__
# ServerAlias opac.mydomain.com
ScriptAlias /cgi-bin/koha/ "__CGI_DIR__/opac/"
ScriptAlias /index.html "__CGI_DIR__/opac/opac-main.pl"
ScriptAlias /opac-search.pl "__CGI_DIR__/opac/search"
ScriptAlias /search "__CGI_DIR__/opac/search"
ScriptAlias /cgi-bin/koha/ "__OPAC_CGI_DIR__/opac/"
ScriptAlias /index.html "__OPAC_CGI_DIR__/opac/opac-main.pl"
ScriptAlias /opac-search.pl "__OPAC_CGI_DIR__/opac/search"
ScriptAlias /search "__OPAC_CGI_DIR__/opac/search"
ErrorLog __LOG_DIR__/koha-opac-error_log
# TransferLog __LOG_DIR__/koha-opac-access_log
SetEnv KOHA_CONF "__PREFIX__/share/koha/etc/koha-conf.xml"
SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml"
SetEnv PERL5LIB "__PERL_MODULE_DIR__"
Options +FollowSymLinks
# Rewrite Rules
@ -34,15 +35,16 @@
## Intranet
<VirtualHost __WEBSERVER_IP__:__WEBSERVER_PORT_LIBRARIAN__>
ServerAdmin __WEBMASTER_EMAIL__
DocumentRoot __BASE_DIR__/templates/koha-tmpl/
DocumentRoot __INTRANET_WWW_DIR__
ServerName __WEBSERVER_HOST__:__WEBSERVER_PORT_LIBRARIAN__
# ServerAlias intranet.mydomain.com
ScriptAlias /cgi-bin/koha/ "__CGI_DIR__/"
ScriptAlias /index.html "__CGI_DIR__/mainpage.pl"
ScriptAlias /search "__CGI_DIR__/search.pl"
ScriptAlias /cgi-bin/koha/ "__INTRANET_CGI_DIR__/"
ScriptAlias /index.html "__INTRANET_CGI_DIR__/mainpage.pl"
ScriptAlias /search "__INTRANET_CGI_DIR__/search.pl"
ErrorLog __LOG_DIR__/koha-error_log
# TransferLog __LOG_DIR__/koha-access_log
SetEnv KOHA_CONF "__PREFIX__/share/koha/etc/koha-conf.xml"
SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml"
SetEnv PERL5LIB "__PERL_MODULE_DIR__"
Options +FollowSymLinks
RewriteEngine On
# Uncomment to turn on rewrite logging

View File

@ -1 +0,0 @@
Zebra key dir

View File

@ -1 +0,0 @@
Zebra lock dir

View File

@ -1 +0,0 @@
Zebra register dir

View File

@ -1 +0,0 @@
Zebra shadow dir

View File

@ -1 +0,0 @@
Zebra tmp dir

View File

@ -1 +0,0 @@
Zebra key dir

View File

@ -1 +0,0 @@
Zebra lock dir

View File

@ -1 +0,0 @@
Zebra readme dir

View File

@ -1 +0,0 @@
Zebra tmp dir

View File

@ -280,7 +280,7 @@ melm 952$q onloan:n,onloan:w
melm 952$r datelastseen
melm 952$s datelastborrowed
melm 952$t copynumber
melm 952$u uri:u,url:w
melm 952$u uri:u
melm 952$v replacementprice
melm 952$w replacementpricedate
#melm 952$x

View File

@ -4,7 +4,7 @@
# $Id: zebra.cfg,v 1.1.2.2 2006/05/09 12:03:16 rangi Exp $
#
# Where are the config files located?
profilePath:__PREFIX__/share/koha/etc/zebradb/authorities/etc:__PREFIX__/share/koha/etc/zebradb/etc
profilePath:__ZEBRA_CONF_DIR__/authorities/etc:__ZEBRA_CONF_DIR__/etc:__ZEBRA_CONF_DIR__/marc_defs/__ZEBRA_MARC_FORMAT__/authorities:__ZEBRA_CONF_DIR__/lang_defs/__ZEBRA_LANGUAGE__
encoding: UTF-8
# modulePath - where to look for loadable zebra modules
@ -26,17 +26,17 @@ storeData:1
# Lock File Area
lockDir: __BASE_DIR__/zebradb/authorities/lock
lockDir: __ZEBRA_LOCK_DIR__/authorities
perm.anonymous:r
perm.__ZEBRA_USER__:rw
register: __BASE_DIR__/zebradb/authorities/register:4G
shadow: __BASE_DIR__/zebradb/authorities/shadow:1G
register: __ZEBRA_DATA_DIR__/authorities/register:4G
shadow: __ZEBRA_DATA_DIR__/authorities/shadow:1G
# Temp File area for result sets
setTmpDir: __BASE_DIR__/zebradb/authorities/tmp
setTmpDir: __ZEBRA_DATA_DIR__/authorities/tmp
# Temp File area for index program
keyTmpDir: __BASE_DIR__/zebradb/authorities/key
keyTmpDir: __ZEBRA_DATA_DIR__/authorities/key
# Approx. Memory usage during indexing
memMax: 200M

View File

@ -3,7 +3,7 @@
# $Id: zebra.cfg,v 1.1.2.2 2006/05/09 12:03:16 rangi Exp $
#
# Where are the config files located?
profilePath:__PREFIX__/share/koha/etc/zebradb/biblios/etc:__PREFIX__/share/koha/etc/zebradb/etc
profilePath:__ZEBRA_CONF_DIR__/biblios/etc:__ZEBRA_CONF_DIR__/etc:__ZEBRA_CONF_DIR__/marc_defs/__ZEBRA_MARC_FORMAT__/biblios:__ZEBRA_CONF_DIR__/lang_defs/__ZEBRA_LANGUAGE__
# modulePath - where to look for loadable zebra modules
modulePath: /usr/lib/idzebra-2.0/modules
@ -23,17 +23,17 @@ storeData:1
# Lock File Area
lockDir: __BASE_DIR__/zebradb/biblios/lock
lockDir: __ZEBRA_LOCK_DIR__/biblios
perm.anonymous:r
perm.__ZEBRA_USER__:rw
register: __BASE_DIR__/zebradb/biblios/register:4G
shadow: __BASE_DIR__/zebradb/biblios/shadow:4G
register: __ZEBRA_DATA_DIR__/biblios/register:4G
shadow: __ZEBRA_DATA_DIR__/biblios/shadow:4G
# Temp File area for result sets
setTmpDir: __BASE_DIR__/zebradb/biblios/tmp
setTmpDir: __ZEBRA_DATA_DIR__/biblios/tmp
# Temp File area for index program
keyTmpDir: __BASE_DIR__/zebradb/biblios/key
keyTmpDir: __ZEBRA_DATA_DIR__/biblios/key
# Approx. Memory usage during indexing
memMax: 500M

114
fix-perl-path.PL Normal file
View File

@ -0,0 +1,114 @@
#!/usr/bin/perl
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
#
use strict;
use ExtUtils::MakeMaker::Config;
use Tie::File;
my $basedir = (shift);
my $DEBUG = exists $ENV{'DEBUG'} ? $ENV{'DEBUG'} : 0;
$DEBUG = 1 if $basedir eq 'test';
my $bindir = $Config{installbin};
$bindir =~ s!\\!/!g; # make all directory separators uniform since Win32 does not care and *nix does...
my $shebang = "#!$bindir\/perl";
warn "Perl binary located in $bindir on this system.\n" if $DEBUG;
warn "The shebang line for this sytems should be $shebang\n\n" if $DEBUG;
die if $basedir eq 'test';
=head1 NAME
fix-perl-path.PL - A script to correct the shebang line to match the current platform
=head1 SYNOPSIS
=head2 BASIC USAGE
perl fix-perl-path.PL /absolute/path/to/foo
=head1 DESCRIPTION
This script should be run from the base of the directory
structure which contains the file(s) that need the
shebang line corrected. It will recurse through all
directories below the one called from and modify all
.pl files.
=head2 fixshebang
This sub will recurse through a given directory and its subdirectories checking for the existence of a shebang
line in .pl files and replacing it with the correct line for the current OS if needed. It should be called
in a manner similar to 'fixshebang (foodir)' but may be supplied with any directory.
=cut
sub fixshebang{
my $dir = shift;
opendir my $dh, $dir or die $!;
warn "Reading $dir contents.\n" if $DEBUG;
while( my $file = readdir($dh) ) {
# this may be used to exclude any desired files from the scan
# if ( $file =~ /foo/ ) { next; }
# handle files... other extensions could be substituted/added if needed
if ( $file =~ /\.pl$/ ) {
my @filearray;
my $pathfile =$dir . '/' . $file;
warn "Found a perl script named $pathfile\n" if $DEBUG;
# At this point, file is in 'blib' and by default
# has mode a-w. Therefore, must change permission
# to make it writable.
my $old_perm;
if ($^O ne 'MSWin32') {
$old_perm = (stat $pathfile)[2] & 07777;
my $new_perm = $old_perm | 0200;
chmod $new_perm, $pathfile;
}
tie @filearray, 'Tie::File', $pathfile or die $!;
warn "First line of $file is $filearray[0]\n\n" if $DEBUG;
if ( ( $filearray[0] =~ /#!.*perl/ ) && ( $filearray[0] !~ /$shebang|"$shebang -w"/ ) ) {
warn "\n\tRe-writing shebang line for $pathfile\n" if $DEBUG;
warn "\tOriginal shebang line: $filearray[0]\n" if $DEBUG;
$filearray[0] =~ /-w$/ ? $filearray[0] = "$shebang -w" : $filearray[0] = $shebang;
warn "\tNew shebang line is: $filearray[0]\n\n" if $DEBUG;
}
elsif ( $filearray[0] =~ /$shebang|"$shebang -w"/ ) {
warn "\n\tShebang line is correct.\n\n" if $DEBUG;
}
else {
warn "\n\tNo shebang line found in $pathfile\n\n" if $DEBUG;
}
untie @filearray;
if ($^O ne 'MSWin32') {
chmod $old_perm, $pathfile;
}
}
# handle directories
elsif ( -d ($dir . '/' . $file) && $file !~ /^\.{1,2}/ ) {
my $dirpath = $dir . '/' . $file;
warn "Found a subdir named $dirpath\n" if $DEBUG;
fixshebang ($dirpath);
}
}
closedir $dh;
}
fixshebang ($basedir);

View File

@ -188,7 +188,7 @@ elsif ( $step && $step == 2 ) {
my $grantaccess;
while ( my ($line) = $rq->fetchrow ) {
my $dbname = $info{dbname};
if ( $line =~ m/$dbname/ || index( $line, '*.*' ) > 0 ) {
if ( $line =~ m/^GRANT (.*?) ON `$dbname`\.\*/ || index( $line, '*.*' ) > 0 ) {
$grantaccess = 1
if (
index( $line, 'ALL PRIVILEGES' ) > 0

View File

@ -35,7 +35,7 @@
<h3>Welcome to the Koha Web Installer</h3>
<p>Before we begin, please verify you have the correct credentials to continue. Please log in
with the username and password given to you by your systems administrator and located in your
<code>koha.xml</code> configuration file.</p>
<code>koha-conf.xml</code> configuration file.</p>
<p>Please enter your username and password:</p>
<p><label>Username:<br />
<input type="text" name="userid" id="userid" class="input" value="<!-- TMPL_VAR NAME="userid" -->" size="20" tabindex="1" /></label>

View File

@ -36,8 +36,8 @@
<div class="tip">
<ul>
<li>Check that your database is running.</li>
<li>Check your database settings in <code>koha.xml</code>. </li>
<li>Check the hostname setting in <code>koha.xml</code>.
<li>Check your database settings in <code>koha-conf.xml</code>. </li>
<li>Check the hostname setting in <code>koha-conf.xml</code>.
Some database servers require <code>127.0.0.1</code> rather than <code>localhost</code>.</li>
</div>
<p>Please correct these errors and <a href="/cgi-bin/koha/installer/install.pl">start the installer</a> again.

View File

@ -7,8 +7,14 @@
# used by developers when the database changes. updatedatabase take care of the changes itself
# and is automatically called by Auth.pm when needed.
use strict;
sub kohaversion {
return "3.00.00.035";
our $VERSION = "3.00.00.035";
# version needs to be set this way
# so that it can be picked up by Makefile.PL
# during install
return $VERSION;
}
1;

View File

@ -40,7 +40,7 @@ my $errormsg;
my ($bor)=GetMember($member);
if(( $member ne $loggedinuser ) && ($bor->{'category_type'} eq 'S' ) ) {
$errormsg = 'NOPERMISSION' unless($staffflags->{'superlibrarian'} || $staffflags->{'staffaccess'} );
# need superlibrarian for koha.xml fakeuser.
# need superlibrarian for koha-conf.xml fakeuser.
}
my $newpassword = $input->param('newpassword');
my $minpw = C4::Context->preference('minPasswordLength');

View File

@ -1,8 +1,14 @@
#!/usr/bin/perl
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
use HTTPD::Bench::ApacheBench;
use C4::Context;
use strict;
# 1st, find some maximal values
my $dbh=C4::Context->dbh();

View File

@ -2,6 +2,12 @@
# small script that import an iso2709 file into koha 2.0
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
# Koha modules used
use MARC::File::USMARC;

View File

@ -23,7 +23,13 @@
=cut
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
use C4::Context;
use MARC::File::XML;
use MARC::Record;

View File

@ -2,6 +2,12 @@
# small script that rebuilds the non-MARC DB
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
# Koha modules used
# use MARC::File::USMARC;

View File

@ -1,6 +1,12 @@
#!/usr/bin/perl
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
use C4::Context;
use C4::ImportBatch;

View File

@ -3,6 +3,12 @@
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
# Koha modules used
use C4::Context;

View File

@ -2,6 +2,12 @@
# small script that builds the tag cloud
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use C4::Koha;
use C4::Context;
@ -34,7 +40,7 @@ if ($version || (!$confirm)) {
-t TTT to define the MARC fields/subfield to use to fill the tag cloud. If not defined, the cloud table won't be filled.
example :
export PERL5LIB=/path/to/koha;export KOHA_CONF=/etc/koha.xml;./build_browser_and_cloud.pl -b -f 676a -t 606 -c
export PERL5LIB=/path/to/koha;export KOHA_CONF=/etc/koha/koha-conf.xml;./build_browser_and_cloud.pl -b -f 676a -t 606 -c
EOF
;
exit;

View File

@ -1,6 +1,13 @@
#!/usr/bin/perl
#run nightly -- changes J to A on someone's 18th birthday
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use C4::Context;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
= localtime(time);

View File

@ -12,9 +12,13 @@
# 1.0.0 2004/04/01: original version
#-----------------------------------
use lib '/usr/local/koha/intranet/modules/';
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use C4::Context;
my $dbh = C4::Context->dbh;

View File

@ -1,4 +1,10 @@
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use C4::Context;
use C4::Dates qw/format_date/;
use Mail::Sendmail; # comment out if not doing e-mail notices

View File

@ -30,6 +30,12 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use C4::Context;
use C4::Dates qw/format_date/;
use Mail::Sendmail; # comment out if not doing e-mail notices

View File

@ -35,6 +35,12 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use C4::Context;
use C4::Dates;
use Mail::Sendmail; # comment out if not doing e-mail notices

View File

@ -12,9 +12,13 @@
# 1.0.0 2004/02/22: original version
#-----------------------------------
use lib '/usr/local/koha/intranet/modules/';
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use C4::Context;
use Date::Manip;
use Mail::Sendmail;

View File

@ -2,6 +2,12 @@
#run nightly -- resets the services throttle
use strict; use warnings;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use C4::Context;
my $dbh=C4::Context->dbh;

View File

@ -27,6 +27,13 @@
# $Id: sendoverdues.pl,v 1.1.2.1 2007/03/26 22:38:09 tgarip1957 Exp $
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use C4::Context;
use C4::Search;
use C4::Circulation;

View File

@ -1,6 +1,12 @@
#!/usr/bin/perl
use strict;
use warnings;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use C4::Context;
use C4::Biblio;
use MARC::Record;

View File

@ -2,7 +2,12 @@
# script that starts the zebraquee
# Written by TG on 01/08/2006
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use C4::Context;
use C4::Biblio;

View File

@ -3,6 +3,12 @@
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
# Koha modules used
use MARC::File::USMARC;

View File

@ -4,6 +4,12 @@
#
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
require Exporter;
use C4::Auth;

View File

@ -26,12 +26,18 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
use C4::Context;
use C4::Circulation;
use C4::Overdues;
use Date::Manip qw/Date_DaysSince1BC/;
use C4::Biblio;
use strict;
open (FILE,'>/tmp/fines') || die;
# FIXME

View File

@ -26,12 +26,19 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
use C4::Context;
use C4::Circulation;
use C4::Overdues;
use Date::Manip;
use C4::Biblio;
use strict;
open (FILE,'>/tmp/fines') || die;
# FIXME

51
misc/kohalib.pl Normal file
View File

@ -0,0 +1,51 @@
#!/usr/bin/perl
# Copyright (C) 2007 LibLime
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
# This script is used by command-line utilities to set
# @INC properly -- specifically, to point to the directory
# containing the installed version of the C4 modules.
#
# This depends on the installer replacing the \_\_PERL_MODULE_DIR\_\_
# string with the path to the Koha modules directory. This is done
# only during a 'standard' or 'single' mode installation. If Koha
# is being run from a git checkout (and thus installed in 'dev' mode),
# this is a no-op.
#
# To use this script, a command-line utility should do the following before
# 'use'ing any C4 modules.
#
# BEGIN {
# use FindBin;
# eval { require "$FindBin::Bin/kohalib.pl" };
# # adjust path to point to kohalib.pl relative
# # to location of script
# }
#
use strict;
my $module_dir;
BEGIN {
$module_dir = '__PERL_MODULE_DIR__';
die if $module_dir =~ /^[_]{2}PERL_MODULE_DIR[_]{2}$/;
}
use lib $module_dir;
1;

View File

@ -2,6 +2,12 @@
# script that correct the marcxml from in biblioitems
# Written by TG on 10/04/2006
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
# Koha modules used

View File

@ -2,6 +2,12 @@
# script that rebuild thesaurus from biblio table.
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
# Koha modules used
use MARC::File::USMARC;

View File

@ -2,8 +2,14 @@
# small script to convert mysql tables to utf-8
use C4::Context;
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../../kohalib.pl" };
}
use C4::Context;
my $dbh=C4::Context->dbh();

View File

@ -1,4 +1,10 @@
#!/usr/bin/perl
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../../kohalib.pl" };
}
use C4::Context;
#use MARC::File::XML(BinaryEncoding=>"utf8");
#use MARC::File::USMARC;

View File

@ -1,4 +1,10 @@
#!/usr/bin/perl
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../../kohalib.pl" };
}
use C4::Context;
use MARC::File::XML(BinaryEncoding=>"utf8");
use MARC::Record;

View File

@ -3,6 +3,12 @@
# Written by TG on 01/10/2005
# Revised by Joshua Ferraro on 03/31/2006
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../../kohalib.pl" };
}
# Koha modules used

View File

@ -2,7 +2,12 @@
# script to shift marc to biblioitems
# scraped from updatedatabase for dev week by chris@katipo.co.nz
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../../kohalib.pl" };
}
use C4::Context;
use C4::AuthoritiesMarc;
use MARC::Record;

View File

@ -2,7 +2,12 @@
# script to shift marc to biblioitems
# scraped from updatedatabase for dev week by chris@katipo.co.nz
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../../kohalib.pl" };
}
use C4::Context;
use C4::Biblio;
use MARC::Record;
@ -137,4 +142,4 @@ sub LocalMARCgetbiblio {
}
}
return $record;
}
}

View File

@ -3,6 +3,12 @@
# Written by TG on 01/10/2005
# Revised by Joshua Ferraro on 03/31/2006
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../../kohalib.pl" };
}
# Koha modules used

View File

@ -3,6 +3,12 @@
# Written by TG on 01/10/2005
# Revised by Joshua Ferraro on 03/31/2006
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../../kohalib.pl" };
}
# Koha modules used

View File

@ -3,6 +3,12 @@
use strict;
# use warnings;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
# Koha modules used
use MARC::File::USMARC;

View File

@ -3,6 +3,12 @@
# Written by TG on 01/10/2005
# Revised by Joshua Ferraro on 03/31/2006
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
# Koha modules used

View File

@ -11,6 +11,12 @@
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
use C4::Context;
use C4::Biblio;

View File

@ -2,6 +2,12 @@
# small script that rebuilds the non-MARC DB
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
# Koha modules used
# use MARC::File::USMARC;

View File

@ -16,8 +16,6 @@
## CONFIGURABLE VARIABLES ####################
##
# Change this to where your Koha modules are (C4 directory)
use lib '/usr/local/koha/intranet/modules/';
# These are the tags that have meaningful data
# for the databases I've worked with (MARC21 only)
# you may need to change them depending on your data
@ -71,6 +69,12 @@ my @tags=(
);
## Leave this next bit alone
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use C4::Context;
##
# SUGGEST DATABASE INFO

View File

@ -1,6 +1,12 @@
#!/usr/bin/perl
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
use C4::Context;
use C4::ImportBatch;

View File

@ -1,6 +1,12 @@
#!/usr/bin/perl -w
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
use C4::Context;
use Getopt::Long;

View File

@ -2,6 +2,12 @@
# script that correct the marcxml from in biblioitems
# Written by TG on 10/04/2006
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
# Koha modules used
@ -37,4 +43,4 @@ $dbh->do("UNLOCK TABLES ");
$timeneeded = gettimeofday - $starttime ;
print "$i records in $timeneeded s\n" ;
END;
END;

View File

@ -3,6 +3,12 @@
# daemon to watch the zebraqueue and update zebra as needed
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
use POE qw(Wheel::SocketFactory Wheel::ReadWrite Filter::Stream Driver::SysRW);
use Unix::Syslog qw(:macros);

View File

@ -44,7 +44,7 @@ guesses worked out by the script.
The following configuration keywords are available:
PREFIX,
BASE_DIR, CGI_DIR, LOG_DIR,
BASE_DIR, CGI_DIR, LOG_DIR, INSTALL_BASE,
DB_TYPE, DB_HOST, DB_PORT, DB_NAME, DB_PASS, DB_USER, WEBMASTER_EMAIL, WEBSERVER_DOMAIN,
WEBSERVER_HOST, WEBSERVER_IP, WEBSERVER_PORT, WEBSERVER_PORT_LIBRARIAN, ZEBRA_PASS, ZEBRA_USER
@ -65,15 +65,12 @@ $mydomain = $myhost;
$mydomain =~ s/^.*?\.//;
# This is set here to rescue systems with broken DNS
$myip = $ENV{'WEBSERVER_IP'} || inet_ntoa(scalar gethostbyname($myhost||'localhost')) || die "Cannot get our own IP address: DNS fault?";
$prefix = $ENV{'PREFIX'} || "/usr/local";
$prefix = $ENV{'INSTALL_BASE'} || "/usr";
# These are our configuration guesses
# Keys were extracted by
# <grep -o '__.*__' etc/* | cut -f2 -d: | sort -u | sed -e 's/^/ "/;s/$/" => "",/'
%configuration = (
"__BASE_DIR__" => ($ENV{'INSTALLSITELIB'} || sprintf($prefix."/lib/perl/%vd",$^V))."/koha",
# Corrected to match Debian Perl req's.... -fbcit
"__CGI_DIR__" => $prefix."/lib/cgi-bin/koha",
"__LOG_DIR__" => "/var/log",
"__DB_TYPE__" => "mysql",
"__DB_NAME__" => "koha",
@ -81,7 +78,6 @@ $prefix = $ENV{'PREFIX'} || "/usr/local";
"__DB_PORT__" => "3306",
"__DB_USER__" => "kohaadmin",
"__DB_PASS__" => "katikoan",
"__PREFIX__" => $prefix,
"__WEBMASTER_EMAIL__" => 'webmaster@'.$mydomain,
"__WEBSERVER_DOMAIN__" => $mydomain,
"__WEBSERVER_HOST__" => $myhost,
@ -90,7 +86,24 @@ $prefix = $ENV{'PREFIX'} || "/usr/local";
"__WEBSERVER_PORT_LIBRARIAN__" => "8080",
"__ZEBRA_PASS__" => "zebrastripes",
"__ZEBRA_USER__" => "kohauser",
"__MARCFLAVOUR__" => "marc21",
'__INTRANET_CGI_DIR__' => "$prefix/intranet/cgi-bin",
'__INTRANET_TMPL_DIR__' => "$prefix/intranet/templates",
'__INTRANET_WWW_DIR__' => "$prefix/intranet/www",
'__OPAC_CGI_DIR__' => "$prefix/opac/cgi-bin",
'__OPAC_TMPL_DIR__' => "$prefix/opac/templates",
'__OPAC_WWW_DIR__' => "$prefix/opac/www",
'__PERL_MODULE_DIR__' => ($ENV{'INSTALLSITELIB'} || sprintf($prefix."/lib/perl5/site_perl/%vd",$^V))."/koha",
'__KOHA_CONF_DIR__' => "$prefix/etc/koha",
'__ZEBRA_CONF_DIR__' => "$prefix/etc/koha/zebradb",
'__MISC_DIR__' => "$prefix/misc",
'__SCRIPT_DIR__' => "$prefix/bin",
'__MAN_DIR__' => "$prefix/man",
'__DOC_DIR__' => "$prefix/doc",
'__ZEBRA_LOCK_DIR__' => "$prefix/var/lock/zebradb",
'__ZEBRA_DATA_DIR__' => "$prefix/var/lib/zebradb",
'__ZEBRA_RUN_DIR__' => "$prefix/var/run/zebradb",
'__ZEBRA_MARC_FORMAT__' => 'marc21',
'__ZEBRA_LANGUAGE__' => 'en',
);
# Override configuration from the environment
@ -102,7 +115,7 @@ foreach $key (keys %configuration) {
$fname = $ARGV[0];
$file = read_file($fname);
$file =~ s/__.*?__/$configuration{$&}/seg;
$file =~ s/__.*?__/exists $configuration{$&} ? $configuration{$&} : $&/seg;
chmod 0644, $fname;
open(OUTPUT,">$fname") || die "Can't open $fname for write: $!";
print OUTPUT $file;

6
skel/README Normal file
View File

@ -0,0 +1,6 @@
The skel directory contains placeholders
for directories needed by the Zebra
installation, and is used only by the installer.
No files except for README placeholders
used by make should be kept in this tree.

View File

@ -0,0 +1 @@
Zebra authorities key dir

View File

@ -0,0 +1 @@
Zebra authorities register dir

View File

@ -0,0 +1 @@
Zebra authorities shadow dir

View File

@ -0,0 +1 @@
Zebra authorities tmp dir

View File

@ -0,0 +1 @@
Zebra biblios key dir

View File

@ -0,0 +1 @@
Zebra biblios register dir

View File

@ -0,0 +1 @@
Zebra biblios shadow dir

View File

@ -0,0 +1 @@
Zebra biblios tmp dir

View File

@ -0,0 +1 @@
Zebra authorities lock dir

View File

@ -0,0 +1 @@
Zebra biblios lock dir

1
skel/var/log/koha/README Normal file
View File

@ -0,0 +1 @@
Koha Apache logs

View File

@ -0,0 +1 @@
Zebra Unix-domain sockets