Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

bug report: when using configure file

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
yarco
Smarty Regular


Joined: 20 Mar 2009
Posts: 39

PostPosted: Fri Mar 20, 2009 10:32 am    Post subject: bug report: when using configure file Reply with quote

Code:
Code: 0
Error: Unable to load config file "index.conf"
File: /home/yarco/Public/workspace/code/coto/coto/entry/smarty3/sysplugins/internal.config.php
Line: 86


Code:
    public function buildConfigFilepath ()
    {
        foreach((array)$this->smarty->config_dir as $_config_dir) {
            $_filepath = $_config_dir . $this->config_resource_name; // line A
            if (file_exists($_filepath))
                return $_filepath;
        }
        // no tpl file found
        throw new Exception("Unable to load config file \"{$this->config_resource_name}\"");
        return false;
    }


it seems line A need a directory separator Smile
Back to top
View user's profile Send private message
yarco
Smarty Regular


Joined: 20 Mar 2009
Posts: 39

PostPosted: Fri Mar 20, 2009 3:17 pm    Post subject: Reply with quote

same error, need a directory separator

Code:

Code: 0
Error: Unable to load template "index/error_index.html"
File: /home/yarco/Public/workspace/code/coto/coto/entry/smarty3/sysplugins/internal.template.php
Line: 487


Code:

    public function buildTemplateFilepath ()
    {
        foreach((array)$this->smarty->template_dir as $_template_dir) {
            $_filepath = $_template_dir . $this->resource_name; // line A
            if (file_exists($_filepath))
                return $_filepath;
        }
        if (file_exists($this->resource_name)) return $this->resource_name;
        // no tpl file found
        throw new Exception("Unable to load template \"{$this->resource_name}\"");
        return false;
    }
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Fri Mar 20, 2009 3:37 pm    Post subject: Reply with quote

The default config_dir and template_dir do include all required directory separators.

$this->config_dir = '.' . DIRECTORY_SEPARATOR . 'configs' . DIRECTORY_SEPARATOR;

$this->template_dir = '.' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR;

The defaults of template_dir, compile_dir, cache_dir and config_dir assume that these folders are below the web space root directory.

If you have these folders somewhere else you must redefine template_dir, compile_dir, cache_dir and config_dir to point to reight location. Best is to specify an absolute filepath.
Back to top
View user's profile Send private message
yarco
Smarty Regular


Joined: 20 Mar 2009
Posts: 39

PostPosted: Fri Mar 20, 2009 3:54 pm    Post subject: Reply with quote

well, ok. but the previous version dont do that...
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Mar 20, 2009 5:03 pm    Post subject: Reply with quote

The internals need to check for a trailing directory separator, and add one if not present. That will get updated in SVN.
Back to top
View user's profile Send private message Visit poster's website
yarco
Smarty Regular


Joined: 20 Mar 2009
Posts: 39

PostPosted: Fri Mar 20, 2009 5:17 pm    Post subject: Reply with quote

great work! good job! (And the words like that i don't know in english)
i'm waiting it (smarty3) comming!
Dedicate some flowers first:
flowers => @}- @}- @}- @}- @}- ...
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP