Committer: ailyin
do not call res_includes in non-web contextU trunk/cgi-bin/LJ/HTML/Template.pm
Modified: trunk/cgi-bin/LJ/HTML/Template.pm =================================================================== --- trunk/cgi-bin/LJ/HTML/Template.pm 2010-12-17 07:21:13 UTC (rev 17957) +++ trunk/cgi-bin/LJ/HTML/Template.pm 2010-12-17 07:22:05 UTC (rev 17958) @@ -14,10 +14,19 @@ 'lj_sitename' => $LJ::SITENAMESHORT, 'lj_sslroot' => $LJ::SSLROOT, 'lj_jsprefix' => $LJ::JSPREFIX, - 'lj_res_includes_basic' => LJ::res_includes({ 'only_needed' => 1 }), - 'lj_res_includes' => LJ::res_includes(), ); + if ( LJ::is_web_context() ) { + %common_params = ( + %common_params, + + 'lj_res_includes_basic' + => LJ::res_includes({ 'only_needed' => 1 }), + + 'lj_res_includes' => LJ::res_includes(), + ); + } + if ($opts->{'use_expr'}) { require HTML::Template::Pro; # load module on demand