Hello,
Since serveral days I'm searching why tbs can not generating my page...
Here are the information.
First I'm in un sub-template, that looks like this : index.php -> dispatcher.php -> sub-dispatch.php -> page.php
Secondly the page.php is quite simple :
...
// SETTING TBS
if (isset($this)) {
$TBS = &$this;
} else {
include_once('../tbs/tbs_class.php');
$TBS = new clsTinyButStrong;
}
// VARS;
$arr = array();
$iterator = 0;
$sql = "SELECT * FROM t_global_matrix WHERE matrix_nw = '$nwserver' AND matrix_date = '$maxdate' ORDER BY matrix_nw,matrix_clt ASC";
$req = mysql_query($sql);
while($data = mysql_fetch_array($req))
{
$arr[$iterator] = array();
$arr[$iterator]['data'] = $data;
if($data['matrix_option'] == "OPTION 2")
$arr[$iterator]['class'] = 'ext';
else
$arr[$iterator]['class'] = 'nofact';
$iterator++;
}
$TBS->LoadTemplate('../templates/view_global_matrix.tpl');
$TBS->MergeBlock('blk', 'array', $arr);
$TBS->Show();
|
The HTML template file is like this :
[...]
<table>
<thead>
<tr>
<th colspan="10">Matrice Globale Sauvegarde de [nwserver.name]</th>
</tr>
<tr>
<td>Client</td>
<td>NW Server</td>
<td>Jukebox</td>
<td>Pool</td>
<td>Group</td>
<td>Offre</td>
<td>Option</td>
<td>Type Backup</td>
<td></td>
</tr>
</thead>
<TBODY>
[blk;block=begin;sub1]
<TR>
<TD class='[blk.class]'>[blk_sub1.matrix_clt]</TD>
<TD class='[blk.class]'>[blk_sub1.matrix_nw]</TD>
<TD class='[blk.class]'>[blk_sub1.matrix_jbx]</TD>
<TD class='[blk.class]'>[blk_sub1.matrix_pool]</TD>
<TD class='[blk.class]'>[blk_sub1.matrix_group]</TD>
<TD class='[blk.class]'>[blk_sub1.matrix_offre]</TD>
<TD class='[blk.class]'>[blk_sub1.matrix_option]</TD>
<TD class='[blk.class]'>[blk_sub1.matrix_offre_type]</TD>
<TD>(some action link)</TD>
</TR>
[blk;block=end]
</TBODY>
</TABLE>
[...]
[/code
|
For 250 entries in the $arr array, it take nearly 14 secondes to generate the page.
With XDebug I've done some profiling and I see that it take 12 secondes to execude the f_Xml_FindTag (in two different call).
I've got some time 2000+ entries in the $arr array, so the page don't generate as it exceded 30 seconds, and php don't allow it by default.
So is there a way to optimize this ?
Am I wrong in using TBS ?
Before I use TBS the page was static on generate in less than 1 seconde...