[geeklog-hg] geeklog: Changed so that error information in template.class.php...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sat Nov 28 03:15:14 EST 2015
changeset 9653:b8bec77880d4
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/b8bec77880d4
user: Kenji ITO <mystralkk at gmail.com>
date: Sat Nov 28 17:14:19 2015 +0900
description:
Changed so that error information in template.class.php will be logged into the error.log when Developer mode is set to true.
diffstat:
system/classes/template.class.php | 2347 +++++++++++++++++-------------------
1 files changed, 1125 insertions(+), 1222 deletions(-)
diffs (truncated from 3178 to 300 lines):
diff -r f109827fb495 -r b8bec77880d4 system/classes/template.class.php
--- a/system/classes/template.class.php Sat Nov 28 17:10:31 2015 +0900
+++ b/system/classes/template.class.php Sat Nov 28 17:14:19 2015 +0900
@@ -1,4 +1,5 @@
<?php
+
// +--------------------------------------------------------------------------+
// | Geeklog 2.0 |
// +--------------------------------------------------------------------------+
@@ -42,7 +43,6 @@
// | |
// +--------------------------------------------------------------------------+
-
/**
* The template class allows you to keep your HTML code in some external files
* which are completely free of PHP code, but contain replacement fields.
@@ -50,288 +50,281 @@
* with arbitrary strings. These strings can become very large, e.g. entire tables.
*
* Note: If you think that this is like FastTemplates, read carefully. It isn't.
- *
*/
/* This should be the only Geeklog-isms in the file. Didn't want to "infect" the class but it was necessary.
* These options are global to all templates.
*/
-$xhtml = '';
-if (defined('XHTML')) { // usually not defined yet but will be later
- $xhtml = XHTML;
-}
+
+// Usually not defined yet but will be later
+$xhtml = defined('XHTML') ? XHTML : '';
+
$TEMPLATE_OPTIONS = array(
- 'path_cache' => $_CONF['path_data'].'layout_cache/', // location of template cache
- 'path_prefixes' => array( // used to strip directories off file names. Order is important here.
- $_CONF['path_themes'], // this is not path_layout. When stripping directories, you want files in different themes to end up in different directories.
- $_CONF['path'],
- '/' // this entry must always exist and must always be last
- ),
+ 'path_cache' => $_CONF['path_data'] . 'layout_cache/', // location of template cache
+ 'path_prefixes' => array( // used to strip directories off file names. Order is important here.
+ $_CONF['path_themes'], // this is not path_layout. When stripping directories, you want files in different themes to end up in different directories.
+ $_CONF['path'],
+ '/' // this entry must always exist and must always be last
+ ),
'incl_phpself_header' => true, // set this to true if your template cache exists within your web server's docroot.
- 'cache_by_language' => true, // create cache directories for each language. Takes extra space but moves all $LANG variable text directly into the cached file
- 'default_vars' => array( // list of vars found in all templates.
- 'xhtml' => $xhtml, // Will be reset by lib-common
- 'site_url' => $_CONF['site_url'],
- 'site_admin_url' => $_CONF['site_admin_url'],
- 'layout_url' => $_CONF['layout_url'], // Can be set by lib-common on theme change
- 'anonymous_user' => true, // Set to false in lib-common if current visitor is logged in
+ 'cache_by_language' => true, // create cache directories for each language. Takes extra space but moves all $LANG variable text directly into the cached file
+ 'default_vars' => array( // list of vars found in all templates.
+ 'xhtml' => $xhtml, // Will be reset by lib-common
+ 'site_url' => $_CONF['site_url'],
+ 'site_admin_url' => $_CONF['site_admin_url'],
+ 'layout_url' => $_CONF['layout_url'], // Can be set by lib-common on theme change
+ 'anonymous_user' => true, // Set to false in lib-common if current visitor is logged in
- ),
- 'hook' => array(),
+ ),
+ 'hook' => array(),
);
class Template
{
- /**
- * Serialization helper, the name of this class.
- *
- * @var string
- * @access public
- */
- var $classname = "Template";
+ /**
+ * Serialization helper, the name of this class.
+ *
+ * @var string
+ */
+ public $classname = 'Template';
- /**
- * Determines how much debugging output Template will produce.
- * This is a bitwise mask of available debug levels:
- * 0 = no debugging
- * 1 = debug variable assignments
- * 2 = debug calls to get variable
- * 4 = debug internals (outputs all function calls with parameters).
- * 8 = debug caching (incomplete)
- *
- * Note: setting $this->debug = true will enable debugging of variable
- * assignments only which is the same behaviour as versions up to release 7.2d.
- *
- * @var int
- * @access public
- */
- var $debug = 0;
+ /**
+ * Determines how much debugging output Template will produce.
+ * This is a bitwise mask of available debug levels:
+ * 0 = no debugging
+ * 1 = debug variable assignments
+ * 2 = debug calls to get variable
+ * 4 = debug internals (outputs all function calls with parameters).
+ * 8 = debug caching (incomplete)
+ *
+ * Note: setting $this->debug = true will enable debugging of variable
+ * assignments only which is the same behaviour as versions up to release 7.2d.
+ *
+ * @var int
+ */
+ public $debug = 0;
- /**
- * The base directory array from which template files are loaded. When
- * attempting to open a file, the paths in this array are searched one at
- * a time. As soon as a file exists, the array search stops.
- *
- * @var string
- * @access private
- * @see set_root
- */
- var $root = array();
+ /**
+ * The base directory array from which template files are loaded. When
+ * attempting to open a file, the paths in this array are searched one at
+ * a time. As soon as a file exists, the array search stops.
+ *
+ * @var array|string
+ * @see set_root
+ */
+ private $root = array();
- /**
- * A hash of strings forming a translation table which translates variable names
- * into names of files containing the variable content.
- * $file[varname] = "filename";
- *
- * @var array
- * @access private
- * @see set_file
- */
- var $file = array();
+ /**
+ * A hash of strings forming a translation table which translates variable names
+ * into names of files containing the variable content.
+ * $file[$varName] = "filename";
+ *
+ * @var array/string
+ * @see set_file
+ */
+ private $file = array();
- /**
- * A hash of strings forming a translation table which translates variable names
- * into names of files containing the variable content.
- * $location[varname] = "full path to template";
- *
- * @var array
- * @access private
- * @see set_file
- */
- var $location = array();
+ /**
+ * A hash of strings forming a translation table which translates variable names
+ * into names of files containing the variable content.
+ * $location[$varName] = "full path to template";
+ *
+ * @var array
+ * @see set_file
+ */
+ private $location = array();
- /**
- * The in memory template
- *
- * @var array
- * @access private
- * @see set_file
- */
- var $templateCode = array();
+ /**
+ * The in memory template
+ *
+ * @var array
+ * @see set_file
+ */
+ private $templateCode = array();
- /**
- * A hash of strings forming a translation table which translates variable names
- * into names of files containing the variable content.
- * $file[varname] = "filename";
- *
- * @var array
- * @access private
- * @see cache_blocks,set_block
- */
- var $blocks = array();
+ /**
+ * A hash of strings forming a translation table which translates variable names
+ * into names of files containing the variable content.
+ * $file[$varName] = "filename";
+ *
+ * @var array
+ * @see cache_blocks,set_block
+ */
+ private $blocks = array();
- /**
- * A hash of strings forming a translation table which translates variable names
- * into the parent name of the variable.
- *
- * @var array
- * @access private
- * @see cache_blocks,set_block, block_echo
- */
- var $block_replace = array();
+ /**
+ * A hash of strings forming a translation table which translates variable names
+ * into the parent name of the variable.
+ *
+ * @var array
+ * @see cache_blocks,set_block, block_echo
+ */
+ private $block_replace = array();
- /**
- * A hash of strings forming a translation table which translates variable names
- * into regular expressions for themselves.
- * $varkeys[varname] = "/varname/"
- *
- * @var array
- * @access private
- * @see set_var
- */
- var $varkeys = array();
+ /**
+ * A hash of strings forming a translation table which translates variable names
+ * into regular expressions for themselves.
+ * $varKeys[$varName] = "/varName/"
+ *
+ * @var array
+ * @see set_var
+ */
+ private $varKeys = array();
- /**
- * A hash of strings forming a translation table which translates variable names
- * into values for their respective varkeys.
- * $varvals[varname] = "value"
- *
- * @var array
- * @access private
- * @see set_var
- */
- var $varvals = array();
+ /**
+ * A hash of strings forming a translation table which translates variable names
+ * into values for their respective varKeys.
+ * $varVals[$varName] = "value"
+ *
+ * @var array
+ * @access private
+ * @see set_var
+ */
+ private $varVals = array();
- /**
- * A hash of vars that are not to be translated when create_instance() is called.
- * $nocache[varname] = true
- *
- * @var array
- * @access private
- * @see create_instance, val_echo, mod_echo
- */
- var $nocache = array();
+ /**
+ * A hash of vars that are not to be translated when create_instance() is called.
+ * $nocache[varName] = true
+ *
+ * @var array
+ * @see create_instance, val_echo, mod_echo
+ */
+ private $nocache = array();
- /**
- * Determines how to output variable tags with no assigned value in templates.
- *
- * @var string
- * @access private
- * @see set_unknowns
- */
- var $unknowns = "remove";
+ /**
More information about the geeklog-cvs
mailing list