Re: [SMARTY] templates_c

From: Date: Tue, 24 Jun 2003 22:38:26 +0000
Subject: Re: [SMARTY] templates_c
References: 1 2 3  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9774@lists.php.net to get a copy of this message
On Tue, Jun 24, 2003 at 09:59:44PM +0200, Wilhelm Kutting wrote: > What i am trying to do is i.e. to put the templates_c tree under > /var/cache. it's okay if you only have one application that uses smarty on that host. if not you should have a cache directory for each. if you want under "/var". > That seems to me a better Linuxconform place for it. > Do I run into trouble if a lot of webservers use this dir too? you mean another application claims to use "/var/cache" for it's semi-persistent data? then you should get creative and choose anothe name, of course. > But I seem to run into trouble too when I put the template_c somewhere > else than the webserver also with the the dirs to the ownership of the > apache-user? you don't get into trouble, if you tell smarty the full path to your templates_c . regarding ownership: i chgrp my templates_c to the apache-users group. then i make it sgid ("chmod g+s templates_c") so that files and directories that are created below templates_c get the same group-ownership as templates_c (read the webserver's). after that i make this directory group-writable and apache and smarty write happily into it. and they retain write access to the files they created previously. i don't see any problems here. > In article <20030624125921.GF3767@pharao.lammfellpuschen.de>, > messju@lammfellpuschen.de says... > > On Tue, Jun 24, 2003 at 02:05:11PM +0200, Wilhelm Kutting wrote: > > > hi, > > > i do not know where is the best way to config the path of templates_c > > > and the cache dir on a linux system. > > > > (i don't know if i understand your question 100%, but anyway:) > > > > there are two common ways: > > > > $smarty = new Smarty(); > > $smarty->compile_dir = ... > > > > > > or > > > > class My_Smarty extends Smarty { > > function My_Smarty() { > > $this->Smarty(); > > $this->compile_dir = ... > > } > > } > > $smarty = new My_Smarty; > > > > > > > > i normally use the former in a config.php that is included by all > > php-files that are exposed to the web. > > > > as a starter: > > > > the vague directory-layout of BASEDIR: > > /config.php > > /html/ <- this is the servers document-root > > /html/index.php > > /html/images/ > > /html/... > > /lib/smarty/ <-- smarty's libs/directory > > /lib/smarty/Smarty.class.php > > /lib/smarty/plugins/... <-- smartys distribution's plugins > > /lib/... <- other third party stuff > > /templates/ <- guess :) > > /php/ <- other php-stuff, that can be invisible via http > > /php/plugins/ <- application-specific plugins > > /phptmp/ <- stuff where the webserver wants to write into > > /phptmp/templates_c/ > > /phptmp/cache/ > > /phptmp/sessions/ > > ... > > > > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.smarty.general (#9774) next »