Re: [SMARTY] Problem when moving directories

[email protected] (Jochem Maas) Tue, 02 May 2006 01:56:36 +0200
Newsgroups php.smarty.general
Message-ID <[email protected]>
Tony K. wrote:
> I have been developing a website using smarty on my local (linux)
> server.  It has been working OK so far. I have a file called setup.php
> which includes:
> 
> ***************************************************
> define('SMARTY_DIR', '/usr/share/php/smarty/libs/');
> require(SMARTY_DIR . 'Smarty.class.php');
> 
> class Smarty_Test extends Smarty {
> 
>   function Smarty_Website(){
> 
>        $this->Smarty();
>        $this->template_dir = '/var/www/html/foobar/public_html/templates';
>        $this->compile_dir  = 
> '/var/www/html/foobar/public_html/templates_c';
>        $this->config_dir   = '/var/www/html/foobar/public_html/configs';
>        $this->cache_dir   = '/var/www/html/foobar/public_html/cache';

I suggest you make the above self-determining or at least define a
constant like SMARTY_DIR in your config to point to the root of your
smarty data dirs.

>        $this->caching = true;
>        $this->assign('app_name', 'test');
>   }
> }
> ***************************************************
> 
> This file is required() by the index.php page.
> 
> However, when I tried moving all the directories (cache, config,
> template, template_c) and associated files except the index.php page

I assume that your not moving the files in cache and templates_c - I'd
let them be auto-regenerated.

the permissions, as someone else pointed out, is a good point to consider.