upload large savedvariables cause memory exhausted
Brought to you by:
konkers
to fix. change lua parser.
1. do not store all savedvariables line on memory.
2. should parse only myProfile variable.
Hotfix like this... need refine.
function lua_parse( $filename ) {
$stack = array( array( "", array()) );
$stack_pos = 0;
- $lines = file( $filename );
+ $handle = fopen($filename, "r");
+ $start=false;
+ $end = false;
+ $lines = array();
+ while(!$end and !feof($handle)) {
+ $line = fgets($handle, 4096);
+ if(strncmp($line, "myProfile = {", 13) == 0) {
+ $start=true;
+ }
+ if($start) {
+ $lines[] = $line;
+ }
+ if($start and (strncmp($line, "}", 1) == 0)) {
+ $end = true;
+ }
+ }
+ fclose($handle);
$last_line = "";
foreach( $lines as $line ){