Hi,

I discovered an issue with the javascriptCaptureStart/javascriptCaptureEnd
function pair. When the captured text exceeds a certain limit (about 50kB in
my case), the function returns only a semi-colon.

I have the following code in a view script:


<?php $this->dojo()->javascriptCaptureStart(); ?>
var data = <?php echo $this->data; ?>;
...
<?php $this->dojo()->javascriptCaptureEnd(); ?>


And, as the number of rows in my database table is growing, $this->data is
getting bigger and bigger. Finally, over ~50KB, the PHP tag returns a
semi-colon and nothing else (not even the "var data =" preceeding that tag).


I was able to trace this issue back to the function addJavascript($js) in
Zend_Dojo_View_Helper_Dojo_Container and more precisely to the preg_replace
function:

        $js = preg_replace('/^\s*(.*?)\s*$/s', '$1', $js);


I replaced it by:

        $js = trim($js);

and everything was fine.

Therefore, I have two questions:

- is there a know limitation on preg_replace()

- why did you use a preg_replace function to trim the string ?

-----
Guillaume ORIOL
Sofware architect
Technema
-- 
View this message in context: 
http://www.nabble.com/size-limit-raised-on-javascriptCaptureStart%28%29-tp23139812p23139812.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to