cvs: pear /Template Template.php /Template/Template Multipath.php
| From: | Alan Knowles | Date: | Mon, 14 Jun 2004 08:53:49 +0000 |
| Subject: | cvs: pear /Template Template.php /Template/Template Multipath.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-20640@lists.php.net to get a copy of this message | ||
alan_k Mon Jun 14 04:53:49 2004 EDT
Modified files:
/pear/Template Template.php
/pear/Template/Template Multipath.php
Log:
more fixes. - make multisource provider return the error.., add todo note for source format ?? -
perhaps multisource should be source provider..
http://cvs.php.net/diff.php/pear/Template/Template.php?r1=1.7&r2=1.8&ty=u
Index: pear/Template/Template.php
diff -u pear/Template/Template.php:1.7 pear/Template/Template.php:1.8
--- pear/Template/Template.php:1.7 Mon Jun 14 04:37:17 2004
+++ pear/Template/Template.php Mon Jun 14 04:53:49 2004
@@ -33,7 +33,7 @@
* See example usage and in-progress documentation at {@link
* http://wiki.ciaweb.net/yawiki/index.php?area=Template}
*
-* $Id: Template.php,v 1.7 2004/06/14 08:37:17 alan_k Exp $
+* $Id: Template.php,v 1.8 2004/06/14 08:53:49 alan_k Exp $
*
* @package Template
*
@@ -218,6 +218,10 @@
}
+ // TODO: accept other input:
+ // eg. file handle is_resource(), or string is_string() :
+ // probably want to add another provider for this...
+
// If we are using any of the fancy path stuff. - let the multisource provider work
// out where the template is..
@@ -232,19 +236,19 @@
$this->files['current_template'] =
$this->options['template_dir'][0] . PATH_SEPERATOR . $file;
+
if (!file_exists($this->files['current_template'])) {
- $this->files['current_template'] = false;
+ // cant find the template!!!
+ return $this->raiseError(
+ "Could not find Template %s in any of the configured path %s" .
+ implode(", ",$this->options['template_dir']) ,
+ TEMPLATE_ERROR_INVALIDARGS, TEMPLATE_ERROR_DIE,
+ array($file, $this->options['template_dir'][0]);
}
- }
- // cant find the template!!!
- if ($this->files['current_template'] === false) {
- // check if the compile dir has been created
- return $this->raiseError(
- "Could not find Template {$file} in any of the directories<br>" .
- implode("<BR>",$this->options['template_dir']) ,
- HTML_ERROR_INVALIDARGS, TEMPLATE_ERROR_DIE);
}
+
+
// What type of compiler - do we need to do anything..
http://cvs.php.net/diff.php/pear/Template/Template/Multipath.php?r1=1.3&r2=1.4&ty=u
Index: pear/Template/Template/Multipath.php
diff -u pear/Template/Template/Multipath.php:1.3 pear/Template/Template/Multipath.php:1.4
--- pear/Template/Template/Multipath.php:1.3 Mon Jun 14 04:44:46 2004
+++ pear/Template/Template/Multipath.php Mon Jun 14 04:53:49 2004
@@ -16,7 +16,7 @@
// | Authors: alan@akkbhome.com |
// +----------------------------------------------------------------------+
//
-// $Id: Multipath.php,v 1.3 2004/06/14 08:44:46 alan_k Exp $
+// $Id: Multipath.php,v 1.4 2004/06/14 08:53:49 alan_k Exp $
//
// Multipath Provider - checks mulitple paths for the source of a template
//
@@ -145,7 +145,7 @@
// look in all the posible locations for the template directory..
if ($files['currentTemplate'] === false) {
- $dirs = array_unique($options['templateDir']);
+ $dirs = array_unique($options['template_dir']);
if ($options['multisource.order'] == 'reverse') {
$dirs = array_reverse($dirs);
}
@@ -165,6 +165,13 @@
$files['current_template'] = $tmplDir . DIRECTORY_SEPARATOR . $file;
$files['current_template_from_dir'] = $tmplDir;
}
+ }
+ if ($files['currentTemplate'] === false) {
+ return $this->template->raiseError(
+ "Could not find Template %s in any of your paths (%s)" .
+ "Than once, (in %s and %s)",
+ TEMPLATE_ERROR_INVALIDARGS, TEMPLATE_ERROR_DIE,
+ array($file, implode(PATH_SEPERATOR, $options['template_dir'])));
}
return true;