Changeset 3934
- Timestamp:
- 04/24/07 16:56:43 (6 years ago)
- Files:
-
- freepbx/trunk (modified) (1 prop)
- freepbx/trunk/amp_conf/bin/module_admin (modified) (4 diffs)
- freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php (modified) (5 diffs)
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 307 307 308 308 function 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))) { 310 314 out("The following error(s) occured:"); 311 315 out(' - '.implode("\n - ",$errors)); … … 423 427 424 428 // **** 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="); 427 431 428 432 $args = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), $shortopts, $longopts); … … 438 442 $force = false; 439 443 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 440 450 foreach ($args[0] as $arg) { 441 451 switch ($arg[0]) { … … 450 460 $ampconfpath = $arg[1]; 451 461 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; 452 468 } 453 469 } freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php
r3904 r3934 1133 1133 * a php zero-value (false, null, 0, etc) then no error happened. 1134 1134 */ 1135 function module_getonlinexml($module = false ) { // was getModuleXml()1135 function module_getonlinexml($module = false, $override_xml = false) { // was getModuleXml() 1136 1136 global $amp_conf; 1137 1137 … … 1155 1155 preg_match('/(\d+\.\d+)/',$version,$matches); 1156 1156 //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"])) { 1158 1160 $fn = $amp_conf["AMPMODULEXML"]."modules-".$matches[1].".xml"; 1159 1161 // echo "(From amportal.conf)"; //debug … … 1559 1561 * @return mixed True if succesful, array of error messages if not succesful 1560 1562 */ 1561 function module_download($modulename, $force = false, $progress_callback = null) { // was fetchModule 1563 1564 // was fetchModule 1565 function module_download($modulename, $force = false, $progress_callback = null, $override_svn = false, $override_xml = false) { 1562 1566 global $amp_conf; 1563 1567 … … 1571 1575 } 1572 1576 1573 $res = module_getonlinexml($modulename );1577 $res = module_getonlinexml($modulename, $override_xml); 1574 1578 if ($res == null) { 1575 1579 return array(_("Module not found in repository")); … … 1615 1619 } 1616 1620 1617 if (isset($amp_conf['AMPMODULESVN'])) { 1621 if ($override_svn) { 1622 $url = $override_svn.$res['location']; 1623 } elseif (isset($amp_conf['AMPMODULESVN'])) { 1618 1624 $url = $amp_conf['AMPMODULESVN'].$res['location']; 1619 // echo "(From amportal.conf)"; // debug1620 1625 } else { 1621 1626 $url = "http://mirror.freepbx.org/modules/".$res['location']; 1622 // echo "(From default)"; // debug1623 1627 } 1624 1628
