Let the apps be more self-contained regarding LUA scripts (#2440)

At this moment, all LUA scripts must be at resources/install/script, this patch allows applications to be more self-contained by having app/*/resources/install/scripts directory, which it will be copied to the scripts_dir directory as well.
This commit is contained in:
Luis Daniel Lucio Quiroz
2017-03-22 11:25:33 -04:00
committed by FusionPBX
parent 745bfd652d
commit ea669cbf69

View File

@@ -106,6 +106,13 @@ if (!class_exists('scripts')) {
if (is_readable($dst_dir)) {
recursive_copy($src_dir,$dst_dir);
unset($src_dir);
// Copy the app/*/resource/install/scripts
$app_scripts = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'app/*/resource/install/scripts');
foreach ($app_scripts as $app_script){
recursive_copy($app_script, $dst_dir);
}
unset($app_scripts);
}else{
throw new Exception("Cannot read from '$src_dir' to get the scripts");
}