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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
5ad7900f
Commit
5ad7900f
authored
Nov 20, 2005
by
wurblzap%gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 304417: Template precompilation is clumsy when it comes to additional language directories.
Patch by Jochen Wiedmann <jochen.wiedmann@gmail.com>, r=wurblzap, a=myk
parent
8b18b7e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
26 deletions
+25
-26
Template.pm
Bugzilla/Template.pm
+7
-0
checksetup.pl
checksetup.pl
+18
-26
No files found.
Bugzilla/Template.pm
View file @
5ad7900f
...
...
@@ -284,6 +284,13 @@ $Template::Stash::SCALAR_OPS->{ truncate } =
###############################################################################
# Construct the Template object
my
%
opts
=
@_
;
if
(
$opts
{
'clean_cache'
})
{
# checksetup.pl will call us once for any template/lang directory.
# We need a possibility to reset the cache, so that no files from
# the previous language pollute the action.
$template_include_path
=
undef
;
}
# Note that all of the failure cases here can't use templateable errors,
# since we won't have a template to use...
...
...
checksetup.pl
View file @
5ad7900f
...
...
@@ -1220,27 +1220,6 @@ unless ($switch{'no_templates'}) {
}
}
# Search for template directories
# We include the default and custom directories separately to make
# sure we compile all templates
my
@templatepaths
=
();
{
use
File::
Spec
;
opendir
(
DIR
,
$templatedir
)
||
die
"Can't open '$templatedir': $!"
;
my
@files
=
grep
{
/^[a-z-]+$/i
}
readdir
(
DIR
);
closedir
DIR
;
foreach
my
$dir
(
@files
)
{
next
if
(
$dir
=~
/^CVS$/i
);
my
$path
=
File::
Spec
->
catdir
(
$templatedir
,
$dir
,
'custom'
);
push
(
@templatepaths
,
$path
)
if
(
-
d
$path
);
$path
=
File::
Spec
->
catdir
(
$templatedir
,
$dir
,
'extension'
);
push
(
@templatepaths
,
$path
)
if
(
-
d
$path
);
$path
=
File::
Spec
->
catdir
(
$templatedir
,
$dir
,
'default'
);
push
(
@templatepaths
,
$path
)
if
(
-
d
$path
);
}
}
# Precompile stuff. This speeds up initial access (so the template isn't
# compiled multiple times simultaneously by different servers), and helps
# to get the permissions right.
...
...
@@ -1267,12 +1246,25 @@ unless ($switch{'no_templates'}) {
# Don't hang on templates which use the CGI library
eval
(
"use CGI qw(-no_debug)"
);
$::template
=
Bugzilla::
Template
->
create
();
use
File::
Spec
;
opendir
(
DIR
,
$templatedir
)
||
die
"Can't open '$templatedir': $!"
;
my
@files
=
grep
{
/^[a-z-]+$/i
}
readdir
(
DIR
);
closedir
DIR
;
foreach
$::templatepath
(
@templatepaths
)
{
# Traverse the template hierarchy.
find
({
wanted
=>
\&
compile
,
no_chdir
=>
1
},
$::templatepath
);
}
foreach
my
$dir
(
@files
)
{
next
if
(
$dir
=~
/^CVS$/i
);
local
$ENV
{
'HTTP_ACCEPT_LANGUAGE'
}
=
$dir
;
SetParam
(
"languages"
,
"$dir,en"
);
$::template
=
Bugzilla::
Template
->
create
(
clean_cache
=>
1
);
my
@templatepaths
;
foreach
my
$subdir
(
qw(custom extension default)
)
{
$::templatepath
=
File::
Spec
->
catdir
(
$templatedir
,
$dir
,
$subdir
);
next
unless
-
d
$::templatepath
;
# Traverse the template hierarchy.
find
({
wanted
=>
\&
compile
,
no_chdir
=>
1
},
$::templatepath
);
}
}
}
}
...
...
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