Changeset 713
- Timestamp:
- 2011-04-08T20:27:55+02:00 (2 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
Decompiler.class.php (modified) (10 diffs)
-
processor/processor.m4 (modified) (1 diff)
-
xcache.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Decompiler.class.php
r522 r713 29 29 if (is_array($src)) { 30 30 die_error('array str'); 31 $src = new Decompiler_Array($src, false,$indent);31 $src = new Decompiler_Array($src, $indent); 32 32 return $src->__toString(); 33 33 } … … 38 38 die_error('no __toString'); 39 39 } 40 return $src->__toString( $indent);40 return $src->__toString(); 41 41 } 42 42 … … 56 56 57 57 if (is_array($value)) { 58 $value = new Decompiler_Array($value , true);58 $value = new Decompiler_Array($value); 59 59 } 60 60 else { 61 $value = new Decompiler_Value($value , true);61 $value = new Decompiler_Value($value); 62 62 } 63 63 return $value; … … 257 257 class Decompiler_Array extends Decompiler_Value // {{{ 258 258 { 259 var $needExport = false;260 259 var $indent = ''; 261 260 262 function Decompiler_Array($value = array(), $ needexport = false, $indent = '')261 function Decompiler_Array($value = array(), $indent = '') 263 262 { 264 263 $this->value = $value; 265 $this->needExport = $needexport;266 264 $this->indent = $indent; 267 265 } … … 286 284 ++ $i; 287 285 } 288 if ($assoclen && $this->needExport) {286 if ($assoclen) { 289 287 $assoclen += 2; 290 288 } … … 306 304 } 307 305 308 if ($this->needExport) { 309 $k = var_export($k, true); 310 } 306 $k = var_export($k, true); 311 307 if ($multiline) { 312 308 $exp .= sprintf("%{$assoclen}s => ", $k); … … 316 312 } 317 313 318 if (is_array($v)) { 319 $v = new Decompiler_Array($v, $this->needExport); 320 } 321 $exp .= str($v, $subindent); 314 $exp .= str(value($v), $subindent); 322 315 323 316 $i ++; … … 1608 1601 if (!empty($class['default_properties'])) { 1609 1602 echo "\n"; 1610 $infos = empty($class['properties_info']) ? null : $class['properties_info'];1611 foreach ( $class['default_properties'] as $name => $v) {1603 $infos = !empty($class['properties_info']) ? $class['properties_info'] : null; 1604 foreach (!empty($class['properties_info']) ? $class['properties_info'] : ($class['default_static_members'] + $class['default_properties']) as $name => $dummy) { 1612 1605 $info = (isset($infos) && isset($infos[$name])) ? $infos[$name] : null; 1613 1606 if (isset($info)) { … … 1620 1613 1621 1614 echo $newindent; 1615 $static = false; 1616 if (isset($info)) { 1617 if ($info['flags'] & ZEND_ACC_STATIC) { 1618 $static = true; 1619 } 1620 } 1621 else if (isset($class['default_static_members'][$name])) { 1622 $static = true; 1623 } 1624 1625 if ($static) { 1626 echo "static "; 1627 } 1628 1629 $mangled = false; 1622 1630 if (PHP_VERSION < 5) { 1623 1631 echo 'var '; … … 1636 1644 case ZEND_ACC_PRIVATE: 1637 1645 echo "private "; 1646 $mangled = true; 1638 1647 break; 1639 1648 case ZEND_ACC_PROTECTED: 1640 1649 echo "protected "; 1650 $mangled = true; 1641 1651 break; 1642 1652 } 1643 if ($info['flags'] & ZEND_ACC_STATIC) {1644 echo "static ";1645 }1646 1653 } 1647 1654 1648 1655 echo '$', $name; 1649 if (isset($v)) { 1656 1657 $key = isset($info) ? $info['name'] . ($mangled ? "\000" : "") : $name; 1658 1659 $value = $class[$static ? 'default_static_members' : 'default_properties'][$key]; 1660 if (isset($value)) { 1650 1661 echo ' = '; 1651 echo str(value($v ));1662 echo str(value($value)); 1652 1663 } 1653 1664 echo ";\n"; -
trunk/processor/processor.m4
r710 r713 75 75 zval_copy_ctor(dst); 76 76 Z_SET_REFCOUNT(*dst, 1); 77 switch ((Z_TYPE_P(src) & IS_CONSTANT_TYPE_MASK)) {78 case IS_CONSTANT:79 dst->type = UNISW(IS_STRING, UG(unicode) ? IS_UNICODE : IS_STRING);80 break;81 case IS_CONSTANT_ARRAY:82 dst->type = IS_ARRAY;83 break;84 }85 77 DONE(value) 86 78 DONE(type) -
trunk/xcache.c
r702 r713 3013 3013 } 3014 3014 3015 if (value->type == IS_CONSTANT) { 3015 switch ((Z_TYPE_P(value) & IS_CONSTANT_TYPE_MASK)) { 3016 case IS_CONSTANT: 3016 3017 *return_value = *value; 3017 3018 zval_copy_ctor(return_value); 3018 3019 return_value->type = UNISW(IS_STRING, UG(unicode) ? IS_UNICODE : IS_STRING); 3019 return; 3020 } 3021 3022 if (value->type == IS_CONSTANT_ARRAY) { 3020 break; 3021 3022 case IS_CONSTANT_ARRAY: 3023 3023 *return_value = *value; 3024 3024 zval_copy_ctor(return_value); 3025 3025 return_value->type = IS_ARRAY; 3026 return; 3027 } 3028 3029 RETURN_NULL(); 3026 break; 3027 3028 default: 3029 RETURN_NULL(); 3030 } 3030 3031 } 3031 3032 /* }}} */
Note: See TracChangeset
for help on using the changeset viewer.

