#35012 [NEW]: echo, print ... reverse compiling php scripts

From: Date: Sat, 29 Oct 2005 01:03:08 +0000
Subject: #35012 [NEW]: echo, print ... reverse compiling php scripts
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-87193@lists.php.net to get a copy of this message
From: flobee at gmail dot com Operating system: any PHP version: 5.1.0RC4 PHP Bug Type: Feature/Change Request Bug description: echo, print ... reverse compiling php scripts Description: ------------ HI! i need a function which returns all echo'd var. a list which shows me used and outputed things. print_r(all echo); eg: $var = 'php'; $n = array(0=>'no',1=>'maybe',2=>'in 2005'); echo "$var is cool ".$n[2]; if($var=='pl') echo $n[1]; } // function could be named: $x = get_echoed_vars(); // $x: array('var'=>'php', 'n'=>array(2=>'in 2005') ) with this information we would be able to automate/compile php scripts (setup-scripts) dynamicly and reversible to justify script load/ressoureces in any way. or for more debug informations. (nearly like the compiler of smarty template engin, which gave me the idea: get speed without chaching or where sites cannot be cached; optimising autogenerated). programer <-> designer. problem! e.g.: when it is not clear which content really is used in a program. mostly the programmer builts an admin interface for the designer to setup a site / editing templates ... so: to give a designer max. options for a site you give him 4 varibales (in reality tonns of it) which can be included in a template. designer A take 2 vars, designer B use 4 variables for his template. so, why should be 4 variables available for designer A when he is only using 2 of it. with get_echoed_vars() i could read the needed data and rebuilt the setup-script for him (which will load the needed data). so i will have maximunm performance. :: data diagramm # default data (which will be loaded form any datacontainer (DB,txt,xml...) if(empty($designer) { $data = array( 'id'=>1, 'name'=>'title text', 'longtext'=>'long text', 'verylongtext'=>' 65555 chars'); } # programm displays all the loaded content. # designer reduce the template to display 'id' and 'title' # activating compiling mode # compiler programm calls get_echoed_vars() and rebuilts the setup setup now (data which should be loaded when program of designer A is running: $data = array( 'id'=>1, 'name'=>'title text'); actually i have this problem with 200 sites where 100% of data is available in templates and only the half of it is really displayed :-| chaching is not always the best way. king regards flo -- Edit bug report at http://bugs.php.net/?id=35012&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35012&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=35012&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=35012&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=35012&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=35012&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=35012&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=35012&r=needscript Try newer version: http://bugs.php.net/fix.php?id=35012&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=35012&r=support Expected behavior: http://bugs.php.net/fix.php?id=35012&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=35012&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=35012&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=35012&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35012&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=35012&r=dst IIS Stability: http://bugs.php.net/fix.php?id=35012&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=35012&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=35012&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=35012&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=35012&r=mysqlcfg

« previous php.bugs (#87193) next »