Changeset 1456

Show
Ignore:
Timestamp:
04/09/06 19:33:16 (7 years ago)
Author:
mheydon1973
Message:

Install script wasn't running sql files first

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/install_amp

    r1422 r1456  
    315315   
    316316  if (is_dir(UPGRADE_DIR."/".$version)) { 
     317    // sql scripts first 
    317318    $dir = opendir(UPGRADE_DIR."/".$version); 
    318319    while ($file = readdir($dir)) { 
     
    338339            } 
    339340          } 
    340            
    341         } else if (strtolower(substr($file,-4)) == ".php") { 
    342           out("-> Running PHP script ".UPGRADE_DIR."/".$version."/".$file); 
    343           if (!$dryrun) { 
    344             run_included(UPGRADE_DIR."/".$version."/".$file); 
    345           } 
    346            
    347         } else if (is_executable(UPGRADE_DIR."/".$version."/".$file)) { 
    348           out("-> Executing ".UPGRADE_DIR."/".$version."/".$file); 
    349           if (!$dryrun) { 
    350             exec(UPGRADE_DIR."/".$version."/".$file); 
    351           } 
    352         } else { 
    353           error("-> Don't know what to do with ".UPGRADE_DIR."/".$version."/".$file); 
    354341        } 
    355342      } 
    356343    } 
     344 
     345                // now non sql scripts 
     346                $dir = opendir(UPGRADE_DIR."/".$version); 
     347                while ($file = readdir($dir)) { 
     348                        if (($file[0] != ".") && is_file(UPGRADE_DIR."/".$version."/".$file)) { 
     349                                if (strtolower(substr($file,-4)) == ".sql") { 
     350          // sql scripts were dealt with first 
     351                                } else if (strtolower(substr($file,-4)) == ".php") { 
     352                                        out("-> Running PHP script ".UPGRADE_DIR."/".$version."/".$file); 
     353                                        if (!$dryrun) { 
     354                                                run_included(UPGRADE_DIR."/".$version."/".$file); 
     355                                        } 
     356 
     357                                } else if (is_executable(UPGRADE_DIR."/".$version."/".$file)) { 
     358                                        out("-> Executing ".UPGRADE_DIR."/".$version."/".$file); 
     359                                        if (!$dryrun) { 
     360                                                exec(UPGRADE_DIR."/".$version."/".$file); 
     361                                        } 
     362                                } else { 
     363                                        error("-> Don't know what to do with ".UPGRADE_DIR."/".$version."/".$file); 
     364                                } 
     365                        } 
     366                } 
     367 
    357368  } 
    358369}