RE: [SMARTY] Problems with using smarty on my hosting
| From: | Peter Billen | Date: | Tue, 13 Aug 2002 13:11:24 +0000 |
| Subject: | RE: [SMARTY] Problems with using smarty on my hosting | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5667@lists.php.net to get a copy of this message | ||
Doh! I looked twice to the vars. list, but couldn't see it.
Thanks, that helps too :)
Peter
-----Original Message-----
From: Rasmus T. Mohr [mailto:rmo@netpointers.com]
Sent: dinsdag 13 augustus 2002 15:05
To: peter@clueless.be; smarty-general@lists.php.net
Subject: RE: [SMARTY] Problems with using smarty on my hosting
>From Smarty.class.php:
var $use_sub_dirs = true; // use sub dirs for cache and compiled files?
// sub directories are more efficient, but
// you can set this to false if your PHP
environment
// does not allow the creation of them.
-----------------------------------------------------------
Rasmus T. Mohr Phone : +45 70 117 117
Application Developer Direct : +45 36 910 122
Netpointers Intl. Mobile : +45 28 731 827
Vestergade 18 B Website : www.netpointers.com
1456 Copenhagen K Email : rmo@netpointers.com
> -----Original Message-----
> From: Peter Billen [mailto:peter@clueless.be]
> Sent: Tuesday, August 13, 2002 3:01 PM
> To: 'lukas pitschl'; smarty-general@lists.php.net
> Subject: RE: [SMARTY] Problems with using smarty on my hosting
>
>
> Cool! Works perfect :)
>
> Thanks a lot Lukas!
>
> Peter
>
> -----Original Message-----
> From: lukas pitschl [mailto:lukas@dressyvagabonds.com]
> Sent: dinsdag 13 augustus 2002 14:56
> To: smarty-general@lists.php.net
> Subject: Re: [SMARTY] Problems with using smarty on my hosting
>
> Hi Peter,
>
> Once i got the same error that you get, but then someone sent
> me a patch
> which will fix that problem.
>
> You only have to extend the Smarty class with this class:
>
> /**
> * This class extends the smarty template engine.
> * All configuration and returning of smarty objects
> * is done by this class
> *
> * @author lukas pitschl <l.pitschl@peer.biz>
> * @copyright peer internet solutions
> * @package base
> * @version $Id: ecSmarty.class.php,v 1.2 2002/08/07 15:02:17 lukas
> Exp $
> */
>
> class PatchedSmarty extends Smarty {
>
> /*============================================================
> ==========
> *\
> Function: _get_auto_base
> Purpose: Get a base name for automatic files creation
> \*============================================================
> ==========
> */
> function _get_auto_base($auto_base, $auto_source)
> {
> $source_md5 = md5($auto_source);
>
> $res = $auto_base . DIR_SEP . $source_md5;
>
> return $res;
> }
>
> /*============================================================
> ==========
> *\
> Function: _get_auto_filename
> Purpose: get a concrete filename for automagically
> created content
> \*============================================================
> ==========
> */
> function _get_auto_filename($auto_base, $auto_source, $auto_id =
> null)
> {
> $res = $this->_get_auto_base($auto_base, $auto_source) .
> '-' . md5($auto_id) . '.php';
>
> return $res;
> }
>
> /*============================================================
> ==========
> *\
> Function: _rm_auto
> Purpose: delete an automagically created file by name and id
> \*============================================================
> ==========
> */
> function _rm_auto($auto_base, $auto_source = null,
> $auto_id = null)
> {
> if (!is_dir($auto_base))
> return false;
>
> if (!isset($auto_source)) {
> $res = $this->_rmdir($auto_base, 0);
> } else {
> if (isset($auto_id)) {
> $tname = $this->_get_auto_filename($auto_base,
> $auto_source, $auto_id);
> $res = is_file($tname) && unlink( $tname);
> } else {
> $tname = $this->_get_auto_base($auto_base,
> $auto_source);
> $tdir = dirname( $tname );
> $tbase = basename( $tname );
>
> $dh = opendir( $tdir );
> while( $entry = readdir( $dh ) ) {
> if( substr( $entry, 0, strlen( $tbase ) ) == $tbase )
> unlink( $tdir . DIR_SEP . $entry );
> }
> $res = true;
> }
> }
>
> return $res;
> }
> }
>
> It worked for me hope it works for you!
>
> Am Die, 2002-08-13 um 14.47 schrieb Peter Billen:
> > Hi all,
> >
> > My hosting runs on SAFE MODE, so now I get the following errors:
> >
> > Warning: SAFE MODE Restriction in effect. The script whose
> uid is 490
> is
> > not allowed to access templates_c/%%705 owned by uid 15 in
> > /home/sites/site69/users/test/web/Smarty.class.php on line 1604
> >
> > Warning: Smarty error: problem creating directory
> > "templates_c/%%705/%%705129116" in
> > /home/sites/site69/users/test/web/Smarty.class.php on line 589
> >
> > Warning: Smarty error: problem writing
> > 'templates_c/%%705/%%705129116/site.html.php.' in
> > /home/sites/site69/users/test/web/Smarty.class.php on line 589
> >
> > Warning: Failed opening
> 'templates_c/%%705/%%705129116/site.html.php'
> > for inclusion (include_path='.:/usr/local/lib/php') in
> > /home/sites/site69/users/test/web/Smarty.class.php on line 686
> >
> > My templates_c has chmod 777 and I'm not using any kind of
> caching. My
> > scripts are running on error_reporting(E_ALL);
> >
> > What is wrong?
> >
> > Thanks,
> >
> > Peter
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php