root/modules/branches/2.4/music/install.php

Revision 4538, 0.8 kB (checked in by p_lindheimer, 5 years ago)

#2070 fix bad use of <? with <?php

  • Property svn:mime-type set to text/html
  • Property svn:eol-style set to native
Line 
1 <?php
2 global $asterisk_conf;
3 require_once("modules/music/functions.inc.php");
4
5 $File_Write="";
6 $tresults = music_list($asterisk_conf['astvarlibdir']."/mohmp3");
7 if (isset($tresults)) {
8   foreach ($tresults as $tresult)  {
9     if ($tresult != "default" ) {
10       $dir = $asterisk_conf['astvarlibdir']."/mohmp3/{$tresult}/";
11     } else {
12       $dir = $asterisk_conf['astvarlibdir']."/mohmp3/";
13     }
14     if (file_exists("{$dir}.random")) {
15       $File_Write.="[{$tresult}]\nmode=files\ndirectory={$dir}\nrandom=yes\n";
16     } else {
17       $File_Write.="[{$tresult}]\nmode=files\ndirectory={$dir}\n";
18     }
19   }
20 }
21 $handle = fopen("/etc/asterisk/musiconhold_additional.conf", "w");
22
23 if (fwrite($handle, $File_Write) === FALSE) {
24   echo _("Cannot write to file")." ($tmpfname)";
25   exit;
26 }
27
28 fclose($handle);
29
30 needreload();
31
32 ?>
Note: See TracBrowser for help on using the browser.