Fix: Remove optimization because this break order of requests.
This commit is contained in:
parent
f52ff46798
commit
b3641fbc03
@ -502,40 +502,63 @@ class DolibarrModules
|
|||||||
$dir = $dirroot.$reldir;
|
$dir = $dirroot.$reldir;
|
||||||
$ok = 0;
|
$ok = 0;
|
||||||
|
|
||||||
|
// Run llx_mytable.sql files
|
||||||
$handle=@opendir($dir); // Dir may not exists
|
$handle=@opendir($dir); // Dir may not exists
|
||||||
if (is_resource($handle))
|
if (is_resource($handle))
|
||||||
{
|
{
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
// Run llx_mytable.sql files
|
|
||||||
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
|
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
|
||||||
{
|
{
|
||||||
$result=run_sql($dir.$file,1,'',1);
|
$result=run_sql($dir.$file,1,'',1);
|
||||||
if ($result <= 0) $error++;
|
if ($result <= 0) $error++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
}
|
||||||
|
|
||||||
// Run llx_mytable.key.sql files
|
// Run llx_mytable.key.sql files (Must be done after llx_mytable.sql)
|
||||||
else if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
|
$handle=@opendir($dir); // Dir may not exist
|
||||||
|
if (is_resource($handle))
|
||||||
|
{
|
||||||
|
while (($file = readdir($handle))!==false)
|
||||||
|
{
|
||||||
|
if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
|
||||||
{
|
{
|
||||||
$result=run_sql($dir.$file,1,'',1);
|
$result=run_sql($dir.$file,1,'',1);
|
||||||
if ($result <= 0) $error++;
|
if ($result <= 0) $error++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
}
|
||||||
|
|
||||||
// Run data_xxx.sql files
|
// Run data_xxx.sql files (Must be done after llx_mytable.key.sql)
|
||||||
else if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data')
|
$handle=@opendir($dir); // Dir may not exist
|
||||||
|
if (is_resource($handle))
|
||||||
|
{
|
||||||
|
while (($file = readdir($handle))!==false)
|
||||||
|
{
|
||||||
|
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data')
|
||||||
{
|
{
|
||||||
$result=run_sql($dir.$file,1,'',1);
|
$result=run_sql($dir.$file,1,'',1);
|
||||||
if ($result <= 0) $error++;
|
if ($result <= 0) $error++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
}
|
||||||
|
|
||||||
// Run update_xxx.sql files
|
// Run update_xxx.sql files
|
||||||
else if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,6) == 'update')
|
$handle=@opendir($dir); // Dir may not exist
|
||||||
|
if (is_resource($handle))
|
||||||
|
{
|
||||||
|
while (($file = readdir($handle))!==false)
|
||||||
|
{
|
||||||
|
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,6) == 'update')
|
||||||
{
|
{
|
||||||
$result=run_sql($dir.$file,1,'',1);
|
$result=run_sql($dir.$file,1,'',1);
|
||||||
if ($result <= 0) $error++;
|
if ($result <= 0) $error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user