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

Diff of /nfo/php/libs/org.netfrag.glib/Exporter.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by joko, Fri Mar 28 03:05:20 2003 UTC revision 1.6 by joko, Fri Apr 4 17:33:49 2003 UTC
# Line 13  Line 13 
13   * $Id$   * $Id$
14   *   *
15   * $Log$   * $Log$
16     * Revision 1.6  2003/04/04 17:33:49  joko
17     * updated/enhanced/fixed behaviour of 'function create_stub_function'
18     *
19   * Revision 1.5  2003/03/28 03:05:20  joko   * Revision 1.5  2003/03/28 03:05:20  joko
20   * minor update: fixed labels, modified debugging level   * minor update: fixed labels, modified debugging level
21   *   *
# Line 223  class Exporter { Line 226  class Exporter {
226        //function &$target_name() { \$args = func_get_args(); return call_user_func_array(array($source_class, $source_name), &\$args); }        //function &$target_name() { \$args = func_get_args(); return call_user_func_array(array($source_class, $source_name), &\$args); }
227        //function &$target_name() { \$args = php::array_shrink(func_get_args()); return call_user_func_array(array($source_class, $source_name), &\$args); }        //function &$target_name() { \$args = php::array_shrink(func_get_args()); return call_user_func_array(array($source_class, $source_name), &\$args); }
228        //function &$target_name() { \$args = Exporter::wrap_args(func_get_args()); return call_user_func_array(array($source_class, $source_name), &\$args); }        //function &$target_name() { \$args = Exporter::wrap_args(func_get_args()); return call_user_func_array(array($source_class, $source_name), &\$args); }
229        
230        // taha that's it!
231      $stub =      $stub =
232  <<<TPL_FUNC  <<<TPL_FUNC
233        function &$target_name() {        function &$target_name() {
234          \$args = php::array_shrink(func_get_args());          \$passthru = php::array_shrink(func_get_args());
235          return call_user_func_array(array('$source_class', '$source_name'), &\$args);          if (is_array(\$passthru)) {
236              return call_user_func_array(array('$source_class', '$source_name'), &\$passthru);
237            } else {
238              return call_user_func(array('$source_class', '$source_name'), &\$passthru);
239            }
240        }        }
241          // signal good
242          return 1;
243  TPL_FUNC;  TPL_FUNC;
244    
245        /*        /*
246        // alternative        // possible alternative? not yet...
247        $function = <<<TPL_FUNC        $function = <<<TPL_FUNC
248          class $target_class() {          class $target_class() {
249            function &$target_name() { return $source_class::$source_name(func_get_args()); }            function &$target_name() { return $source_class::$source_name(func_get_args()); }
# Line 243  TPL_FUNC; Line 254  TPL_FUNC;
254      // debug      // debug
255        //print "selected stub: <br/>$stub<br/>";        //print "selected stub: <br/>$stub<br/>";
256            
257      eval($stub);      // V1
258        //eval($stub);
259        //return 1;
260            
261      return 1;      // V2
262        return eval($stub);
263            
264    }    }
265    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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