Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
f2d5af26
Commit
f2d5af26
authored
Oct 13, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 602418: Add "template_cache" to bz_locations(), a way of specifying that
cached templates should be stored somewhere else than the data directory. r=LpSolit, a=mkanat
parent
8cfb548a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
16 deletions
+23
-16
Constants.pm
Bugzilla/Constants.pm
+5
-3
Filesystem.pm
Bugzilla/Install/Filesystem.pm
+2
-1
Template.pm
Bugzilla/Template.pm
+14
-10
strings.txt.pl
template/en/default/setup/strings.txt.pl
+2
-2
No files found.
Bugzilla/Constants.pm
View file @
f2d5af26
...
...
@@ -596,6 +596,7 @@ sub bz_locations {
$datadir
=
"data"
;
}
$datadir
=
"$libpath/$datadir"
;
# We have to return absolute paths for mod_perl.
# That means that if you modify these paths, they must be absolute paths.
return
{
...
...
@@ -605,10 +606,11 @@ sub bz_locations {
# make sure this still points to the CGIs.
'cgi_path'
=>
$libpath
,
'templatedir'
=>
"$libpath/template"
,
'template_cache'
=>
"$datadir/template"
,
'project'
=>
$project
,
'localconfig'
=>
"$libpath/$localconfig"
,
'datadir'
=>
"$libpath/$datadir"
,
'attachdir'
=>
"$
libpath/$
datadir/attachments"
,
'datadir'
=>
$datadir
,
'attachdir'
=>
"$datadir/attachments"
,
'skinsdir'
=>
"$libpath/skins"
,
# $webdotdir must be in the web server's tree somewhere. Even if you use a
# local dot, we output images to there. Also, if $webdotdir is
...
...
@@ -616,7 +618,7 @@ sub bz_locations {
# change showdependencygraph.cgi to set image_url to the correct
# location.
# The script should really generate these graphs directly...
'webdotdir'
=>
"$
libpath/$
datadir/webdot"
,
'webdotdir'
=>
"$datadir/webdot"
,
'extensionsdir'
=>
"$libpath/extensions"
,
};
}
...
...
Bugzilla/Install/Filesystem.pm
View file @
f2d5af26
...
...
@@ -121,6 +121,7 @@ sub FILESYSTEM {
my
$extlib
=
bz_locations
()
->
{
'ext_libpath'
};
my
$skinsdir
=
bz_locations
()
->
{
'skinsdir'
};
my
$localconfig
=
bz_locations
()
->
{
'localconfig'
};
my
$template_cache
=
bz_locations
()
->
{
'template_cache'
};
# We want to set the permissions the same for all localconfig files
# across all PROJECTs, so we do something special with $localconfig,
...
...
@@ -189,7 +190,7 @@ sub FILESYSTEM {
# the webserver.
my
%
recurse_dirs
=
(
# Writeable directories
"$datadir/template"
=>
{
files
=>
CGI_READ
,
$template_cache
=>
{
files
=>
CGI_READ
,
dirs
=>
DIR_CGI_OVERWRITE
},
$attachdir
=>
{
files
=>
CGI_WRITE
,
dirs
=>
DIR_CGI_WRITE
},
...
...
Bugzilla/Template.pm
View file @
f2d5af26
...
...
@@ -633,7 +633,7 @@ sub create {
ABSOLUTE
=>
1
,
RELATIVE
=>
$ENV
{
MOD_PERL
}
?
0
:
1
,
COMPILE_DIR
=>
bz_locations
()
->
{
'
datadir'
}
.
"/template"
,
COMPILE_DIR
=>
bz_locations
()
->
{
'
template_cache'
}
,
# Initialize templates (f.e. by loading plugins like Hook).
PRE_PROCESS
=>
[
"global/initialize.none.tmpl"
],
...
...
@@ -990,23 +990,27 @@ sub precompile_templates {
my
(
$output
)
=
@_
;
# Remove the compiled templates.
my
$cache_dir
=
bz_locations
()
->
{
'template_cache'
};
my
$datadir
=
bz_locations
()
->
{
'datadir'
};
if
(
-
e
"$datadir/template"
)
{
if
(
-
e
$cache_dir
)
{
print
install_string
(
'template_removing_dir'
)
.
"\n"
if
$output
;
# This frequently fails if the webserver made the files, because
# then the webserver owns the directories.
rmtree
(
"$datadir/template"
);
rmtree
(
$cache_dir
);
# Check that the directory was really removed, and if not, move it
# into data/deleteme/.
if
(
-
e
"$datadir/template"
)
{
if
(
-
e
$cache_dir
)
{
my
$deleteme
=
"$datadir/deleteme"
;
print
STDERR
"\n\n"
,
install_string
(
'template_removal_failed'
,
{
datadir
=>
$datadir
}),
"\n\n"
;
mkpath
(
"$datadir/deleteme"
);
{
deleteme
=>
$deleteme
,
template_cache
=>
$cache_dir
}),
"\n\n"
;
mkpath
(
$deleteme
);
my
$random
=
generate_random_password
();
rename
(
"$datadir/template"
,
"$datadir/
deleteme/$random"
)
rename
(
$cache_dir
,
"$
deleteme/$random"
)
or
die
"move failed: $!"
;
}
}
...
...
@@ -1071,10 +1075,10 @@ sub _do_template_symlink {
my
$abs_root
=
dirname
(
$abs_path
);
my
$dir_name
=
basename
(
$abs_path
);
my
$
datadir
=
bz_locations
()
->
{
'datadir
'
};
my
$container
=
"$
datadir/template
$abs_root"
;
my
$
cache_dir
=
bz_locations
()
->
{
'template_cache
'
};
my
$container
=
"$
cache_dir
$abs_root"
;
mkpath
(
$container
);
my
$target
=
"$
datadir/template
/$dir_name"
;
my
$target
=
"$
cache_dir
/$dir_name"
;
# Check if the directory exists, because if there are no extensions,
# there won't be an "data/template/extensions" directory to link to.
if
(
-
d
$target
)
{
...
...
template/en/default/setup/strings.txt.pl
View file @
f2d5af26
...
...
@@ -389,8 +389,8 @@ EOT
EOT
template_precompile => "Precompiling templates...",
template_removal_failed => <<END,
WARNING: The directory '
##
datadir##/template
' could not be removed.
It
has
been
moved
into
'##d
atadir##/deleteme
'
,
which
should
be
WARNING: The directory '
##
template_cache##
' could not be removed.
It
has
been
moved
into
'##d
eleteme##
'
,
which
should
be
deleted
manually
to
conserve
disk
space
.
END
template_removing_dir
=>
"Removing existing compiled templates..."
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment