php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #35012 echo, print ... reverse compiling php scripts
Submitted: 2005-10-29 03:03 UTC Modified: 2013-02-17 12:37 UTC
From: flobee at gmail dot com Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 5.1.0RC4 OS: any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-10-29 03:03 UTC] flobee at gmail dot com
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







Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-17 12:37 UTC] nikic@php.net
This is not technically feasible.
 [2013-02-17 12:37 UTC] nikic@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 17:01:31 2024 UTC