Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Warning: require_once(Smarty/lib/Smarty.class.php)
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
Aristophan
Smarty Regular


Joined: 10 Jan 2011
Posts: 84

PostPosted: Thu May 23, 2013 8:54 am    Post subject: Reply with quote

Didn't we have this already? Smile
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. Wink SCNR!
Back to top
View user's profile Send private message
timmy5000
Smarty Rookie


Joined: 11 May 2013
Posts: 15

PostPosted: Fri May 24, 2013 5:23 am    Post subject: Reply with quote

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 Crying or Very sad 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
View user's profile Send private message
Aristophan
Smarty Regular


Joined: 10 Jan 2011
Posts: 84

PostPosted: Fri May 24, 2013 12:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Fri May 24, 2013 12:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
Aristophan
Smarty Regular


Joined: 10 Jan 2011
Posts: 84

PostPosted: Fri May 24, 2013 1:07 pm    Post subject: Reply with quote

Right! I was just about to edit Smarty_Compiler.class.php being v2. Wink [done]

http://www.smarty.net/docs/en/installing.smarty.basic.tpl [which is v3]
Back to top
View user's profile Send private message
Aristophan
Smarty Regular


Joined: 10 Jan 2011
Posts: 84

PostPosted: Fri May 24, 2013 1:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Fri May 24, 2013 4:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
Aristophan
Smarty Regular


Joined: 10 Jan 2011
Posts: 84

PostPosted: Fri May 24, 2013 4:41 pm    Post subject: Reply with quote

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. Wink
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
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Fri May 24, 2013 5:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Aristophan
Smarty Regular


Joined: 10 Jan 2011
Posts: 84

PostPosted: Fri May 24, 2013 6:18 pm    Post subject: Reply with quote

Thanks! [sidestep closed]
Back to top
View user's profile Send private message
timmy5000
Smarty Rookie


Joined: 11 May 2013
Posts: 15

PostPosted: Sat May 25, 2013 4:01 am    Post subject: Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Sat May 25, 2013 6:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Aristophan
Smarty Regular


Joined: 10 Jan 2011
Posts: 84

PostPosted: Sat May 25, 2013 8:27 am    Post subject: Reply with quote

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. Wink
Back to top
View user's profile Send private message
timmy5000
Smarty Rookie


Joined: 11 May 2013
Posts: 15

PostPosted: Mon May 27, 2013 4:17 am    Post subject: Reply with quote

Alright perfect. Thanks a ton for your help everyone. I highly appreciate it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Installation and Setup All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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