View previous topic :: View next topic |
Author |
Message |
Aristophan Smarty Regular
Joined: 10 Jan 2011 Posts: 96
|
Posted: Thu May 23, 2013 8:54 am Post subject: |
|
|
Didn't we have this already?
The error clearly says: Code: | PHP Fatal error: Class 'Smarty' not found in /home/USERNAME/public_html/include/smarty/libs/Smarty_Compiler.class.php on line 35 |
If that was set correctly, like already advised i.e. require_once('lib/Smarty.class.php'); or the CONSTANT solution, it can be only some old cache issue in your compiler directory eg 'templates_c'. Clear this to recompile.
If that all does not help, have a walk instead of watching AdultVideos. SCNR! |
|
Back to top |
|
timmy5000 Smarty Rookie
Joined: 11 May 2013 Posts: 15
|
Posted: Fri May 24, 2013 5:23 am Post subject: |
|
|
I actually believe that's a new error because in the start we had
Code: |
/public_html/smarty/CustomSmarty.php
|
And not
Code: |
PHP Fatal error: Class 'Smarty' not found in /home/USERNAME/public_html/include/smarty/libs/Smarty_Compiler.class.php on line 35 |
And hey I'm tryina make some income from AdultVideos lol
Oh and I checked templates_c, they doesn't seem to be any file there.
Do you want me to add require_once('lib/Smarty.class.php'); to smarty_compiler? |
|
Back to top |
|
Aristophan Smarty Regular
Joined: 10 Jan 2011 Posts: 96
|
Posted: Fri May 24, 2013 12:28 pm Post subject: |
|
|
No. It says Code: | Class 'Smarty' not found |
try again in your '/home/USERNAME/public_html/the calling.php' Code: | @define('SMARTY_DIR', '/home/USERNAME/public_html/Smarty/libs/');
if (!class_exists('Smarty')) {
include SMARTY_DIR . 'Smarty.class.php';
}
or start
require_once('Smarty/libs/Smarty.class.php');
or end
// debugging...
$smarty->testInstall();exit;
|
and run the testInstall() to see if all path are set well.
Note: Smarty default lives in 'libs'! Do not put your initial class in there. Rename examples 'Smarty/' to the directory where 'libs' is in.
Last edited by Aristophan on Fri May 24, 2013 1:08 pm; edited 1 time in total |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri May 24, 2013 12:58 pm Post subject: |
|
|
You must have a big mess of Smarty versions on your system....
Smarty_Compiler.class.php belongs to the Smarty2 release.
Error messages like
Quote: | Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/home/USERNAME/public_html/smarty/templates/index.html" on line 1 "{extends file=\"base_template.html\"}" - Unexpected "\"' in /home/USERNAME/public_html/smarty/lib/sysplugins/smarty_internal_templatecompilerbase.php:665 Stack trace: #0 |
indicate that Smarty3 was called.
Smarty2 and Smarty3 are not compatible to each other and are complete different releases. From post to post it looks like that you have completely different configurations that makes it almost impossible to put you on the right track.
First you must make a decission if Smarty2 or Smarty3 should be used and make a clean installation of the corresponding solution.
You said you have bought the package so I assume you go Smarty with that package. You should stick with the version you originally got. |
|
Back to top |
|
Aristophan Smarty Regular
Joined: 10 Jan 2011 Posts: 96
|
|
Back to top |
|
Aristophan Smarty Regular
Joined: 10 Jan 2011 Posts: 96
|
Posted: Fri May 24, 2013 1:33 pm Post subject: |
|
|
U.Tews wrote: | Smarty2 and Smarty3 are not compatible to each other and are complete different releases. |
Btw, may I just make a captured sidewalk on this?
We recently had someone calling a Plugin (in the meaning of Plugin, not Smarty) which included the Menalto Gallery2 (still using Smarty2 for templates) to output to our Smarty templates. Since we upgraded to Smarty3 this got in conflicts, which even could not get solved using the BC class.
Is there a possibility to capsulate or restrict the framework using Smarty3 to encapsulate the older one without messing around? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri May 24, 2013 4:05 pm Post subject: |
|
|
Aristophan wrote: |
We recently had someone calling a Plugin (in the meaning of Plugin, not Smarty) which included the Menalto Gallery2 (still using Smarty2 for templates) to output to our Smarty templates. Since we upgraded to Smarty3 this got in conflicts, which even could not get solved using the BC class.
Is there a possibility to capsulate or restrict the framework using Smarty3 to encapsulate the older one without messing around? |
PHP > 5.3 did introduce namspaces for such purpose. |
|
Back to top |
|
Aristophan Smarty Regular
Joined: 10 Jan 2011 Posts: 96
|
Posted: Fri May 24, 2013 4:41 pm Post subject: |
|
|
U.Tews wrote: | Aristophan wrote: |
Is there a possibility to capsulate or restrict the framework using Smarty3 to encapsulate the older one without messing around? |
PHP > 5.3 did introduce namspaces for such purpose. |
Thank you, I dreaded you would say something like this, Uwe.
But this does mean we have to allow >= PHP 5.3 only to support this, right?
Since upcoming Smarty 3.2 will support Namespaces, would we also need to wait for this, or would we only need to expose / encapsulate Smarty itself in a namespace? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri May 24, 2013 5:00 pm Post subject: |
|
|
Namespace support of 3.2 does cover to use namspaced classes their static varibales and constants in templates with some extended syntax for it.
But isolating packages on PHP script level is something you could do today if you have PHP > 5.3 |
|
Back to top |
|
Aristophan Smarty Regular
Joined: 10 Jan 2011 Posts: 96
|
Posted: Fri May 24, 2013 6:18 pm Post subject: |
|
|
Thanks! [sidestep closed] |
|
Back to top |
|
timmy5000 Smarty Rookie
Joined: 11 May 2013 Posts: 15
|
Posted: Sat May 25, 2013 4:01 am Post subject: |
|
|
Aristophan wrote: | No. It says Code: | Class 'Smarty' not found |
try again in your '/home/USERNAME/public_html/the calling.php' Code: | @define('SMARTY_DIR', '/home/USERNAME/public_html/Smarty/libs/');
if (!class_exists('Smarty')) {
include SMARTY_DIR . 'Smarty.class.php';
}
or start
require_once('Smarty/libs/Smarty.class.php');
or end
// debugging...
$smarty->testInstall();exit;
|
and run the testInstall() to see if all path are set well.
Note: Smarty default lives in 'libs'! Do not put your initial class in there. Rename examples 'Smarty/' to the directory where 'libs' is in. |
I'll run the test but I'm really confused with the note you posted.
" Smarty default lives in 'libs'! Do not put your initial class in there. Rename examples 'Smarty/' to the directory where 'libs' is in."
Do you mean to say that the Smarty folder should actually be a sub-folder and the main folder should be libs. For example public_html/libs/smarty/ETC ETC?
U.Tews wrote: | You must have a big mess of Smarty versions on your system....
Smarty_Compiler.class.php belongs to the Smarty2 release.
Error messages like
Quote: | Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/home/USERNAME/public_html/smarty/templates/index.html" on line 1 "{extends file=\"base_template.html\"}" - Unexpected "\"' in /home/USERNAME/public_html/smarty/lib/sysplugins/smarty_internal_templatecompilerbase.php:665 Stack trace: #0 |
indicate that Smarty3 was called.
Smarty2 and Smarty3 are not compatible to each other and are complete different releases. From post to post it looks like that you have completely different configurations that makes it almost impossible to put you on the right track.
First you must make a decission if Smarty2 or Smarty3 should be used and make a clean installation of the corresponding solution.
You said you have bought the package so I assume you go Smarty with that package. You should stick with the version you originally got. |
I think I know the problem is. The software I'm using hasn't been updated for couple of months and I installed the latest Smarty version through a YouTube video so possibly you are right with the version numbers.
Is there any tutorial on Smarty forums that shows you how to install Smarty? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat May 25, 2013 6:54 am Post subject: |
|
|
See some notes on installation here.
http://www.smarty.net/docs/en/installing.smarty.basic.tpl
Try to get rid of the Smarty mess on your system first, so that you can stratover with a fresh installation.
Note that your package may have custom plugins normally in the plugins folder which you need to copy into your new Smarty installation. |
|
Back to top |
|
Aristophan Smarty Regular
Joined: 10 Jan 2011 Posts: 96
|
Posted: Sat May 25, 2013 8:27 am Post subject: |
|
|
Quote: | Do you mean to say that the Smarty folder should actually be a sub-folder and the main folder should be libs. For example public_html/libs/smarty/ETC ETC? |
No. I meant to say: Install Smarty (/demo and /libs) where it suits you best. And point your installation class or script (somewhere else) to this Smarty dir in the way described.
And read some basics! You just proved, that watching YouTube can give an idea, but can never circumvent reading the docs. |
|
Back to top |
|
timmy5000 Smarty Rookie
Joined: 11 May 2013 Posts: 15
|
Posted: Mon May 27, 2013 4:17 am Post subject: |
|
|
Alright perfect. Thanks a ton for your help everyone. I highly appreciate it. |
|
Back to top |
|
|