Lines 1-52
Link Here
|
1 |
#!/usr/bin/perl |
|
|
2 |
|
3 |
# Copyright (C) 2007 LibLime |
4 |
# |
5 |
# This file is part of Koha. |
6 |
# |
7 |
# Koha is free software; you can redistribute it and/or modify it |
8 |
# under the terms of the GNU General Public License as published by |
9 |
# the Free Software Foundation; either version 3 of the License, or |
10 |
# (at your option) any later version. |
11 |
# |
12 |
# Koha is distributed in the hope that it will be useful, but |
13 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
# GNU General Public License for more details. |
16 |
# |
17 |
# You should have received a copy of the GNU General Public License |
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
19 |
|
20 |
# This script is used by command-line utilities to set |
21 |
# @INC properly -- specifically, to point to the directory |
22 |
# containing the installed version of the C4 modules. |
23 |
# |
24 |
# This depends on the installer replacing the \_\_PERL_MODULE_DIR\_\_ |
25 |
# string with the path to the Koha modules directory. This is done |
26 |
# only during a 'standard' or 'single' mode installation. If Koha |
27 |
# is being run from a git checkout (and thus installed in 'dev' mode), |
28 |
# this is a no-op. |
29 |
# |
30 |
# To use this script, a command-line utility should do the following before |
31 |
# 'use'ing any C4 modules. |
32 |
# |
33 |
# BEGIN { |
34 |
# use FindBin; |
35 |
# eval { require "$FindBin::Bin/kohalib.pl" }; |
36 |
# # adjust path to point to kohalib.pl relative |
37 |
# # to location of script |
38 |
# } |
39 |
# |
40 |
|
41 |
use strict; |
42 |
#use warnings; FIXME - Bug 2505 |
43 |
|
44 |
my $module_dir; |
45 |
BEGIN { |
46 |
$module_dir = '__PERL_MODULE_DIR__'; |
47 |
die if $module_dir =~ /^[_]{2}PERL_MODULE_DIR[_]{2}$/; |
48 |
} |
49 |
|
50 |
use lib $module_dir; |
51 |
|
52 |
1; |