Skip to content

Commit d91ea36

Browse files
author
Sergey
committed
Merge pull request #3 from sergey-dryabzhinsky/update-version-and-ini-file
Update version:
2 parents 93dd8e7 + 85ea9a4 commit d91ea36

5 files changed

Lines changed: 38 additions & 6 deletions

File tree

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
1.7.3:
2+
- fix lvalue set for php >= 4.1
3+
- fix compilation warnings about line numbers format
4+
- add new option to suppress errors if context not found
5+
16
1.7:
27
- contexts may now be assigned a value like if they were tags
38
- removed "Tag doesn't exist" notice from tmpl_set()

php_templates.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ extern zend_module_entry templates_module_entry;
4444
# define TMPL_PHP_4_3 1
4545
#endif
4646

47-
#define TMPL_VERSION "1.7"
47+
#define TMPL_VERSION "1.7.3"
4848

4949
#define TMPL_CACHE_ENABLED 0
5050

templates.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ char buf[TMPL_MAX_TAG_LEN*3];
237237
DISPLAY_INI_ENTRIES();
238238

239239
php_info_print_table_start();
240-
php_info_print_table_row(2, "WWW", "http://php-templates.sourceforge.net/");
240+
php_info_print_table_row(2, "WWW", "https://github.com/sergey-dryabzhinsky/php-templates");
241241
php_info_print_table_end();
242242
}
243243
/* }}} */

templates.ini

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
extension=templates.so
2+
3+
[Templates]
4+
5+
; Open block tag left part (open)
6+
; templates.ctx_ol = "<tmpl:"
7+
8+
; Open block tag right part (close)
9+
; templates.ctx_or = ">"
10+
11+
; Close block tag left part (open)
12+
; templates.ctx_cl = "</tmpl:"
13+
14+
; Close block tag right part (close)
15+
; templates.ctx_cr = ">"
16+
17+
; Data key open tag
18+
; templates.left = "{"
19+
20+
; Data key close tag
21+
; templates.right = "}"
22+
23+
; Throw error if context not found
24+
; Set to 1 in dev environment
25+
; templates.ctx_eno = 1
26+
27+
templates.ctx_eno = 0

tmpl_lib.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ register char *start;
112112
if(!(*p)) break; else nam[nam_len] = 0;
113113

114114
if('=' != *p) {
115-
php_error(E_ERROR, "Invalid configuration tag parameter in template (line:%d)", php_tmpl_line_num(tmpl, p));
115+
php_error(E_ERROR, "Invalid configuration tag parameter in template (line:%lu)", php_tmpl_line_num(tmpl, p));
116116
TMPL_PRE_PARSE_CONFIG_CLEANUP;
117117
return FAILURE;
118118
}
@@ -125,7 +125,7 @@ register char *start;
125125
if(!(*p)) break; else val[val_len] = 0;
126126

127127
if(quote && quote != *p) {
128-
php_error(E_ERROR, "Invalid parameter value in configuration tag in template (line:%d)", php_tmpl_line_num(tmpl, p));
128+
php_error(E_ERROR, "Invalid parameter value in configuration tag in template (line:%lu)", php_tmpl_line_num(tmpl, p));
129129
TMPL_PRE_PARSE_CONFIG_CLEANUP;
130130
return FAILURE;
131131
}
@@ -308,7 +308,7 @@ zval **ztag;
308308
buf[buf_len] = 0;
309309

310310
if(SUCCESS == zend_hash_find(Z_ARRVAL_P(tmpl->tags), buf, buf_len+1, (void*)&ztag)) {
311-
php_error(E_ERROR, "Duplicate context \"%s\" in template (line: %d)", buf, php_tmpl_line_num(tmpl, p));
311+
php_error(E_ERROR, "Duplicate context \"%s\" in template (line: %lu)", buf, php_tmpl_line_num(tmpl, p));
312312
TMPL_PRE_PARSE_CLEANUP;
313313
return FAILURE;
314314
}
@@ -359,7 +359,7 @@ zval **ztag;
359359
}
360360
}
361361
if(buf_len != 1) {
362-
php_error(E_ERROR, "Can't continue with an unterminated context \"%s\" in template (line:%d)", buf, php_tmpl_line_num(tmpl, ZV(tmpl->original) + context->loff));
362+
php_error(E_ERROR, "Can't continue with an unterminated context \"%s\" in template (line:%lu)", buf, php_tmpl_line_num(tmpl, ZV(tmpl->original) + context->loff));
363363
TMPL_PRE_PARSE_CLEANUP;
364364
return FAILURE;
365365
}

0 commit comments

Comments
 (0)