|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
jpitcher Smarty n00b
Joined: 30 Jun 2013 Posts: 1
|
Posted: Sun Jun 30, 2013 10:17 pm Post subject: Smarty 3.1.14 |
|
|
I have installed and setup smarty 3.1.14
And I am running into a huge amount of files not getting included...
Here is what I have setup for smarty.
Code: |
@define(SMARTY_DIR, BB_APP_PATH . 'classes/smarty/');
@define(SMARTY_SYSPLUGINS_DIR . SMARTY_DIR . 'sysplugins/');
@define(SMARTY_TEMPLATE_DIR, BB_APP_PATH . 'templates/basic/');
include_once(SMARTY_DIR . 'Smarty.class.php');
$smarty = new \Smarty();
$smarty->setTemplateDir(SMARTY_TEMPLATE_DIR);
$smarty->setCompileDir(SMARTY_DIR . 'templates_c/');
$smarty->setCacheDir(SMARTY_DIR . 'cache/');
$smarty->display('main.tpl');
|
Now first off, I am in a heavily namespace usage application.
When I first launch it I get the following error.
Code: |
Warning: require_once(Smarty_Internal_Utility.php): failed to open stream: No such file or directory in /Library/WebServer/vhosts/v2_beamboard/includes/setup.php on line 8 Fatal error: require_once(): Failed opening required 'Smarty_Internal_Utility.php' (include_path='.:') in /Library/WebServer/vhosts/v2_beamboard/includes/setup.php on line 8 |
That line is the auto loader for the application.
As you can see above I have all the variables set, but it seems to ignore the constants if the classes are extended.
So if I go into 'Smarty.class.php' and add the following to always load section, starting at line 95
Code: |
include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_templatecompilerbase.php';
|
The error goes away. But of course more errors occur. Now I can easily fix this on my own with an includes path ...
But shouldn't smarty pay attention to the defined variables above ?
or did I noob up something simple...
Thanks!!! |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Mon Jul 01, 2013 1:43 pm Post subject: |
|
|
It does look like that your application autoloader tries to load the Smarty classes and does not correctly pass the request to Smarty's autoloader. |
|
Back to top |
|
bsmither Smarty Elite
Joined: 20 Dec 2011 Posts: 322 Location: West Coast
|
Posted: Sat Jul 06, 2013 5:38 pm Post subject: |
|
|
Are these typos?
@define(SMARTY_SYSPLUGINS_DIR . SMARTY_DIR . 'sysplugins/');
$smarty = new \Smarty(); |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Jul 06, 2013 6:09 pm Post subject: |
|
|
It should be
Code: | define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins/'); |
$smarty = new \Smarty(); makes use of namespaces PHP >= 5.3.0 |
|
Back to top |
|
|
|
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
|