Changeset 3934

Show
Ignore:
Timestamp:
04/24/07 16:56:43 (6 years ago)
Author:
p_lindheimer
Message:

Merged revisions 3726-3727,3729-3732,3734-3735,3737-3738,3740-3741,3743,3745,3747,3752-3753,3756,3758-3769,3771,3773-3774,3778-3793,3797,3799-3804,3807,3809-3825,3827-3829,3831-3836,3838-3845,3847,3850,3852-3856,3859-3869,3871,3873-3882,3884-3885,3887-3890,3892-3895,3897-3902,3904,3906,3908,3910-3916,3918,3920,3922-3927,3929-3933 via svnmerge from
https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/branches/2.2

........

r3933 | p_lindheimer | 2007-04-24 13:54:49 -0700 (Tue, 24 Apr 2007) | 1 line


add argument to module_admin to override default repository and xml locations, and override amportal.conf settings

........

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk

    • Property svnmerge-integrated changed from /freepbx/branches/2.2:1-3724,3726-3727,3729-3732,3734-3735,3737-3738,3740-3741,3743-3745,3747,3752-3753,3755-3793,3797-3928 to /freepbx/branches/2.2:1-3724,3726-3727,3729-3732,3734-3735,3737-3738,3740-3741,3743-3745,3747,3752-3753,3755-3793,3797-3933
  • freepbx/trunk/amp_conf/bin/module_admin

    r3925 r3934  
    307307 
    308308function doDownload($modulename, $force) { 
    309   if (is_array($errors = module_download($modulename, $force, 'download_progress'))) { 
     309 
     310  global $modulexml_path; 
     311  global $modulerepository_path; 
     312 
     313  if (is_array($errors = module_download($modulename, $force, 'download_progress', $modulerepository_path, $modulexml_path))) { 
    310314    out("The following error(s) occured:"); 
    311315    out(' - '.implode("\n - ",$errors)); 
     
    423427 
    424428// **** Parse out command-line options 
    425 $shortopts = "h?fc:"; 
    426 $longopts = array("help","debug","config="); 
     429$shortopts = "h?fc:x:r:"; 
     430$longopts = array("help","debug","config=","modulexml-path=","modulerepository-path="); 
    427431 
    428432$args = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), $shortopts, $longopts); 
     
    438442$force = false; 
    439443 
     444// override xml and svn repository paths from hardcoded and amportal.conf defaults 
     445// currently only implemented for downloading (to facilitate automatic installations) 
     446// 
     447$modulexml_path = false; 
     448$modulerepository_path = false; 
     449 
    440450foreach ($args[0] as $arg) { 
    441451  switch ($arg[0]) { 
     
    450460      $ampconfpath = $arg[1]; 
    451461    break; 
     462    case "--modulexml-path": case "x": 
     463      $modulexml_path = rtrim($arg[1],DIRECTORY_SEPARATOR)."/"; 
     464    break; 
     465    case "--modulerepository-path": case "r": 
     466      $modulerepository_path = rtrim($arg[1],DIRECTORY_SEPARATOR)."/"; 
     467    break; 
    452468  } 
    453469} 
  • freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php

    r3904 r3934  
    11331133 * a php zero-value (false, null, 0, etc) then no error happened. 
    11341134 */ 
    1135 function module_getonlinexml($module = false) { // was getModuleXml() 
     1135function module_getonlinexml($module = false, $override_xml = false) { // was getModuleXml() 
    11361136  global $amp_conf; 
    11371137   
     
    11551155    preg_match('/(\d+\.\d+)/',$version,$matches); 
    11561156    //echo "the result is ".$matches[1]; 
    1157     if (isset($amp_conf["AMPMODULEXML"])) { 
     1157    if ($override_xml) { 
     1158      $fn = $override_xml."modules-".$matches[1].".xml"; 
     1159    } elseif (isset($amp_conf["AMPMODULEXML"])) { 
    11581160      $fn = $amp_conf["AMPMODULEXML"]."modules-".$matches[1].".xml"; 
    11591161      // echo "(From amportal.conf)"; //debug 
     
    15591561 * @return  mixed   True if succesful, array of error messages if not succesful 
    15601562 */ 
    1561 function module_download($modulename, $force = false, $progress_callback = null) { // was fetchModule  
     1563 
     1564// was fetchModule  
     1565function module_download($modulename, $force = false, $progress_callback = null, $override_svn = false, $override_xml = false) {  
    15621566  global $amp_conf; 
    15631567   
     
    15711575  } 
    15721576       
    1573   $res = module_getonlinexml($modulename); 
     1577  $res = module_getonlinexml($modulename, $override_xml); 
    15741578  if ($res == null) { 
    15751579    return array(_("Module not found in repository")); 
     
    16151619  } 
    16161620   
    1617   if (isset($amp_conf['AMPMODULESVN'])) { 
     1621  if ($override_svn) { 
     1622    $url = $override_svn.$res['location']; 
     1623  } elseif (isset($amp_conf['AMPMODULESVN'])) { 
    16181624    $url = $amp_conf['AMPMODULESVN'].$res['location']; 
    1619     // echo "(From amportal.conf)"; // debug 
    16201625  } else { 
    16211626    $url = "http://mirror.freepbx.org/modules/".$res['location']; 
    1622     // echo "(From default)"; // debug 
    16231627  } 
    16241628