Page MenuHomePhabricator

Get rid of compiled_templates folder and use MW cache
Open, NormalPublic

Description

Author: sergey.chernyshev

Description:
Rewrite using Smarty 3 to get rid of compiled_templates folder that causes most of the installation issues.

Use MediaWiki cache capabilities instead.


Version: unspecified
Severity: major

Details

Reference
bz18914

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 21 2014, 10:38 PM
bzimport set Reference to bz18914.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.May 25 2009, 5:18 PM

I consider this a bug, not an enhancement because it breaks wiki farms.

Widgets requires Apache-write rights in a code-directory that is inside the shared code base. Many wikis all attempt to write into the same code folder here.

The enhancement of reducing the update hassle would also be welcome, of course. With each minor version update, the rights to the folder have to be recreated (as a result of widgets being distributed as svn-tagged version, requiring to delete previous version before checking out the update).

Mediawiki has an explicitly directory for such purposes:

$wgCacheDirectory - Directory for caching data in the local filesystem.

  • this works well on a wikifarm.

sergey.chernyshev wrote:

Can you try using "svn switch" and check if it breaks the permissions to the folder too?

I think until Smarty 3 rewrite will happen, pathing problem can be solved by introducing a new variable, e.g. $wgWidgetsCompiledTemplates which admins can set to "$wgCacheDirectory/widgets_compiled_templates" or something like that, making sure the folder is writable.

If variable is not set, extension will fall back to old method.

Simple change can be made to http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Widgets/WidgetRenderer.php?view=markup line 14 to use $wgWidgetsCompiledTemplates instead of default value if it is set.

Can you try using "svn switch"

thanks, I confirm this is a better method in this case. First time it matters, I have to admit I overlooked this.

I think until Smarty 3 rewrite will happen, pathing problem can be solved by
introducing a new variable, e.g. $wgWidgetsCompiledTemplates which admins can
set to "$wgCacheDirectory/widgets_compiled_templates" or something like that,
making sure the folder is writable.

I think the new variable does not necessarily needs to be set during installation (making it adjustable is a plus of course). $wgCacheDirectory is writable by webserver/php if it is used at all. Thus the folder can be easily created in the code.
Fallback: if $wgCacheDirectory is false (default if no caching is used), then use $wgUploadDirectory, else fall back to present behavior.

demon removed a subscriber: demon.Dec 16 2014, 7:57 PM
tosfos added a subscriber: tosfos.Apr 30 2019, 1:52 PM
Kghbln added a subscriber: Kghbln.Apr 30 2019, 1:58 PM