Changeset 627
- Timestamp:
- 2009-07-05T11:24:38+02:00 (4 years ago)
- Location:
- branches/1.3
- Files:
-
- 11 edited
-
. (modified) (1 prop)
-
Makefile.frag (modified) (2 diffs)
-
admin/config.php.example (modified) (1 diff)
-
admin/edit.php (modified) (1 diff)
-
admin/edit.tpl.php (modified) (1 diff)
-
run-xcachetest (modified) (2 diffs)
-
utils.c (modified) (4 diffs)
-
utils.h (modified) (1 diff)
-
xcache-test.ini (modified) (1 diff)
-
xcache.c (modified) (4 diffs)
-
xcache_globals.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
- Property svn:mergeinfo changed
/trunk merged: 585,588-592
- Property svn:mergeinfo changed
-
branches/1.3/Makefile.frag
r620 r627 15 15 16 16 $(XCACHE_PROC_OUT): $(XCACHE_PROC_SRC) $(XCACHE_STRUCTINFO_OUT) $(XCACHE_PROC_SOURCES) 17 $(M4) -D srcdir= "$(srcdir)" -D builddir="$(builddir)" $(XCACHE_ENABLE_TEST) $(XCACHE_PROC_SRC) > $(XCACHE_PROC_OUT).tmp17 $(M4) -D srcdir='`'"$(srcdir)'" -D builddir='`'"$(builddir)'" $(XCACHE_ENABLE_TEST) $(XCACHE_PROC_SRC) > $(XCACHE_PROC_OUT).tmp 18 18 mv -f $(XCACHE_PROC_OUT).tmp $(XCACHE_PROC_OUT) 19 19 … … 39 39 40 40 xcachetest: 41 $(SED) "s#\\./modules/#$(top_builddir)/modules/#" < $(srcdir)/xcache-test.ini > $(top_builddir)/tmp-php.ini 41 42 TEST_PHP_SRCDIR=$(top_srcdir) \ 42 43 CC="$(CC)" \ 43 $(srcdir)/run-xcachetest -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php $(TESTS) $(TEST_ARGS) -c $( srcdir)/xcache-test.ini44 $(srcdir)/run-xcachetest -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php $(TESTS) $(TEST_ARGS) -c $(top_builddir)/tmp-php.ini -
branches/1.3/admin/config.php.example
r623 r627 16 16 // do not define both with 17 17 // $free_graph_width = 120; 18 19 // only enable if you have password protection for admin page 20 // enabling this option will cause user to eval() whatever code they want 21 $enable_eval = false; 18 22 19 23 // this function is detected by xcache.tpl.php, and enabled if function_exists -
branches/1.3/admin/edit.php
r607 r627 12 12 13 13 if ($_SERVER['REQUEST_METHOD'] == 'POST') { 14 eval('$value = ' . $_POST['value']); 14 if ($enable_eval) { 15 eval('$value = ' . $_POST['value']); 16 } 17 else { 18 $value = $_POST['value']; 19 } 15 20 xcache_set($name, $value); 16 21 header("Location: xcache.php?type=" . XC_TYPE_VAR); 17 22 exit; 18 23 } 19 $value = var_export(xcache_get($name), true); 24 $value = xcache_get($name); 25 if ($enable_eval) { 26 $value = var_export($value, true); 27 $editable = true; 28 } 29 else { 30 if (is_string($value)) { 31 $editable = true; 32 } 33 else { 34 $editable = false; 35 $value = var_export($value, true); 36 } 37 } 20 38 21 39 $xcache_version = XCACHE_VERSION; -
branches/1.3/admin/edit.tpl.php
r604 r627 7 7 <fieldset> 8 8 <legend><?php echo sprintf(_T("Editing Variable %s"), $h_name); ?></legend> 9 <textarea name="value" style="width: 100%; height: 200px; overflow-y: auto" ><?php echo $h_value; ?></textarea><br>9 <textarea name="value" style="width: 100%; height: 200px; overflow-y: auto" <?php echo $editable ? "" : "disabled=disabled"; ?>><?php echo $h_value; ?></textarea><br> 10 10 <input type="submit"> 11 11 </fieldset> -
branches/1.3/run-xcachetest
r623 r627 1 1 #!/bin/sh 2 3 getAbsolutePath() { 4 which readlink >/dev/null 2>&1 && readlink -f "$@" || echo "$@" 5 } 2 6 3 7 # use symlink first 4 8 if test -x ./php-cli ; then 5 php_cli= ./php-cli9 php_cli=`getAbsolutePath ./php-cli` 6 10 elif test ! -z "$TEST_PHP_EXECUTABLE" && test -x "$TEST_PHP_EXECUTABLE"; then 7 11 php_cli="$TEST_PHP_EXECUTABLE" … … 11 15 12 16 if test -x ./php-cgi ; then 13 php_cgi= ./php-cgi17 php_cgi=`getAbsolutePath ./php-cgi` 14 18 else 15 19 php_cgi="`which php-cgi`" 16 20 fi 17 21 18 test -z "$PHP_SRC" && PHP_SRC=./php-src 19 if test -z "$TEST_PHP_USER" ; then 20 TEST_PHP_USER="$PHP_SRC/tests" 21 for i in Zend ZendEngine2 ext/standard/tests ext/reflection/tests ext/spl/tests; do 22 if test -d "$PHP_SRC/$i" ; then 23 TEST_PHP_USER="$TEST_PHP_USER,$PHP_SRC/$i" 24 fi 25 done 26 fi 22 test -z "$PHP_SRC" && PHP_SRC=`getAbsolutePath ./php-src` 27 23 28 24 TEST_PHP_EXECUTABLE="$php_cli" 29 25 TEST_PHP_CGI_EXECUTABLE="$php_cgi" 26 TEST_PHP_SRCDIR="$PHP_SRC" 30 27 28 export TEST_PHP_EXECUTABLE 31 29 export TEST_PHP_CGI_EXECUTABLE 32 export TEST_PHP_EXECUTABLE 33 export TEST_PHP_USER 30 export TEST_PHP_SRCDIR 34 31 35 32 echo "XCache test running with:" 36 33 echo "TEST_PHP_CGI_EXECUTABLE: $TEST_PHP_CGI_EXECUTABLE" 37 34 echo "TEST_PHP_EXECUTABLE: $TEST_PHP_EXECUTABLE" 38 echo "TEST_PHP_USER: $TEST_PHP_USER"39 35 40 36 exec "$php_cli" "$@" -
branches/1.3/utils.c
r625 r627 598 598 #endif 599 599 600 static void xc_copy_zend_constant(zend_constant *c) /* {{{ */ 601 { 602 c->name = zend_strndup(c->name, c->name_len - 1); 603 if (!(c->flags & CONST_PERSISTENT)) { 604 zval_copy_ctor(&c->value); 605 } 606 } 607 /* }}} */ 600 608 xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC) /* {{{ */ 601 609 { … … 635 643 h = OG(zend_constants); 636 644 zend_hash_init_ex(&TG(zend_constants), 20, NULL, h->pDestructor, h->persistent, h->bApplyProtection); 645 { 646 zend_constant tmp_const; 647 zend_hash_copy(&TG(zend_constants), &XG(internal_constant_table), (copy_ctor_func_t) xc_copy_zend_constant, (void *) &tmp_const, sizeof(tmp_const)); 648 } 637 649 #endif 638 650 h = OG(function_table); … … 677 689 /* Using ZEND_COMPILE_IGNORE_INTERNAL_CLASSES for ZEND_FETCH_CLASS_RT_NS_CHECK 678 690 */ 679 CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES | ZEND_COMPILE_ DELAYED_BINDING;691 CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES | ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION | ZEND_COMPILE_DELAYED_BINDING; 680 692 #endif 681 693 … … 696 708 697 709 #ifdef HAVE_XCACHE_CONSTANT 698 b = TG(zend_constants).pListHead;710 b = /*TG(internal_constant_tail) ? TG(internal_constant_tail)->pListNext :*/ TG(zend_constants).pListHead; 699 711 /* install constants */ 700 712 while (b != NULL) { -
branches/1.3/utils.h
r625 r627 95 95 HashTable tmp_class_table; 96 96 HashTable tmp_auto_globals; 97 #ifdef HAVE_XCACHE_CONSTANT 98 Bucket *tmp_internal_constant_tail; 99 #endif 97 100 Bucket *tmp_internal_function_tail; 98 101 Bucket *tmp_internal_class_tail; -
branches/1.3/xcache-test.ini
r623 r627 8 8 xcache.cacher = On 9 9 xcache.test=1 10 xcache.size = 1 M10 xcache.size = 16M 11 11 xcache.count = 1 12 12 xcache.var_size = 1M -
branches/1.3/xcache.c
r626 r627 1594 1594 } 1595 1595 /* }}} */ 1596 static void xc_copy_zend_constant(zend_constant *c) /* {{{ */ 1597 { 1598 c->name = zend_strndup(c->name, c->name_len - 1); 1599 if (!(c->flags & CONST_PERSISTENT)) { 1600 zval_copy_ctor(&c->value); 1601 } 1602 } 1603 /* }}} */ 1596 1604 static void xc_request_init(TSRMLS_D) /* {{{ */ 1597 1605 { … … 1599 1607 1600 1608 if (!XG(internal_table_copied)) { 1609 #ifdef HAVE_XCACHE_CONSTANT 1610 zend_constant tmp_const; 1611 #endif 1601 1612 zend_function tmp_func; 1602 1613 xc_cest_t tmp_cest; 1603 1614 1615 #ifdef HAVE_XCACHE_CONSTANT 1616 zend_hash_destroy(&XG(internal_constant_table)); 1617 #endif 1604 1618 zend_hash_destroy(&XG(internal_function_table)); 1605 1619 zend_hash_destroy(&XG(internal_class_table)); 1606 1620 1621 #ifdef HAVE_XCACHE_CONSTANT 1622 zend_hash_init_ex(&XG(internal_constant_table), 20, NULL, NULL, 1, 0); 1623 #endif 1607 1624 zend_hash_init_ex(&XG(internal_function_table), 100, NULL, NULL, 1, 0); 1608 1625 zend_hash_init_ex(&XG(internal_class_table), 10, NULL, NULL, 1, 0); 1609 1626 1627 #ifdef HAVE_XCACHE_CONSTANT 1628 zend_hash_copy(&XG(internal_constant_table), EG(zend_constants), (copy_ctor_func_t) xc_copy_zend_constant, &tmp_const, sizeof(tmp_const)); 1629 #endif 1610 1630 zend_hash_copy(&XG(internal_function_table), CG(function_table), NULL, &tmp_func, sizeof(tmp_func)); 1611 1631 zend_hash_copy(&XG(internal_class_table), CG(class_table), NULL, &tmp_cest, sizeof(tmp_cest)); … … 1666 1686 memset(xcache_globals, 0, sizeof(zend_xcache_globals)); 1667 1687 1688 #ifdef HAVE_XCACHE_CONSTANT 1689 zend_hash_init_ex(&xcache_globals->internal_constant_table, 1, NULL, NULL, 1, 0); 1690 #endif 1668 1691 zend_hash_init_ex(&xcache_globals->internal_function_table, 1, NULL, NULL, 1, 0); 1669 1692 zend_hash_init_ex(&xcache_globals->internal_class_table, 1, NULL, NULL, 1, 0); … … 1697 1720 1698 1721 if (xcache_globals->internal_table_copied) { 1722 #ifdef HAVE_XCACHE_CONSTANT 1723 zend_hash_destroy(&xcache_globals->internal_constant_table); 1724 #endif 1699 1725 zend_hash_destroy(&xcache_globals->internal_function_table); 1700 1726 zend_hash_destroy(&xcache_globals->internal_class_table); -
branches/1.3/xcache_globals.h
r622 r627 22 22 #endif 23 23 24 #ifdef HAVE_XCACHE_CONSTANT 25 HashTable internal_constant_table; 26 #endif 24 27 HashTable internal_function_table; 25 28 HashTable internal_class_table;
Note: See TracChangeset
for help on using the changeset viewer.

