[Petal] Petal constructor broken?

William McKee william@knowmad.com
Mon, 5 Aug 2002 16:07:11 -0400


--Message-Boundary-6363
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body

Jean-Michel,

It looks like you changed several of the subroutines in Petal 0.5 which 
has broken the ability to call Petal->new with the arguments such as 
base_dir, taint, etc. Here's the code I use to call Petal:

		$template = new Petal (
			base_dir => $tmpl_path,
			file => $template_file,
			disk_cache => 1,
			memory_cache => 1,
			taint => 1,
		);

Since your Synopsis in Petal 0.5 still shows this format, I presume it was 
not intentional to disable this ability? I've attached a diff with my mods 
to _code_memory_cached and _file_path which gets the script working for 
me. I don't know if the others are working or not (well, file is 
apparently still working but I didn't check the cache settings). Please 
review closely as I'm not exactly sure my patches play nicely with your 
code. There's probably a better way to do it anyhow.

William

-- 
 Lead Developer
 Knowmad Services Inc. || Internet Applications & Database Integration
 http://www.knowmad.com
 



--Message-Boundary-6363
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Text from file 'petal.diff'

225a226
>     $BASE_DIR = $self->{'base_dir'} if exists($self->{'base_dir'});
309a311,313
> 	unless ($TAINT) {
> 		$TAINT = ($self->{'taint'}) || 0;
> 	}

--Message-Boundary-6363--