smarty autoload causing problems

85 views
Skip to first unread message

Dazzle CMS

unread,
Nov 5, 2009, 1:20:40 AM11/5/09
to Smarty Developers
Hey guys yet i found another issues as im working with smarty 3 alogn
with developing my cms and extending its class but yet smarty 3
creates its own autoload class which was working fine before took me a
while to find the problem which was kicking my custom autoload out
does smarty have some way to also register my own or there something
which i have to change for example i have an class loader basically
its an abstract class that will atempt to register an class to its not
includes all the time and only loads when its needed to save memory
etc

but before the class itself i register the class like this sample
below is my snipet of my source

<?php

/**
* @package Dazzle CMS
* @copyright Copyright (c) 2009, Dazzle CMS, Inc.
* @license http://www.opensource.org/licenses/gpl-3.0.html
* @link http://www.dazzlecms.com
* @filesource version.php
*/

/**
* @ignore
*/
if (!defined('DAZZLE_CMS'))
{
exit;
}

spl_autoload_register(array('loader','load'));

/**
* libaries loader
*
* @package dazzle
* @since 1.0
*/
abstract class loader
{
private static $paths = array();

private static $classes = array();

static protected $_instance = NULL;

etc

xuanyan

unread,
Nov 5, 2009, 8:18:08 AM11/5/09
to Smarty Developers
you can read this: http://groups.google.com/group/smarty-developers/browse_thread/thread/b351e45ab5b0ff4e?hl=en

i found the problem too. a simple method to fix it is :

before you require smarty, you register spl_funcion by yourself first:

spl_autoload_register(); // do it first, please try : )
spl_autoload_register(array('loader','load'));


Monte Ohrt

unread,
Nov 5, 2009, 9:30:13 AM11/5/09
to smarty-d...@googlegroups.com
Have you tried the latest SVN of Smarty3Beta? Be sure you test that, we have committed patches for the autoloader.

Dazzle CMS

unread,
Nov 5, 2009, 3:03:47 PM11/5/09
to Smarty Developers
@Monte i will check that out thought i was running the lastest as i
use your svn and checkout every few days

and thanks Xuanyan i will take a look at that right now

Steve :)

On Nov 5, 7:30 am, Monte Ohrt <mo...@ohrt.com> wrote:
> Have you tried the latest SVN of Smarty3Beta? Be sure you test that, we have
> committed patches for the autoloader.
>
> On Thu, Nov 5, 2009 at 7:18 AM, xuanyan <xuanyan1...@gmail.com> wrote:
>
> > you can read this:
> >http://groups.google.com/group/smarty-developers/browse_thread/thread...

xuanyan

unread,
Nov 5, 2009, 9:28:55 PM11/5/09
to Smarty Developers
it works well~ thank you~~~

On Nov 5, 10:30 pm, Monte Ohrt <mo...@ohrt.com> wrote:
> Have you tried the latest SVN of Smarty3Beta? Be sure you test that, we have
> committed patches for the autoloader.
>
> On Thu, Nov 5, 2009 at 7:18 AM, xuanyan <xuanyan1...@gmail.com> wrote:
>
> > you can read this:
> >http://groups.google.com/group/smarty-developers/browse_thread/thread...

Dazzle CMS

unread,
Nov 5, 2009, 11:04:38 PM11/5/09
to Smarty Developers
everything works great here also great job :) p.s i noticed the svn
layout changed too as i had to recreate my svn

Steve :)
Reply all
Reply to author
Forward
0 new messages