Thread: [phpMP-CVS] CVS: phpMP/includes Config_File.class.php,1.2,1.3 Smarty.class.php,1.2,1.3 Smarty_Compil
Status: Pre-Alpha
Brought to you by:
heimidal
From: Brian R. <hei...@us...> - 2002-11-28 05:27:56
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv20362/includes Modified Files: Config_File.class.php Smarty.class.php Smarty_Compiler.class.php Log Message: Updated Smarty template engine Index: Config_File.class.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/Config_File.class.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Config_File.class.php 14 Aug 2002 17:44:06 -0000 1.2 --- Config_File.class.php 28 Nov 2002 05:27:53 -0000 1.3 *************** *** 4,8 **** * Config_File class. * ! * @version 2.3.0 * @author Andrei Zmievski <an...@ph...> * @access public --- 4,8 ---- * Config_File class. * ! * @version 2.3.1 * @author Andrei Zmievski <an...@ph...> * @access public *************** *** 61,64 **** --- 61,72 ---- var $read_hidden = true; + /** + * Controls whether or not to fix mac or dos formatted newlines. + * If set to true, \r or \r\n will be changed to \n. + * + * @access public + */ + var $fix_newlines = true; + /* Private variables */ var $_config_path = ""; *************** *** 254,257 **** --- 262,270 ---- $contents = fread($fp, filesize($config_file)); fclose($fp); + + if($this->fix_newlines) { + // fix mac/dos formatted newlines + $contents = preg_replace('!\r\n?!',"\n",$contents); + } $config_data = array(); Index: Smarty.class.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/Smarty.class.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Smarty.class.php 14 Aug 2002 17:44:06 -0000 1.2 --- Smarty.class.php 28 Nov 2002 05:27:53 -0000 1.3 *************** *** 6,10 **** * Andrei Zmievski <an...@ph...> * ! * Version: 2.3.0 * Copyright: 2001,2002 ispi of Lincoln, Inc. * --- 6,10 ---- * Andrei Zmievski <an...@ph...> * ! * Version: 2.3.1 * Copyright: 2001,2002 ispi of Lincoln, Inc. * *************** *** 172,176 **** var $_config = array(); // loaded configuration settings var $_smarty_md5 = 'f8d698aea36fcbead2b9d5359ffca76f'; // md5 checksum of the string 'Smarty' ! var $_version = '2.3.0'; // Smarty version number var $_extract = false; // flag for custom functions var $_inclusion_depth = 0; // current template inclusion depth --- 172,176 ---- var $_config = array(); // loaded configuration settings var $_smarty_md5 = 'f8d698aea36fcbead2b9d5359ffca76f'; // md5 checksum of the string 'Smarty' ! var $_version = '2.3.1'; // Smarty version number var $_extract = false; // flag for custom functions var $_inclusion_depth = 0; // current template inclusion depth *************** *** 932,936 **** // compile template $this->_compile_template($tpl_file, $template_source, $template_compiled); ! $this->_write_compiled_template($compile_path, $template_compiled); return true; } --- 932,936 ---- // compile template $this->_compile_template($tpl_file, $template_source, $template_compiled); ! $this->_write_compiled_template($compile_path, $template_compiled, $template_timestamp); return true; } *************** *** 943,947 **** } $this->_compile_template($tpl_file, $template_source, $template_compiled); ! $this->_write_compiled_template($compile_path, $template_compiled); return true; } --- 943,947 ---- } $this->_compile_template($tpl_file, $template_source, $template_compiled); ! $this->_write_compiled_template($compile_path, $template_compiled, $template_timestamp); return true; } *************** *** 962,969 **** Purpose: \*======================================================================*/ ! function _write_compiled_template($compile_path, $template_compiled) { // we save everything into $compile_dir $this->_write_file($compile_path, $template_compiled, true); return true; } --- 962,970 ---- Purpose: \*======================================================================*/ ! function _write_compiled_template($compile_path, $template_compiled, $template_timestamp) { // we save everything into $compile_dir $this->_write_file($compile_path, $template_compiled, true); + touch($compile_path, $template_timestamp); return true; } *************** *** 1515,1519 **** function _rm_auto($auto_base, $auto_source = null, $auto_id = null, $exp_time = null) { ! if (!is_dir($auto_base)) return false; --- 1516,1520 ---- function _rm_auto($auto_base, $auto_source = null, $auto_id = null, $exp_time = null) { ! if (!@is_dir($auto_base)) return false; *************** *** 1524,1528 **** if(isset($auto_source)) { ! $res = @unlink($tname); } elseif ($this->use_sub_dirs) { $res = $this->_rmdir($tname, 1, $exp_time); --- 1525,1529 ---- if(isset($auto_source)) { ! $res = $this->_unlink($tname); } elseif ($this->use_sub_dirs) { $res = $this->_rmdir($tname, 1, $exp_time); *************** *** 1555,1559 **** while ($entry = readdir($handle)) { if ($entry != '.' && $entry != '..') { ! if (is_dir($dirname . DIR_SEP . $entry)) { $this->_rmdir($dirname . DIR_SEP . $entry, $level + 1, $exp_time); } --- 1556,1560 ---- while ($entry = readdir($handle)) { if ($entry != '.' && $entry != '..') { ! if (@is_dir($dirname . DIR_SEP . $entry)) { $this->_rmdir($dirname . DIR_SEP . $entry, $level + 1, $exp_time); } *************** *** 1584,1591 **** if(isset($exp_time)) { if(time() - filemtime($resource) >= $exp_time) { ! unlink($resource); } } else { ! unlink($resource); } } --- 1585,1592 ---- if(isset($exp_time)) { if(time() - filemtime($resource) >= $exp_time) { ! @unlink($resource); } } else { ! @unlink($resource); } } *************** *** 1598,1610 **** { if (!@file_exists($dir)) { ! $dir_parts = preg_split('!\\'.DIR_SEP.'+!', $dir, -1, PREG_SPLIT_NO_EMPTY); ! $new_dir = ($dir{0} == DIR_SEP) ? DIR_SEP : ''; ! foreach ($dir_parts as $dir_part) { ! $new_dir .= $dir_part; ! if (!file_exists($new_dir) && !mkdir($new_dir, 0771)) { $this->trigger_error("problem creating directory \"$dir\""); return false; } ! $new_dir .= DIR_SEP; } } --- 1599,1635 ---- { if (!@file_exists($dir)) { ! $_dir_parts = preg_split('!\\'.DIR_SEP.'+!', $dir, -1, PREG_SPLIT_NO_EMPTY); ! $_new_dir = ($dir{0} == DIR_SEP) ? DIR_SEP : ''; ! ! // do not attempt to test or make directories outside of open_basedir ! $_open_basedir_ini = ini_get('open_basedir'); ! if(!empty($_open_basedir_ini)) { ! $_use_open_basedir = true; ! $_open_basedir_sep = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') ? ';' : ':'; ! $_open_basedirs = explode($_open_basedir_sep, $_open_basedir_ini); ! } else { ! $_use_open_basedir = false; ! } ! ! foreach ($_dir_parts as $_dir_part) { ! $_new_dir .= $_dir_part; ! ! if ($_use_open_basedir) { ! $_make_new_dir = false; ! foreach ($_open_basedirs as $_open_basedir) { ! if (substr($_new_dir.'/', 0, strlen($_open_basedir)) == $_open_basedir) { ! $_make_new_dir = true; ! break; ! } ! } ! } else { ! $_make_new_dir = true; ! } ! ! if ($_make_new_dir && !@file_exists($_new_dir) && !@mkdir($_new_dir, 0771)) { $this->trigger_error("problem creating directory \"$dir\""); return false; } ! $_new_dir .= DIR_SEP; } } Index: Smarty_Compiler.class.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/Smarty_Compiler.class.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Smarty_Compiler.class.php 14 Aug 2002 17:44:06 -0000 1.2 --- Smarty_Compiler.class.php 28 Nov 2002 05:27:53 -0000 1.3 *************** *** 7,11 **** * Andrei Zmievski <an...@ph...> * ! * Version: 2.3.0 * Copyright: 2001,2002 ispi of Lincoln, Inc. * --- 7,11 ---- * Andrei Zmievski <an...@ph...> * ! * Version: 2.3.1 * Copyright: 2001,2002 ispi of Lincoln, Inc. * *************** *** 1298,1303 **** case 'get': array_shift($indexes); ! $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_GET_VARS']['$name']"; break; --- 1298,1304 ---- case 'get': array_shift($indexes); ! $compiled_ref = "\$GLOBALS['HTTP_GET_VARS']"; ! if ($name = substr($indexes[0], 1)) ! $compiled_ref .= "['$name']"; break; *************** *** 1305,1309 **** array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_POST_VARS']['$name']"; break; --- 1306,1312 ---- array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_POST_VARS']"; ! if ($name = substr($indexes[0], 1)) ! $compiled_ref .= "['$name']"; break; *************** *** 1311,1321 **** array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_COOKIE_VARS']['$name']"; break; case 'env': array_shift($indexes); ! $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_ENV_VARS']['$name']"; break; --- 1314,1327 ---- array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_COOKIE_VARS']"; ! if ($name = substr($indexes[0], 1)) ! $compiled_ref .= "['$name']"; break; case 'env': array_shift($indexes); ! $compiled_ref = "\$GLOBALS['HTTP_ENV_VARS']"; ! if ($name = substr($indexes[0], 1)) ! $compiled_ref .= "['$name']"; break; *************** *** 1323,1327 **** array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_SERVER_VARS']['$name']"; break; --- 1329,1335 ---- array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_SERVER_VARS']"; ! if ($name = substr($indexes[0], 1)) ! $compiled_ref .= "['$name']"; break; *************** *** 1329,1333 **** array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_SESSION_VARS']['$name']"; break; --- 1337,1343 ---- array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_SESSION_VARS']"; ! if ($name = substr($indexes[0], 1)) ! $compiled_ref .= "['$name']"; break; |