root/modules/branches/2.5/fw_ari/install.php

Revision 6500, 1.7 kB (checked in by p_lindheimer, 5 years ago)

remove inclusion of libfreepbx.install.php in install script resulting in warnings

Line 
1 <?php
2
3 // HELPER FUNCTIONS:
4
5 function fw_ari_print_errors($src, $dst, $errors) {
6     echo "error copying fw_ari files:<br />'cp -rf' from src: '$src' to dst: '$dst'...details follow<br />";
7     foreach ($errors as $error) {
8         echo "$error<br />";
9     }
10 }
11
12 if (! function_exists('out')) {
13     function out($text) {
14         echo $text."<br>";
15     }
16 }
17
18 if (! function_exists('outn')) {
19     function outn($text) {
20         echo $text;
21     }
22 }
23
24 if (! function_exists('error')) {
25     function error($text) {
26         echo "[ERROR] ".$text."<br>";
27     }
28 }
29
30 if (! function_exists('fatal')) {
31     function fatal($text) {
32         echo "[FATAL] ".$text."<br>";
33         exit(1);
34     }
35 }
36
37 if (! function_exists('debug')) {
38     function debug($text) {
39         global $debug;
40         
41         if ($debug) echo "[DEBUG-preDB] ".$text."<br>";
42     }
43 }
44
45 global $amp_conf;
46 global $asterisk_conf;
47
48 $debug = false;
49 $dryrun = false;
50
51 /** verison_compare that works with freePBX version numbers
52  *  included here because there are some older versions of functions.inc.php that do not have
53  *  it included as it was added during 2.3.0beta1
54  */
55 if (!function_exists('version_compare_freepbx')) {
56     function version_compare_freepbx($version1, $version2, $op = null) {
57         $version1 = str_replace("rc","RC", strtolower($version1));
58         $version2 = str_replace("rc","RC", strtolower($version2));
59         if (!is_null($op)) {
60             return version_compare($version1, $version2, $op);
61         } else {
62             return version_compare($version1, $version2);
63         }
64     }
65 }
66
67 /*
68  * fw_ari install script
69  */
70
71     $htdocs_ari_source = dirname(__FILE__)."/htdocs_ari/*";
72     $htdocs_ari_dest = $amp_conf['AMPWEBROOT']."/recordings";
73
74     exec("cp -rf $htdocs_ari_source $htdocs_ari_dest 2>&1",$out,$ret);
75     if ($ret != 0) {
76         fw_ari_print_errors($htdocs_panel_source, $htdocs_panel_dest, $out);
77     }
78
79 ?>
80
Note: See TracBrowser for help on using the browser.