/[cvs]/nfo/php/libs/org.netfrag.glib/Data/Deep.php
ViewVC logotype

Annotation of /nfo/php/libs/org.netfrag.glib/Data/Deep.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Mon Feb 3 14:51:44 2003 UTC (21 years, 6 months ago) by joko
Branch: MAIN
+ initial commit
+ refactored from flib/...

1 joko 1.1 <?
2     // -------------------------------------------------------------------------
3     // $Id: TextEncode.php,v 1.2 2003/02/03 03:40:02 jonen Exp $
4     // -------------------------------------------------------------------------
5     // $Log: TextEncode.php,v $
6     // -------------------------------------------------------------------------
7    
8    
9     class Data_Deep {
10    
11     var $payload;
12    
13     function Data_Deep(&$payload) {
14     $this->payload = &$payload;
15     }
16    
17     function &get($attr) {
18     $evalstr = 'return $this->payload' . $this->_getHKR($attr) . ';';
19     $val = eval($evalstr);
20     return $val;
21     }
22    
23     function set($attr, $val) {
24     //$evalstr = '$this->payload' . $this->_getHKR($attr) . ' = \'' . $val . '\';';
25     $evalstr = '$this->payload' . $this->_getHKR($attr) . ' = $val;';
26     eval($evalstr);
27     }
28    
29     function getPayload() {
30     return $this->payload;
31     }
32    
33     function _getHKR($key) {
34     $attr_arr = split('\.', $key);
35     $attr_hkr = '["' . join('"]["', $attr_arr) . '"]';
36     return $attr_hkr;
37     }
38    
39     }
40    
41     ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed