Changeset 4309

Show
Ignore:
Timestamp:
07/06/07 01:52:05 (6 years ago)
Author:
gregmac
Message:

Add hidden --make-links-devel option to install_amp

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.3/install_amp

    r4272 r4309  
    110110  out("  --install-moh            Install default music-on-hold files (normally doesn't, unless "); 
    111111  out("                           it's a new installation)"); 
     112  //out("  --make-links-devel       Make links to files in the source directory instead of copying"); 
     113  //out("                           (intended for developers only)"); 
    112114  out("  --my-svn-is-correct      Ignore Asterisk version, assume it is correct"); 
    113115  out("  --engine <name>          Use the specified PBX Engine ('asterisk', 'asterisk14' or 'openpbx')"); 
     
    292294  global $asterisk_conf; 
    293295  global $install_moh; 
     296  global $make_links; 
    294297 
    295298  // total # files, # actually copied 
     
    366369        $num_files++; 
    367370        if ($overwrite) { 
    368           debug("copy ".$source." -> ".$destination); 
     371          debug(($make_links ? "link" : "copy")." ".$source." -> ".$destination); 
    369372          if (!$dryrun) { 
    370             copy($source, $destination); 
     373            if ($make_links) { 
     374              // symlink, unlike copy, doesn't overwrite - have to delete first 
     375              if (is_link($destination) || file_exists($destination)) { 
     376                unlink($destination); 
     377              } 
     378              symlink($_ENV["PWD"]."/".$source, $destination); 
     379            } else { 
     380              copy($source, $destination); 
     381            } 
    371382            $num_copied++; 
    372383          } 
     
    758769// **** Parse out command-line options 
    759770$shortopts = "h?u:p:"; 
    760 $longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files","dbname=","my-svn-is-correct","engine=","install-moh"); 
     771$longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files","dbname=","my-svn-is-correct","engine=","install-moh","make-links-devel"); 
    761772 
    762773$args = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), $shortopts, $longopts); 
     
    773784 
    774785$install_moh = false; 
     786$make_links = false; 
    775787 
    776788//initialize variables to avoid php notices 
     
    829841    case "--install-moh": 
    830842      $install_moh = true; 
     843    break; 
     844    case "--make-links-devel": 
     845      $make_links = true; 
    831846    break; 
    832847    case "--fopwebroot":