Merge tag 'upstream/1.3.1'

Upstream version 1.3.1
This commit is contained in:
Mario Fetka 2018-03-08 14:20:47 +01:00
commit f3e9ef3687
25 changed files with 2949 additions and 2940 deletions

View File

@ -23,7 +23,7 @@
* @package HTML_Template_IT * @package HTML_Template_IT
* @author Ulf Wendel <uw@netuse.de> * @author Ulf Wendel <uw@netuse.de>
* @license BSD http://www.opensource.org/licenses/bsd-license.php * @license BSD http://www.opensource.org/licenses/bsd-license.php
* @version CVS: $Id: IT.php 295605 2010-02-28 22:48:07Z gregorycu $ * @version CVS: $Id$
* @link http://pear.php.net/packages/HTML_Template_IT * @link http://pear.php.net/packages/HTML_Template_IT
* @access public * @access public
*/ */
@ -407,7 +407,7 @@ class HTML_Template_IT
* @see setRoot() * @see setRoot()
* @access public * @access public
*/ */
function HTML_Template_IT($root = '', $options = null) function __construct($root = '', $options = null)
{ {
if (!is_null($options)) { if (!is_null($options)) {
$this->setOptions($options); $this->setOptions($options);
@ -1088,9 +1088,9 @@ class HTML_Template_IT
$content = fread($fh, $fsize); $content = fread($fh, $fsize);
fclose($fh); fclose($fh);
return preg_replace( return preg_replace_callback(
"#<!-- INCLUDE (.*) -->#ime", "#<!-- INCLUDE (.*) -->#im",
"\$this->getFile('\\1')", function ($m) { return $this->getFile($m[1]); },
$content $content
); );
} // end func getFile } // end func getFile

View File

@ -23,7 +23,7 @@
* @package HTML_Template_IT * @package HTML_Template_IT
* @author Ulf Wendel <uw@netuse.de> * @author Ulf Wendel <uw@netuse.de>
* @license BSD http://www.opensource.org/licenses/bsd-license.php * @license BSD http://www.opensource.org/licenses/bsd-license.php
* @version CVS: $Id: ITX.php 295086 2010-02-15 06:31:36Z clockwerx $ * @version CVS: $Id$
* @link http://pear.php.net/packages/HTML_Template_IT * @link http://pear.php.net/packages/HTML_Template_IT
* @access public * @access public
*/ */
@ -136,7 +136,7 @@ class HTML_Template_ITX extends HTML_Template_IT
* @access public * @access public
* @see HTML_Template_IT() * @see HTML_Template_IT()
*/ */
function HTML_Template_ITX($root = '') function __construct($root = '')
{ {
$this->checkblocknameRegExp = '@' . $this->blocknameRegExp . '@'; $this->checkblocknameRegExp = '@' . $this->blocknameRegExp . '@';
@ -144,7 +144,7 @@ class HTML_Template_ITX extends HTML_Template_IT
$this->functionRegExp = '@' . $this->functionPrefix . '(' . $this->functionRegExp = '@' . $this->functionPrefix . '(' .
$this->functionnameRegExp . ')\s*\(@sm'; $this->functionnameRegExp . ')\s*\(@sm';
$this->HTML_Template_IT($root); parent::__construct($root);
} // end func constructor } // end func constructor
/** /**

View File

@ -23,7 +23,7 @@
* @package HTML_Template_IT * @package HTML_Template_IT
* @author Ulf Wendel <uw@netuse.de> * @author Ulf Wendel <uw@netuse.de>
* @license BSD http://www.opensource.org/licenses/bsd-license.php * @license BSD http://www.opensource.org/licenses/bsd-license.php
* @version CVS: $Id: IT_Error.php 295117 2010-02-15 23:25:21Z clockwerx $ * @version CVS: $Id$
* @link http://pear.php.net/packages/HTML_Template_IT * @link http://pear.php.net/packages/HTML_Template_IT
* @access public * @access public
*/ */
@ -56,7 +56,7 @@ class IT_Error extends PEAR_Error
* @param string $file file where the error occured * @param string $file file where the error occured
* @param string $line linenumber where the error occured * @param string $line linenumber where the error occured
*/ */
function IT_Error($msg, $file = __FILE__, $line = __LINE__) function __construct($msg, $file = __FILE__, $line = __LINE__)
{ {
$this->PEAR_Error(sprintf("%s [%s on line %d].", $msg, $file, $line)); $this->PEAR_Error(sprintf("%s [%s on line %d].", $msg, $file, $line));
} // end func IT_Error } // end func IT_Error

View File

@ -3,9 +3,13 @@
/** /**
* An example for the usage of ITX::addBlockfile * An example for the usage of ITX::addBlockfile
* *
* @version CVS: $Id: sample_itx_addblockfile.php 216180 2006-07-11 21:56:05Z dsp $ * @version CVS: $Id$
*/ */
// Show all errors and warnings
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once 'HTML/Template/ITX.php'; require_once 'HTML/Template/ITX.php';
$data = array (array ('packagename'=>'mypackage', $data = array (array ('packagename'=>'mypackage',

View File

@ -11,12 +11,12 @@ function _uppercaseCallback($ary)
class Callbacks class Callbacks
{ {
function _lowercaseCallback($ary) static function _lowercaseCallback($ary)
{ {
return strtolower($ary[0]); return strtolower($ary[0]);
} }
function _numberFormatCallback($float, $decimals) static function _numberFormatCallback($float, $decimals)
{ {
return number_format($float, $decimals); return number_format($float, $decimals);
} }

6
package.sig Normal file
View File

@ -0,0 +1,6 @@
-----BEGIN PGP SIGNATURE-----
iEYEABECAAYFAlpl7wAACgkQcqMhusJF8XUPAgCgkkhDLmcbWpQvpV5aXtWXmSME
1eAAoMuMxtygcY5OOoitupbXVn1sDGYF
=tmsd
-----END PGP SIGNATURE-----

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.9.0" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> <package packagerversion="1.10.5" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>HTML_Template_IT</name> <name>HTML_Template_IT</name>
<channel>pear.php.net</channel> <channel>pear.php.net</channel>
<summary>Integrated Templates</summary> <summary>Integrated Templates</summary>
@ -10,7 +10,7 @@ There are two classes to use for templating. HTML_Template_IT is used for basic
<name>Gregory Currie</name> <name>Gregory Currie</name>
<user>gregorycu</user> <user>gregorycu</user>
<email>gregorycu@php.net</email> <email>gregorycu@php.net</email>
<active>yes</active> <active>no</active>
</lead> </lead>
<lead> <lead>
<name>Pierre-Alain Joye</name> <name>Pierre-Alain Joye</name>
@ -36,10 +36,10 @@ There are two classes to use for templating. HTML_Template_IT is used for basic
<email>ulf.wendel@phpdoc.de</email> <email>ulf.wendel@phpdoc.de</email>
<active>no</active> <active>no</active>
</developer> </developer>
<date>2010-03-10</date> <date>2018-01-22</date>
<time>19:08:10</time> <time>14:02:10</time>
<version> <version>
<release>1.3.0</release> <release>1.3.1</release>
<api>1.3.0</api> <api>1.3.0</api>
</version> </version>
<stability> <stability>
@ -48,49 +48,33 @@ There are two classes to use for templating. HTML_Template_IT is used for basic
</stability> </stability>
<license>Modified BSD license</license> <license>Modified BSD license</license>
<notes> <notes>
Changes since last stable release (1.2.1): - PR #2: Fixes for deprecated code
- Add support for pear package 2.0 format
- Remove support for pear package 1.0 format
- Fix bug #9501, doller signs disapear if preg_match is used.
- Fix bug #9783, don&apos;t remove variable which values follow the variable pattern
To allow backwards compatbility an option preserve_input is added.
If it is false, the old behaviour will be used and therefore those values will be deleted.
Default is true, so new behaviour.
- Fix bug #9853, problems with dots in placeholders or blocknames
- Fix bug #13935, docblock is wrong
- Fix bug #17129
- Add option &apos;preserve_input&apos; to only remove unkown variable that were present
during setTemplate or loadTemplatefile
which is the behaviour before 1.3.0a1
- Improved PHPCS (Request #15039)
- Added unit tests
- Fixed unit tests
</notes> </notes>
<contents> <contents>
<dir name="/"> <dir name="/">
<file md5sum="157f1b27090288fbce921b762697c3f4" name="examples/sample_it.php" role="doc" /> <file md5sum="ba285cf25750a900690f2388ee31a103" name="examples/sample_it.php" role="doc" />
<file md5sum="1d2363fa8640780392af6c51e9c3713f" name="examples/sample_itx_addblockfile.php" role="doc" /> <file md5sum="8da7b1692566f5f67b7070402cb949dc" name="examples/sample_itx_addblockfile.php" role="doc" />
<file md5sum="43a3535aa4d5e9df400babae53d82a08" name="examples/templates/addblockfile_list.tpl.htm" role="doc" /> <file md5sum="342278cc5fe8ca6c66591cd5ee389402" name="examples/templates/addblockfile_list.tpl.htm" role="doc" />
<file md5sum="16f4927420fa169875167a4874e7add7" name="examples/templates/addblockfile_main.tpl.htm" role="doc" /> <file md5sum="697f694a67db6b96d247a24bdfd44f9b" name="examples/templates/addblockfile_main.tpl.htm" role="doc" />
<file md5sum="2c851fcec88007eef66c28a9d8f10ceb" name="examples/templates/main.tpl.htm" role="doc" /> <file md5sum="834e1e6d40b2f34906aa17f9969bd891" name="examples/templates/main.tpl.htm" role="doc" />
<file md5sum="886a6044e8186e3b1e1d8c5b004246af" name="HTML/Template/IT.php" role="php" /> <file md5sum="ff54f9a70504c2c64f81b9d4e1897c3b" name="HTML/Template/IT.php" role="php" />
<file md5sum="16b0300b5fbe3be7a1df976ce5d27c4f" name="HTML/Template/ITX.php" role="php" /> <file md5sum="226a20af0aa45c0838863f73103b91af" name="HTML/Template/ITX.php" role="php" />
<file md5sum="484d2aa6a504a351a1d3e2b8bb39612d" name="HTML/Template/IT_Error.php" role="php" /> <file md5sum="52a5e675aec5f68c4c3111a17307a860" name="HTML/Template/IT_Error.php" role="php" />
<file md5sum="e576a94c06b323e4cfc6bcf9dda017c2" name="tests/AllTests.php" role="test" /> <file md5sum="e576a94c06b323e4cfc6bcf9dda017c2" name="tests/AllTests.php" role="test" />
<file md5sum="adabbbb8cf54dc80720b7929e594cbec" name="tests/ITTest.php" role="test" /> <file md5sum="a12627343ed2962dc629181dd4fa1994" name="tests/ITTest.php" role="test" />
<file md5sum="80139a8b443488dac801fae748b6f2c2" name="tests/ITXTest.php" role="test" /> <file md5sum="e0d736f03900f6fc9e6132c7549a96b8" name="tests/ITXTest.php" role="test" />
<file md5sum="e50de49b74a1d96bb77ddae2d0abdfc3" name="tests/templates/addblock.html" role="test" /> <file md5sum="bca97392b741f553d10203f04549a423" name="tests/templates/addblock.html" role="test" />
<file md5sum="22e56437378e53d08ba07d3dd2aa4b85" name="tests/templates/blockiteration.html" role="test" /> <file md5sum="d4e1caf0b07b85e49e0e82ab83e91ed3" name="tests/templates/blockiteration.html" role="test" />
<file md5sum="4173bf97eec43787532e247ef9b2611a" name="tests/templates/blocks.html" role="test" /> <file md5sum="aa11dc0ba8c94c71f0ed6e448770f913" name="tests/templates/blocks.html" role="test" />
<file md5sum="7014497a69b346957fb3d2b5fa44ffd4" name="tests/templates/bug_9853_01.tpl" role="test" /> <file md5sum="7014497a69b346957fb3d2b5fa44ffd4" name="tests/templates/bug_9853_01.tpl" role="test" />
<file md5sum="385013ff6be875da2888087e96c6a93c" name="tests/templates/bug_9853_02.tpl" role="test" /> <file md5sum="385013ff6be875da2888087e96c6a93c" name="tests/templates/bug_9853_02.tpl" role="test" />
<file md5sum="2611d6ec574a65716f1bc2ca95cb8c63" name="tests/templates/globals.html" role="test" /> <file md5sum="ed6cb6de29d69890c611f11ce90e1e85" name="tests/templates/globals.html" role="test" />
<file md5sum="db5b226eff0218c831749c07042529f2" name="tests/templates/include.html" role="test" /> <file md5sum="8ac12c5d1c85787dd44ed5c93a392dfe" name="tests/templates/include.html" role="test" />
<file md5sum="d9a6425eebdfc6981465b4a228dbee51" name="tests/templates/loadtemplatefile.html" role="test" /> <file md5sum="bd4c99366021b8bd88ba220ec829eae5" name="tests/templates/loadtemplatefile.html" role="test" />
<file md5sum="8747e8c70d20b6c86d1d19af2eadd874" name="tests/templates/placeholderreplacementscope.html" role="test" /> <file md5sum="8747e8c70d20b6c86d1d19af2eadd874" name="tests/templates/placeholderreplacementscope.html" role="test" />
<file md5sum="5c7e2e9c32306db4b6667d2b57f1c0ac" name="tests/templates/replaceblock.html" role="test" /> <file md5sum="a3d70ab52bdb9f3c14702879865a55d6" name="tests/templates/replaceblock.html" role="test" />
<file md5sum="310552db4653b34dbb0f993847572fc5" name="tests/templates/__include.html" role="test" /> <file md5sum="fb1681e6ffa470d92859fac3496b960e" name="tests/templates/__include.html" role="test" />
<file md5sum="7073f9a84fa6da71e7a505a777dda302" name="LICENSE" role="doc" /> <file md5sum="f8790e48b597dff12a643e08e9be3fab" name="LICENSE" role="doc" />
</dir> </dir>
</contents> </contents>
<dependencies> <dependencies>
@ -331,5 +315,20 @@ Changes since last stable release (1.2.1):
- Fixed unit tests - Fixed unit tests
</notes> </notes>
</release> </release>
<release>
<version>
<release>1.3.1</release>
<api>1.3.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<date>2018-01-22</date>
<license>Modified BSD license</license>
<notes>
- PR #2: Fixes for deprecated code
</notes>
</release>
</changelog> </changelog>
</package> </package>